Sie sind auf Seite 1von 3

Mirroring disks with DiskSuite

The following example shows how to mirror two disks--c0t0d0 with c0t1d0--using Solstice DiskSuite 4.2.1 on Solaris 8. Please read the excellent Admin's Guide to Solstice Disk Suite for more information. The current partition table of c0t0d0:
Part Tag 0 root 819504 1 swap 525168 2 backup 17801280 3 unassigned 21168 4 var 7225344 5 usr 6291936 6 unassigned 2097648 7 home 819504 Flag wm wu wm wm wm wm wm wm Cylinders 0 812 813 1333 Size 400.15MB 256.43MB 8.49GB 10.34MB 3.45GB 3.00GB 1.00GB 400.15MB Blocks (813/0/0) (521/0/0) (17660/0/0) (21/0/0) (7168/0/0) (6242/0/0) (2081/0/0) (813/0/0)

0 - 17659 1334 1355 1354 8522

8523 - 14764 14765 - 16845 16846 - 17658

1. Copy the partition table of the first disk to its mirror. prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2 2. Create at least 2 DiskSuite state database replicas on each disk. A state database replica contains DiskSuite configuration and state information. metadb -a -f -c2 /dev/dsk/c0t0d0s3 /dev/dsk/c0t1d0s3 Description of metadb flags: -a -- adding -f -- force (needed the first time creating databases) -c2 -- create 2 databases in each slice 3. Mirror the root slice. metainit -f d10 1 1 c0t0d0s0 metainit -f d20 1 1 c0t1d0s0 metainit d30 -m d10 metaroot d30 (Use this command only on the root slice!) 4. Mirror the swap slice. metainit -f d11 1 1 c0t0d0s1 metainit -f d21 1 1 c0t1d0s1 metainit d31 -m d11

5. Mirror the var slice. metainit -f d14 1 1 c0t0d0s4 metainit -f d24 1 1 c0t1d0s4 metainit d34 -m d14 6. Mirror the usr slice. metainit -f d15 1 1 c0t0d0s5 metainit -f d25 1 1 c0t1d0s5 metainit d35 -m d15 7. Mirror the unassigned slice. metainit -f d16 1 1 c0t0d0s6 metainit -f d26 1 1 c0t1d0s6 metainit d36 -m d16 8. Mirror the home slice. metainit -f d17 1 1 c0t0d0s7 metainit -f d27 1 1 c0t1d0s7 metainit d37 -m d17 Run metastat metadevice for information on a metadevice. If you wish to delete a metadevice, run metaclear metadevice. 9. Update /etc/vfstab to mount the mirrors after boot. /etc/vfstab before changes:
#device device mount mount #to mount to fsck point options # #/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr fd /dev/fd fd no /proc /proc proc no /dev/dsk/c0t0d0s1 swap /dev/md/dsk/d30 /dev/md/rdsk/d30 / logging /dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 no ro,logging /dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 no nosuid,logging /dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 yes nosuid,logging /dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 yes nosuid,logging swap /tmp tmpfs yes FS type ufs ufs /usr /var /home /opt fsck pass 1 mount at boot yes

no 1 ufs ufs ufs ufs

no 1 1 2 2

/etc/vfstab after changes:

#device device mount mount #to mount to fsck point options # #/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr fd /dev/fd fd /proc /proc proc /dev/md/dsk/d31 swap /dev/md/dsk/d30 /dev/md/rdsk/d30 logging /dev/md/dsk/d35 /dev/md/rdsk/d35 ro,logging /dev/md/dsk/d34 /dev/md/rdsk/d34 nosuid,logging /dev/md/dsk/d37 /dev/md/rdsk/d37 nosuid,logging /dev/md/dsk/d36 /dev/md/rdsk/d36 nosuid,logging swap /tmp tmpfs -

FS type ufs no no / /usr /var /home /opt yes no ufs ufs ufs ufs ufs -

fsck pass 1

mount at boot yes

1 1 1 2 2

no no no yes yes

10. Reboot the system. lockfs -fa init 6 11. Attach the second submirror to the mirror. This will cause the data from the boot disk to be synchronized with the mirrored drive. metattach d30 d20 metattach d31 d21 metattach d34 d24 metattach d35 d25 metattach d36 d26 metattach d37 d27 You can run metastat to track the mirroring progress.

Das könnte Ihnen auch gefallen