Replacing the system HDD by a larger one on Solaris 11 X86

I just migrated the Solaris 11 express installed on my X86 labtop to a larger disk drive (80 GB HDD replaced by 500 GB)

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.

Steps:

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 active (bootable)
      # 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

        notes:
        - 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 pool
      # zpool split rpool rpool2 c4t0d0s0

        notes:
        -
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

       notes:
        - 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 !!!

Comments:

Great and very handy story, Christian. Thanks for sharing!

Posted by Bart Muijzer on August 19, 2011 at 04:34 AM GMT #

I vaguely remember I used 'zpool replace' command to do the job and it was easier?

Posted by guest on August 19, 2011 at 10:21 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20
21
22
23
24
25
26
27
28
29
30
   
       
Today