I use Solaris 10 on SPARC. I have /usr legacy mounted on a zpool 'usr-pool'.
I now need to move some of the devices in usr-pool to another zpool which is running out of room.
What is the safest way for me to do this? I already know that (since my zpool is not mirrored) I need to destroy and recreate the zpool. I know how to backup and restore a zfs snapshot. However… I'm stumped on how to unmount usr-pool without losing access to the commands I need on /usr to complete the backup/restore.
Cursory research indicated that I should boot to OpenBoot (init 0) and then 'boot cdrom -s'. I did this but none of the zpools are accessible on that runlevel.
I also read I could just copy /usr to another location, symlink /usr to that location, then do my backup/restore. Is that safe to do?
I would appreciate some guidance.
S.
Best Answer
Unfortunately ZFS does not currently support shrinking the pool.
Since you already mentioned that your intention is to destroy and recreate the pool, here's what to do. But first...
WARNING: DESTROYING YOUR POOLS WILL DESTROY YOUR DATA. YOUR BLOOD IS ON YOUR OWN HEAD.
Now, with that out of the way:
/usr-new
zfs-send
from a snapshot ofusr-pool
tousr-new
(You also need to account for any descendent datasets).zfs unmount usr-new
.usr-new
to/usr
(it may complain, but should work. Check withzfs get mountpoint usr-new
)usr-pool
(i.e., the old one) to use legacy mounting withzfs set mountpoint=legacy usr-pool
(this will cause it to not be auto mounted at boot but also not immediately unmount it).You'll boot up with the new
usr-new
mounted on/usr
and the oldusr-pool
not mounted. You are then free to destroyusr-pool
and reuse disks as necessary.