Sei sulla pagina 1di 6

# Create new state database replica

/usr/sbin/metadb -a -f c2t4d0s3
/usr/sbin/metadb -a c2t3d0s3
/usr/sbin/metadb -a c2t2d0s3
/usr/sbin/metadb -a c2t1d0s3

# To show replica info


metadb
metadb -a -f c2t3d0s3

# Delete replica info


metadb -d c2t3d0s3

# Create new hot spare pool


/usr/sbin/metainit hsp0
/usr/sbin/metahs -a hsp0 c2t4d0s0

RAID 0 (concatenation)

# Create new volume(concatenate)


/usr/sbin/metainit d0 3 1 c2t3d0s0 1 c2t2d0s0 1 c2t1d0s0
/usr/sbin/metaparam -h hsp0 d0

# Add Stripe to concatenation


/usr/sbin/metattach d0 c0d0s3

# TO show
metastat d0
metstat -p

#to create a new file system


newfs /dev/md/rdsk/d0
mkdir /concat
mount /dev/md/dsk/do /concat
df-h

# Detach hot spare pool from volume d0


/usr/sbin/metaparam -h none d0

# Delete volume d0
umount /concat
/usr/sbin/metaclear d0
RAID 0 (striped)

# Create new striped volume


/usr/sbin/metainit d0 1 3 c2t3d0s0 c2t2d0s0 c2t1d0s0
/usr/sbin/metaparam -h hsp000 d0

# Add Stripe to concatenation


/usr/sbin/metattach d0 c0d0s3

#to create a new file system


newfs /dev/md/rdsk/d0
mkdir /stipe
mount /dev/md/dsk/do /stripe
df-h

# Delete volume d0
umount /stripe
/usr/sbin/metaclear d0

RAID 1 (mirroring)

# Create new raid0 volume


/usr/sbin/metainit d0 1 1 c2t1d0s0

# Create new raid0 volume


/usr/sbin/metainit d1 1 1 c2t2d0s0

# Create new raid1 volume


/usr/sbin/metainit d2 -m d0

# Add submirror to mirror


/usr/sbin/metattach d2 d1

#Detaching submirror from mirror


metadetach d2 d1

# Offline submirror
/usr/sbin/metaoffline -f d2 d0

# Online submirror
/usr/sbin/metaonline d2 d0

#to create a new file system


newfs /dev/md/rdsk/d2
mkdir /mirror
mount /dev/md/dsk/d2 /mirror
df-h | grep -i /mirror

# Delete volume d2
umount /mirror
/usr/sbin/metaclear d2 ---->only parent
/usr/sbin/metaclear -r d2 ---->parent with submirrors

# Delete volume d0
/usr/sbin/metaclear d0

# Delete volume d1
/usr/sbin/metaclear d1

# Delete hot spare pool hsp000


/usr/sbin/metaclear hsp000

RAID 5 (Striping with parity)

# Create new volume


/usr/sbin/metainit d5 -r c2t3d0s0 c2t2d0s0 c2t1d0s0

# Add component to RAID5


/usr/sbin/metattach d5 c2t4d0s0

# Resync volume
/usr/sbin/metasync -p d5

# Replace component in RAID5


/usr/sbin/metareplace -f d5 c2t4d0s0 c2t1d0s4

# Enable component in RAID5


/usr/sbin/metareplace -e d5 c2t1d0s4

# Resync volume
/usr/sbin/metasync d5

#to create a new file system


newfs /dev/md/rdsk/d5
mkdir /r5
mount /dev/md/dsk/d2 /r5
df-h | grep -i /r5

# Delete volume d5
/usr/sbin/metaclear d5

Create a RAID-1 Volume From the root (/) File System

1. Create a RAID-0 volume for the file system you want to mirror.
2. Create a second RAID-0 volume to contain the second submirror of the RAID-1 volume.
3. Create a one-way mirror using the RAID-0 volume that contains the file system to be
mirrored.
4. Use the metaroot command to update the system's configuration, as this is a root (/)
mirror.
5. Reboot your system, as this is a root (/) mirror.
6. Attach the second submirror to the file system mirror.
7. Record the alternate boot path that is used in the event of a failure of the primary
submirror, as this is a mirror of the root (/) file system.

# metainit -f d1 1 1 c0t0d0s0 --à/ slice


d1: Concat/Stripe is setup
# metainit d2 1 1 c0t1d0s0 ---àsubmirror
d2: Concat/Stripe is setup
# metainit d0 -m d1 -------------à adding to mirror
d0: Mirror is setup
# metaroot d0 -----------------àFor updating /etc/vfstab
# grep md /etc/vfstab
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
# tail /etc/system
rootdev:/pseudo/md@0:0,10,blk
# lockfs –fa ------------------à
# reboot
...
# df -h /
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d0 141M 111M 15M 88% /
# metattach d0 d2
d0: Submirror d2 is attached
# ls -l /dev/dsk/c0t1d0s0
lrwxrwxrwx 1 root root 88 Feb 8 15:51 /dev/rdsk/c1t3d0s0 ->
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a
# init 0
.
.
.
ok nvalias backup_root /pci@1f,0/pci@1,1/ide@3/disk@0,0:a
ok setenv boot-device disk backup_root net
ok nvstore

Unmirroring the Root (/) File System

1. Run the metadetach command on the mirror to make a one-way mirror


# metadetach d0 d2
d0: submirror d2 is detached

2. Because this is a root (/) file system mirror, run the metaroot command to update the
/etc/vfstab and etc/system files.

# metaroot /dev/dsk/c0t0d0s0
# grep c0t0d0s0 /etc/vfstab
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -

3. # init 6

4. # metaclear -r d0
d0: Mirror is cleared
d1: Concat/Stripe is cleared
# metaclear d2
d2: Concat/Stripe is cleared

5.If you changed your boot-device variable to an alternate boot path, return it to it's
original setting.
NOTE:
If you have a mirrored file system in which the first submirror attached does not start on cylinder 0, all
additional submirrors you attach must also not start on cylinder 0. If you attempt to attach a submirror
starting on cylinder 0 to a mirror in which the original submirror does not start on cylinder 0, the following
error message is displayed:
can't attach
labeled submirror to an unlabeled mirror

Potrebbero piacerti anche