Solaris SVM : Create a new DiskSuite configuration which points to the data correctly without requiring a backup & restore.
Create a new DiskSuite configuration which points to the data correctly without requiring a backup & restore.
There are occasions you wish to physically move disks to a new controller or to a new host (at which point, the device names may change).
This procedure allows you to create a new DiskSuite configuration which points to the data correctly without requiring a restore of data from a backup.
Note: But as with any storage reconfiguration it is always recommended that you have a back up of the data before the reconfiguration is attempted.
1. Ensure that there are no DiskSuite errors or devices in Needs Maintenence or Last Erred states. If there are, rectify any of those problems before continuing.
2. Backup SDS/SVM configuration using
# metadb -i > /metadb-i.out
# metadb -s setname -i > /metadb-i.setname.out
3. Take a full backup of the system (just in case something horribly wrong occurs) and then stop all I/O to the affected metadevices.
4. Remove the configuration of the relevant devices on the old controller/host.
# metaclear -r d10
Note: You can not “metaclear -r” a metadevice that has active soft partitions under it. These will need to be manually metaclear’ed before you can run the “metaclear -r” on the above metadevice.
5. Remove any disks from host-spare pools that you will be moving.
# metahs -d hsp002 c1t0d2s0
hsp002: Hotspare is deleted
6. Remove any database replicas on the old controller/host.
# metadb -d /dev/dsk/c1t0d0s7
Note: Make sure that if you are will still be using SDS/SVM on the old host, you will still have enough replicas on the old host after deleting those on the storage to be moved.
7. Copy the metastat-p.out or metastat-p.setname.out file to the new host.
8. Move the disk(s) from the old controller/host to the new one, shutting down and/or using ESD precautions as required.
9. Edit the metastat-p.out or metastat-p.setname.out file to remove devices which you are not moving, and if applicable to reflect any change of disk name (such as controller number or target number). Also, remove one of the sub-mirrors from each mirror definition, and ensure that the “-k” flag exists on all raid5 volumes.
# more /metastat-p.out
d0 -m d1 d2 1
d1 1 1 c0t0d0s0
d2 1 1 c1t0d0s0
d3 -m d4 d5 1
d4 1 1 c0t0d0s1
d5 1 1 c1t0d0s1
d10 -m d12 d11 1
d12 1 2 c1t2d1s0 c1t2d2s0 -i 32b
d11 1 2 c1t1d0s0 c1t1d1s0 -i 32b
d20 -r c1t2d1s1 c1t2d2s1 c1t1d0s1 c1t1d1s1 -k -i 32b
# vi /metastat-p.out
# more /metastat-p.out
d10 -m d12
d12 1 2 c2t2d1s0 c2t2d2s0 -i 32b
d11 1 2 c2t1d0s0 c2t1d1s0 -i 32b
d20 -r c2t2d1s1 c2t2d2s1 c2t1d0s1 c2t1d1s1 -k -i 32b
CAUTION: If the -k flag is missing from a raid5 specification, all the data will be destroyed when that device is recreated.
10. Append the new information from the metastat-p.out or metastat-p.setname.out file to the md.tab file. Be sure to remove any previous references in the md.tab file to the metadevices being moved.
# cat /metastat-p.out >> /etc/lvm/md.tab
Note: In version 4.2 and below, the md.tab file is in /etc/opt/SUNWmd/md.tab
11. Add any metastate database replicas on the new controller/host.
# metadb -c 3 -a /dev/dsk/c2t0d0s7
12. Recreate the changed configuration using the md.tab file, and re-attach the submirrors to the mirrors which you removed from the file in step (9).
# metainit d12
d12: Concat/Stripe is setup
# metainit d11
d11: Concat/Stripe is setup
# metainit d10
d10: Mirror is setup
# metattach d10 d11
d10: submirror d11 is attached
# metainit d20
d20: RAID is setup
Note: Any soft partitions can now be recovered manually in the same way as the other metadevices.
13. If the hot-spare pool needs to be created, create it using the md.tab file,
# metainit hsp002
hsp002: Hotspare pool is setup
but if it already exists, the disks need to be added as follows:
# metahs -a hsp002 c2t0d2s0
hsp002: Hotspare is added
14. Use the ‘metastat’ command to verify that all is OK with the SDS/SVM configuration and verify the data integrity by mounting (if appropriate) the filesystems on the local host.
CAUTION: Don’t run “newfs” on the metadevice or its associated filesystem!