Sysadmin > SolarIs > AttachNewDiskToZpool

Attach a new disk to a zpool

  • make the boot disk a mirror
  • make a copy of the bootdisk for usage in another computer
  • replace your bootdisk with a bigger disk

format 
CTRL C

to see what disks you have

format -e c0t0d0
selecting c0t0d0
[disk formatted]
...
format> fdisk
No fdisk table exists. The default partition for the disk is:

  a 100% "SOLARIS System" partition

Type "y" to accept the default partition,  otherwise type "n" to edit the
 partition table.
y

format> label
[0] SMI Label
[1] EFI Label
Specify Label type[0]:
Ready to label disk, continue? yes

format> partition
...
partition> 0
Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0                0         (0/0/0)             0
...
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       1 - 17778      136.19GB    (17778/0/0) 285603570

partition> label
...
partition> quit

format> label

format> quit

> zpool attach -f rpool c0t6d0s0 c0t0d0s0
Make sure to wait until resilver is done before rebooting.
> zpool status
...
        NAME          STATE     READ WRITE CKSUM
        rpool         ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            c0t6d0s0  ONLINE       0     0     0
            c0t0d0s0  ONLINE       0     0     0 (resilvering)

errors: No known data errors

Make disk bootable

installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t0d0s0

Detach disk (as a copy of your boot disk)

zpool detach rpool c0t0d0s0