M HYPE SPLASH
// updates

How do I remove a pool from ZFS?

By Michael Henderson

My Ubuntu 12.04 system has two zpools: rpool (containing the root filesystem) and rdata (containing all other data). rdata was originally 2 x 1TB disks mirrored.

Because I couldn't upgrade rdata to 3TB disks (wrong ashift) I had to create a new zpool from the new 3TB disks: initially called datapool. I then rsync'd all the data across, exported rdata, imported datapool as rdata and Bob's your Uncle. I then powered off and removed the old disks. However...

When I powered back on, zpool status shows

 pool: rdata state: UNAVAIL
status: One or more devices could not be used because the label is missing or invalid. There are insufficient replicas for the pool to continue
functioning.
action: Destroy and re-create the pool from a backup source. see: scan: none requested
config:
NAME STATE READ WRITE CKSUM
rdata UNAVAIL 0 0 0 insufficient replicas mirror-0 UNAVAIL 0 0 0 insufficient replicas scsi-SATA_WDC_WD10EADS-00_WD-WCAU47275172-part1 UNAVAIL 0 0 0 scsi-SATA_WDC_WD10EADS-00_WD-WCAU47283913-part1 UNAVAIL 0 0 0 pool: rpool state: ONLINE scan: scrub repaired 0 in 0h23m with 0 errors on Tue Jun 4 11:33:29 2013
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0 ata-Maxtor_6Y120L0_Y31J3CLE-part2 ONLINE 0 0 0
errors: No known data errors

As you can see, zpool status is still showing the old rdata; which is not available.

zpool import shows

 pool: rdata id: 7033445233439275442 state: ONLINE action: The pool can be imported using its name or numeric identifier. config:
rdata ONLINE mirror-0 ONLINE scsi-SATA_ST3000DM001-1CH_W1F1EE1G ONLINE scsi-SATA_ST3000DM001-1CH_W1F25SE2 ONLINE

This is the correct rdata

Question: How do I get Ubuntu to forget all about the old zpool?

2 Answers

sudo zpool destroy rdata

will destroy the old pool (you may need -f to force).

sudo zpool export rdata

will disconnect the pool.

sudo zpool import 7033445233439275442

will import the new pool. You need to use the id number as there are two "rdata" pools.

As you're running with a ZFS root, all that's left to do is rebuild the initramfs to update the pools:

sudo update-initramfs -c -k all
sudo update-grub

Reboot and all is well. :)

8

You can destroy pool within just a command.

sudo zpool destroy <poolname>

Check the status of pool

sudo zpool status <poolname>
0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy