Solaris Hard Disk Upgrade
This web page details how to upgrade a pair of mirrored 18GB disks to 146GB disks that use ODS, although I have detailed the system spec's you can use this document for any other ODS configuration you have. One point I will make is that I will NOT be extending any of the filesystems, you can use the extra space to breakup the existing filesystem if required.
The following is what I have
The following plan will be actioned
Now you could probably do this without rebooting the server, but I am a big fan of checking the total integrity of all the changes, this means checking the boot block. There is nothing worse than rebooting a server at a later date only to find that someone forgot to install the boot block (now where did I put those solaris cd's). I also persuming that you have a bit of knowledge regarding ODS if not a have a look here.
Implementing the plan
Collect System and ODS information |
|
Obtain system information | Before you begin you might want to capture the following information to a file and print off cat /etc/vfstab |
Obtain the disk names | # echo|format
Disk A: c0t0d0 Note: you can use what ever method you like to remember the disk devices |
Obtain the Disk serial numbers | # iostat -En c0t0d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0 Vendor: SEAGATE Product: ST318203LSUN18G Revision: 034A Serial No: LR3940710000U009 Size: 18.11GB <18110967808 bytes> Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0 Illegal Request: 0 Predictive Failure Analysis: 0 c0t8d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0 Vendor: SEAGATE Product: ST318404LSUN18G Revision: 4203 Serial No: 3BT25ND600002127 Size: 18.11GB <18110967808 bytes> Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0 Illegal Request: 0 Predictive Failure Analysis: 0 Disk A = c0t0d0 = LR3940710000U009 |
Next we need the ODS configuration | # df -k Filesystem kbytes used avail capacity Mounted on /dev/md/dsk/d0 7063913 859009 6134265 13% / /proc 0 0 0 0% /proc fd 0 0 0 0% /dev/fd mnttab 0 0 0 0% /etc/mnttab /dev/md/dsk/d30 4036062 9780 3985922 1% /var swap 2259080 16 2259064 1% /var/run swap 2259400 336 2259064 1% /tmp /dev/md/dsk/d40 4036062 4808 3990894 1% /opt # swap -l swapfile dev swaplo blocks free /dev/md/dsk/d10 85,10 16 2049696 2049696 # metastat -p d0 -m d1 d2 1 (root) d1 1 1 c0t0d0s0 disk A d2 1 1 c0t8d0s0 disk B d10 -m d11 d12 1 (swap) d11 1 1 c0t0d0s1 disk A d12 1 1 c0t8d0s1 disk B d30 -m d31 d32 1 (/var) d31 1 1 c0t0d0s3 disk A d32 1 1 c0t8d0s3 disk B d40 -m d41 1 (/opt) d41 1 1 c0t0d0s4 disk A d42 1 1 c0t8d0s4 disk B So we have the following / = d0 ( which is made up of d1 and d2 submirrors) swap = d10 ( which is made up of d11 and d12 submirrors) /var = d30 ( which is made up of d31 and d32 submirrors) /opt = d40 ( which is made up of d41 and d42 submirrors) Now we know what metadevices are on what disks |
Prepare for the worst |
|
Create a backout /etc/vfstab file Will be used in the backout plan |
In the event that all goes pear shaped, we create a /etc/vfstab that supports the underlining disks # cp vfstab SaveMyJob.vfstab Edit SaveMyJob.vfstab file and change the metadevices paths to the standard path names, use the above "metastat -p" command to find these #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # #/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes - fd - /dev/fd fd - no - /proc - /proc proc - no - swap - /tmp tmpfs - yes - # OLD SETTINGS #/dev/md/dsk/d10 - - swap - no - #/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no - #/dev/md/dsk/d30 /dev/md/rdsk/d30 /var ufs 1 no - #/dev/md/dsk/d40 /dev/md/rdsk/d40 /opt ufs 2 yes - # NEW SETTINGS /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no - /dev/dsk/c0t0d0s1 - - swap - no - /dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /var ufs 1 no - /dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /opt ufs 2 yes - |
Create a backout /etc/system file Will be used in the backout plan |
In the event that all goes pear shaped, we create a /etc/system that does not load ODS stuff, we will use this file in the backout plan # cp system SaveMyJob.system Edit SaveMyJob.system file and remove or comment out the ODS stuff * Begin MDD root info (do not edit) |
Upgrade Disk B |
|
deattach/remove metadevices from Disk B | Start removing disk B from ODS # metadetach d0 d2 # metastat # metaclear d2 confirm that disk B metadevices have been dettached and removed |
Check and remove any ODS databases | See if any ODS databases are on disk B # metadb -i flags first blk block count a m p luo 16 1034 /dev/dsk/c0t0d0s7 a p luo 1050 1034 /dev/dsk/c0t0d0s7 a p luo 2084 1034 /dev/dsk/c0t0d0s7 a p luo 16 1034 /dev/dsk/c0t8d0s7 a p luo 1050 1034 /dev/dsk/c0t8d0s7 a p luo 2084 1034 /dev/dsk/c0t8d0s7 o - replica active prior to last mddb configuration change u - replica is up to date l - locator for this replica was read successfully c - replica's location was in /etc/lvm/mddb.cf p - replica's location was patched in kernel m - replica is master, this is replica selected as input W - replica has device write errors a - replica is active, commits are occurring to this replica M - replica had problem with master blocks D - replica had problem with data blocks F - replica had format problems S - replica is too small to hold current data base R - replica had device read errors Yes we have ODS database information on disk B Confirm they have been removed |
Now remove the physical disk | using the serial number above you should remove the following disk (in my case) Disk B = c0t8d0 = 0020772-0101T25ND6 Note: you can also use the format-> analyse->read-only to make the LED flash, this also can confirm that you have the right disk |
Insert the new 146GB disk | Insert the new disk and wait approx 30 seconds for the disk to spin up |
Now update solaris so that it can see the new disk | # devfsadm -c disk # echo|format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0 SUN18G cyl 7506 alt 2 hd 19 sec 248 /pci@1f,4000/scsi@3/sd@0,0 1. c0t8d0 SUN146G cyl 14087 alt 2 hd 24 sec 848 /pci@1f,4000/scsi@3/sd@8,0 Specify disk (enter its number): Specify disk (enter its number): Success we have the 146GB disk installed |
Create the partitions on the new disk | First we must obtain the filesystem sizes from disk A, you have to do this manually as the cylinder sizes will be different (don't use prtvtoc) disk A |
Create the ODS database on disk B | Create 3 copies of the ODS database on the new disk (disk B) # metadb -a -c 3 c0t8d0s7 # metadb -i |
Create the metadevices on disk B | Now we have partitioned disk B we are ready to create the ODS metadevices # metainit d2 1 1 c0t8d0s0 Now attach the new metadevices and the re-sync operation will start # metattach d0 d2 Go and have a cup of coffee at this stage as the time it takes to resync the disks depends on the size of the Make sure we are all OK |
Now install the boot block on disk B | # installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t8d0s0 |
Server Integrity Check |
|
Now perform some reboots | I always like to check the server integrity disk A check |
Upgrade disk A |
|
deatach/remove metadevices from Disk A | Now we are confident that the new disk (disk B) is working correctly we can replace disk A Make sure we have booted from disk B Also make sure that ODS is ok (i did have some re-syncing going on when I reboot??) Now start to remove disk A from ODS # metastat # metaclear d1 confirm that disk A metadevices have been dettached and removed |
Check and remove any ODS databases | See if any ODS databases are on disk A # metadb -i flags first blk block count a m p luo 16 1034 /dev/dsk/c0t0d0s7 a p luo 1050 1034 /dev/dsk/c0t0d0s7 a p luo 2084 1034 /dev/dsk/c0t0d0s7 a p luo 16 1034 /dev/dsk/c0t8d0s7 a p luo 1050 1034 /dev/dsk/c0t8d0s7 a p luo 2084 1034 /dev/dsk/c0t8d0s7 o - replica active prior to last mddb configuration change u - replica is up to date l - locator for this replica was read successfully c - replica's location was in /etc/lvm/mddb.cf p - replica's location was patched in kernel m - replica is master, this is replica selected as input W - replica has device write errors a - replica is active, commits are occurring to this replica M - replica had problem with master blocks D - replica had problem with data blocks F - replica had format problems S - replica is too small to hold current data base R - replica had device read errors Yes we have ODS database information on disk A Confirm they have been removed |
Now remove the physical disk | using the serial number above you should remove the following disk (in my case) Disk A = c0t0d0 = 0020772-9936394071 Note: you can also use the format-> analyse->read-only to make the LED flash, this also can confirm that you have the right disk |
Insert the new 146GB disk | Insert the new disk and wait approx 30 seconds for the disk to spin up |
Now update solaris so that it can see the new disk | # devfsadm -c disk # echo|format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0 SUN146G cyl 14087 alt 2 hd 24 sec 848 /pci@1f,4000/scsi@3/sd@0,0 1. c0t8d0 SUN146G cyl 14087 alt 2 hd 24 sec 848 /pci@1f,4000/scsi@3/sd@8,0 Specify disk (enter its number): Specify disk (enter its number): Success we have the 146GB disk installed, also note both disks are now 146GB |
Create the partitions on the new disk | Because the disks are the same physically, we can use the prtvtoc command to make life easier for ourselves # prtvtoc /dev/rdsk/c0t8d0s2 | fmthard -s - /dev/rdsk/c0t0d0s2 |
Create the ODS database on disk A | Create 3 copies of the ODS database on the new disk (disk A) # metadb -a -c 3 c0t0d0s7 # metadb -i |
Create the metadevices on disk A | Now we have partitioned disk B we are ready to create the ODS metadevices # metainit d1 1 1 c0t0d0s0 Now attach the new metadevices and the re-sync operation will start # metattach d0 d1 Go and have another cup of coffee as the time it takes to resync the disks depends on the size of the filesystems Make sure we are all OK |
Now install the boot block on disk A | # installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0 |
Server Integrity Check |
|
Now perform some reboots | I always like to check the server integrity disk B check |
Feel feel to cut any corners if you wish, especially if you do not want to reboot the server, but if you can get downtime it is always best to check the integrity of the server and to test any changes you have made.
What to do when it all goes pear shaped (Backout Plan)
This all depends on when you get the problem, but hopefully the two disks that have been removed are still fine, I managed to restore both disks just to prove it can be done.
Backout Plan | The first thing to do is to shutdown the server if not already Start the server and perform a stop-A to drop to the OBP prompt Insert a bootable Solaris CD and boot into single user mode Once at the command prompt we need to mount the disk Hopefully the system should start, check that everything is OK and upto date. Now you have two options 1. you can insert and install the other mirror disk and then repartition (prtvtoc), recreate metadevices (metainit) then mirror (metattach), dont forget the metadb (metadb) and boot blocks (installboot). 2. use another spare disk (if you have one - make sure its the same size) and then repartition (prtvtoc), recreate metadevices (metainit) then mirror (metattach), dont forget the metadb (metadb) and boot blocks (installboot). The advantage with option 2 if you mess this up, then you have the other mirror disk to fall back on and if you corrupt both then a full restore is required. |
Please feel free to email me any constructive criticism you have with this page or mistakes that I have made.