Solaris Volume Manager gives an ability create software raid, currently it supports 0,1,5,0+1,1+0 levels.
Lets make a mirror of root partition which we already are using.
1. Backup /etc/vfstab and /etc/system before you go ahead.
2. It is necessary to prepare space for state database , on running box we can redistribute swap area.
#swap -d /dev/dsk/yourswappart
Before redistributing space we must comment string for swap partition out in vfstab,
because format utility will consider this partition is being used.
Decrease size of current swap partition on 30mb and use this free space for state database partiotion.
Do it with format utility:
#format
Enable swap again
#swap -a /dev/dsk/yourswappart
3. Mirrored partitions must equal in size or we will waste space.
This commands will copy partition table to second drive
# prtvtoc /dev/rdsk/c0d0s0 | fmthard -s - /dev/rdsk/c0d1s0
3.1Specify the master boot program.
# fdisk -b /usr/lib/fs/ufs/mboot /dev/rdsk/c0d1s0
3.2
Make the secondary disk bootable.
# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1d1s0
3.3
Make the secondary disk bootable. (SPARC)
installboot /usr/platform/sun4u/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0
4. Create state database on small slices created recently.
# metadb -f -a -c3 c0d0s3
# metadb -a -c3 c0d1s3
5. Create submirrors :
#metainit -f d10 1 1 c0d0s0
#metainit -f d20 1 1 c0d1s0
6. Create mirror device and add one submirror first:
#metainit d0 -m d10
# lockfs -fa (clear improper file locks)
7. Add to /etc/system file:
set md:mirrored_root_flag=1
8. Create submirrors for swap:
#metainit -f d30 1 1 c0d0s3
#metainit -f d40 1 1 c0d1s3
9. Create mirror d1 and include submirors:
#metainit d1 -m d30
Edit /etc/vfstab to contain correct information about swap.
10. Reboot.
11. Add other submirrors into mirrors:
#metatach d0 d20
#metatach d1 d40
11.1. Add to GRUB additional disk:
title alternate boot
root (hd1,0,a)
kernel /boot/multiboot
module /boot/x86.miniroot-safe
12. Verify that process of synchronization have begun:
#metastat
#metadetach d0 d20
#metaroot /dev/dsk/c0d0s0
#metadetach d1 d40
Correct /etc/vfstab.
Reboot.
Do not run the last command if you have other raids running - it will destroy them!!
#metaclear -a
SPARC NOTES:
# 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
Lets make a mirror of root partition which we already are using.
1. Backup /etc/vfstab and /etc/system before you go ahead.
2. It is necessary to prepare space for state database , on running box we can redistribute swap area.
#swap -d /dev/dsk/yourswappart
Before redistributing space we must comment string for swap partition out in vfstab,
because format utility will consider this partition is being used.
Decrease size of current swap partition on 30mb and use this free space for state database partiotion.
Do it with format utility:
#format
Enable swap again
#swap -a /dev/dsk/yourswappart
3. Mirrored partitions must equal in size or we will waste space.
This commands will copy partition table to second drive
# prtvtoc /dev/rdsk/c0d0s0 | fmthard -s - /dev/rdsk/c0d1s0
3.1Specify the master boot program.
# fdisk -b /usr/lib/fs/ufs/mboot /dev/rdsk/c0d1s0
3.2
Make the secondary disk bootable.
# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1d1s0
3.3
Make the secondary disk bootable. (SPARC)
installboot /usr/platform/sun4u/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0
4. Create state database on small slices created recently.
# metadb -f -a -c3 c0d0s3
# metadb -a -c3 c0d1s3
5. Create submirrors :
#metainit -f d10 1 1 c0d0s0
#metainit -f d20 1 1 c0d1s0
6. Create mirror device and add one submirror first:
#metainit d0 -m d10
# lockfs -fa (clear improper file locks)
7. Add to /etc/system file:
set md:mirrored_root_flag=1
8. Create submirrors for swap:
#metainit -f d30 1 1 c0d0s3
#metainit -f d40 1 1 c0d1s3
9. Create mirror d1 and include submirors:
#metainit d1 -m d30
Edit /etc/vfstab to contain correct information about swap.
10. Reboot.
11. Add other submirrors into mirrors:
#metatach d0 d20
#metatach d1 d40
11.1. Add to GRUB additional disk:
title alternate boot
root (hd1,0,a)
kernel /boot/multiboot
module /boot/x86.miniroot-safe
12. Verify that process of synchronization have begun:
#metastat
Backward process(unmirroring).To unmirror you have to do something like these:
#metadetach d0 d20
#metaroot /dev/dsk/c0d0s0
#metadetach d1 d40
Correct /etc/vfstab.
Reboot.
Do not run the last command if you have other raids running - it will destroy them!!
#metaclear -a
SPARC NOTES:
# 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
Comments