Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 41134  / 2 Years ago, mon, august 22, 2022, 8:36:08

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: http://zfsonlinux.org/msg/ZFS-8000-5E
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?


More From » zfs

 Answers
5
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. :)


[#30850] Tuesday, August 23, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
musining

Total Points: 171
Total Questions: 124
Total Answers: 121

Location: Zambia
Member since Thu, Jun 25, 2020
4 Years ago
;