how do I add a new disk to ZFS and make it available existing mountpoints if the current pool is root pool?
Attach the second disk as a mirror of the first, wait for resilver, remove the first disk, set the properties to autoexpand. Don't forget to setup boot code or anything like that. Example:
zpool attach rpool olddisk newdisk
...wait, check using zpool status rpool
zpool detach rpool olddisk
zpool set autoexpand=on rpool
You cannot "expand" the rpool size by appending one disk to another (raid 0), as previously mentioned, however as Chris S mentioned below, you could attach a larger disk as a mirror, then, once the data is sync'd (resliver complete), detach the smaller disk. (oops now I see Chris's response too)
Here is a process to mirror the root disk... http://constantin.glez.de/blog/2011/03/how-set-zfs-root-pool-mirror-oracle-solaris-11-express
Follow that except that where they do:
prtvtoc /dev/rdsk/c7t0d0s0 | fmthard -s - /dev/rdsk/c7t1d0s0
... you will want to run format and make the size of slice 0 larger, probably the whole disk
# format /dev/rdsk/c4t1d0s0
(I will not go into great detail on the interactive format command)
# zpool attach rpool c4t0d0s0 c4t1d0s0
# zpool status rpool
WAIT UNTIL IT SAYS "resilver completed" (keep checking zpool status rpool
)
MAKE SURE YOU CAN BOOT TO THE SECOND DISK
Then detach the smaller rpool mirror and reboot, make sure you can boot again.
# zpool detach rpool c4t0d0s0
PROFIT!?
REFERENCE: http://docs.oracle.com/cd/E19963-01/html/821-1448/gjtuk.html#gjtui
Previous Answer:
After creating the pool using the command he specified:
zpool create mypool c4t1d0
Create a filesystem, for example:
zfs create mypool/home
... copy the data to the new disk ... (re)move the data from rpool disk, then set the mountpoint to a proper location, such as:
zfs set mountpoint=/export/home mypool/home
That is, of course, assuming that /export/home is where all the space is being used. You may have to do this in "single user" mode, or create a user with a home directory that is not in /export/home
to complete this.
On a side note, your zfs list output looks funky, like it is missing something. rpool/ROOT
is showing 101GB used, but the filesystems under it are only showing about 12.5GB REF, and far less USED. Do you by chance have other boot environments under rpool/ROOT that you "trimmed out" of your zfs list output? could you maybe destroy those bootenv's or at least the zfs filesystems to regain the space used in rpool/ROOT?
~tommy
Yes, I believe your only option is to create a new pool using the second disk. The only thing you can do with the rpool is mirror the disk - which won't make more space available. The rpool doesn't support striping, due to the difficulties it would pose with booting.
zpool create mypool c4t1d0