How do I add a second disk to my zfs root pool

17,070

You cannot add devices to the root pool (outside mirroring it but this isn't going to help in your case).

What you can do is creating a new zpool with your second disk and relocate /export on it.

Share:
17,070

Related videos on Youtube

ankimal
Author by

ankimal

Updated on September 17, 2022

Comments

  • ankimal
    ankimal almost 2 years

    I am trying to add a new disk to my zfs root pool. Here is my current config:

    # zpool status
      pool: rpool
     state: ONLINE
     scrub: none requested
    config:
    
        NAME        STATE     READ WRITE CKSUM
        rpool       ONLINE       0     0     0
          c0d0s0    ONLINE       0     0     0
    
    errors: No known data errors
    bash-3.00# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    rpool/ROOT/s10x_u7wos_08
                          311G   18G  293G   6% /
    swap                   14G  384K   14G   1% /etc/svc/volatile
    /usr/lib/libc/libc_hwcap1.so.1
                          311G   18G  293G   6% /lib/libc.so.1
    swap                   14G   52K   14G   1% /tmp
    swap                   14G   40K   14G   1% /var/run
    rpool/export          293G   19K  293G   1% /export
    rpool/export/home     430G  138G  293G  32% /export/home
    rpool                 293G   36K  293G   1% /rpool
    
    
    # format
    Searching for disks...done
    
    
    AVAILABLE DISK SELECTIONS:
           0. c0d0 <DEFAULT cyl 60797 alt 2 hd 255 sec 63>
              /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
           1. c2d0 <Hitachi-   JK1181YAHL0YK-0001-16777216.>
              /pci@0,0/pci-ide@1f,5/ide@1/cmdk@0,0
    

    Disk 1 above is the new disk I need to attach to expand my root pool (give /export/home some extra space).

    If I try to attach my new disk to the pool

    # zpool attach -f rpool c0d0s0 c2d0s0
    cannot attach c2d0s0 to c0d0s0: new device must be a single disk
    
    # uname -a
    SunOS dsol1 5.10 Generic_139556-08 i86pc i386 i86pc Solaris
    

    Any ideas?

    EDIT:

    # zpool add rpool c2d0
    

    cannot add to 'rpool': root pool can not have multiple vdevs or separate logs

    • Admin
      Admin about 9 years
      If any answer solved your issue, please mark it as accepted.