Replacing the system HDD by a larger one on Solaris 11 X86
By Christophe Pauliat-Oracle on Aug 19, 2011
There are several ways of doing this, but I chose the only that seems to me the simplest: using ZFS mirroring.
As a reminder, ZFS is mandatory on the system HDD in Solaris 11 (no more UFS). You can still UFS on non-system filesystems, altough I recommend using ZFS when possible.
This was done on Solaris 11 Express X86, but it should also work on Solaris 10 09/10 and later X86, and also on Sparc (just replace the installgrub by installboot)
Labtop: Toshiba Tecra M10
OS: Solaris 11 express 2010.11 + SRU8
Note: SRUs are the Support Repository Updates (the patches for Solaris 11), available to Oracle employees and Solaris 11 Express customers with support contract. I don't think SRUs are necessary here, but I just mention it for accuracy.
1) Copy data + OS on the new HDD
a) connection of the new 500 GB HDD as an external USB HDD (using a USB external HDD box)
b) creation of a 'Solaris 2' partition with fdisk and make it
# fdisk /dev/rdsk/c4t0d0p0
c) with the format command, create a partition s0 with all cylinders except cylinder 0
d) Mirroring the existing ZFS pool (rpool) to the new HDD
# zpool attach -f rpool c1t0d0s0 c4t0d0s0
- c1t0d0 is the 80 GB HDD (old HDD)
- c4t0d0 is the 500 GB HDD (new HDD)
- the option -f is necessary to bypass the warning "partition 0 overlaps partition 2"
e) wait for the sync to be finished (check with 'zpool status')
f) Install Grub on the new HDD
# installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c4t0d0s0
Note: this step is specific to X86, on Sparc, use installboot -F zfs /usr/platform/<arch>/lib/fs/zfs/bootblk /dev/rdsk/c4t0d0s0
g) Split the pool rpool by detaching to new HDD to create a new
# zpool split rpool rpool2 c4t0d0s0
- This removes the device c4t0d0s0 from the pool rpool and create a new pool named rpool2 with it.
- This "zpool split" feature is also available on Solaris 10 09/10 and later
- I chose not to detach the old HDD because I wanted it to be usable in case of problem
2) Physically replace the old HDD by the new one
a) Shutdown OS and laptop
b) disconnect the USB external HDD
c) replace the internal 80 GB HDD by the new one
3) Rename the new pool rpool2 to rpool
a) Boot on a Solaris 11 Express LiveCD or the network using AI
- As a reminder, AI (Automated Installer) is the new tool to do network installation Solaris 11 (equivalent to Jumpstart on Solaris 10 and previous)
- In my case, I used an AI server I had installed before.
b) Import, rename and export the system pool
# zpool import rpool2 rpool to import and rename the pool
# zpool export rpool to export it so that there is no warning in step 4
4) Boot on the new HDD
It worked just fine, but the pool size is still the size of the
old HDD (80 GB) altough it uses a 500 GB partition (c4t0d0s0)
5) Increase the pool size to use the whole partition
# zpool set autoexpand=on rpool
Et voilà ! (finally, some french words from a frenchman, it means "here it is")
I now have my Solaris 11 Express labtop with plenty of space available !!!