Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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:

  1. Create a new pool mounted on /usr-new
  2. Use zfs-send from a snapshot of usr-pool to usr-new (You also need to account for any descendent datasets).
  3. zfs unmount usr-new.
  4. Change the mountpoint of usr-new to /usr (it may complain, but should work. Check with zfs get mountpoint usr-new)
  5. Set usr-pool (i.e., the old one) to use legacy mounting with zfs set mountpoint=legacy usr-pool (this will cause it to not be auto mounted at boot but also not immediately unmount it).
  6. Reboot.

You'll boot up with the new usr-new mounted on /usr and the old usr-pool not mounted. You are then free to destroy usr-pool and reuse disks as necessary.

share|improve this answer
    
Thanks for your reply. I am pretty sure would have worked but unfortunately I wrecked my /etc/vfstab before reading this... So that created a whole other problem. :) –  cali-spc Oct 23 '12 at 18:10
    
also, consider booting to single-user mode before you make these changes. –  Tim Kennedy Oct 24 '12 at 22:42
    
@TimKennedy: One would certainly want to vet the entire process on a test system before attempting it on production, but these instructions are written to be run safely on a live system. –  bahamat Oct 24 '12 at 23:11
    
@bahamat one would hope so, eh? :) –  Tim Kennedy Oct 25 '12 at 3:19
    
@TimKennedy: No need to hope. They are. I've done things similar to this on live systems. It's safe. I don't know the OP's environment well enough to give specific exact steps, but using these steps as a template and vetting on a non-production system that mimics the original it's very safe to do this live, with the only downtime being the reboot. –  bahamat Oct 26 '12 at 6:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.