[zfs-discuss] Moving disks around (how to ?)

Swâmi Petaramesh swami at petaramesh.org
Thu Jan 30 11:54:13 EST 2014

Hi there,

If some of you remember, I have a mirrored zpool in a quite critical 
condition, made from 2 (dying, failing) disks partitions (sda3, sdb3)

I'm running Ubuntu 13.10 from there, using zfs as my root FS, having only 
/boot on an ext4 MD RAID (just because managing to boot from ZFS using grub is 
a mess... A couple years ago it used to work, but it doesn't anymore).

I used devices names sda3, sdb3 for my zpool, because this zpool hosts my root 
FS, and once upon a time I tried to create it using position-independent 
device names (such as /dev/disk/by-id/ata-SAMSUNG_HD103UJ_S13PJ9AQ920529-part3 
) but then the pool wouldn't import at boot time, and I assume that's because 
these "friendly device names" are not yet available at initramfs time when 
trying to start the root zpool. Too bad.

Ok. Maybe I'm wrong, please correct me if I am.

Giving that my disks are dying, I have ordered a couple new, bigger ones, and 
I plan to drop the new disks in the system, create a new zpool out of them, 
and transfer the old pool contents onto the new one using
"zfs send foo | zfs receive bar"

Is this the good way to go ? I would believe so...

But then I'm wondering.

If I have my original pool at sda3, sdb3, let's create my new pool with, say, 
sdc3, sdd3.

Once copied I plan to remove the old disks, and to put the new disks in place 
at sda, sdb.

Then, is there a way I am supposed to "tell zfs about the device names 
changes" and import the pool without having it get out of sync because it 
cannot find the mirrored device at the expected place, or whatever?

(I had also considered the idea :)

- Add sdc3 (new disk) as a 3rd way mirror to the existing zpool, let resilver
- Remove sda and replace it with a new, fresh disk, let resilver.
- Remove sdb and (new) sdc, reinsert new disk as sdb, let resilver.
- Grow the zpool to the maximum size that the new disks allow

This would probably do it nicely, but it would need to resilver 3 times, and 
at some point have a single (new) disk hosting the data.

Also I believe that my current zpool is somewhat damaged at the metadata 
level, so I wonder if I wouldn't have better copy everything over to a new 
pool, rather than moving the current pool onto new disk...

Also I expect some file read errors while sending from the old pool to the new 
one. How would one overcome this "ignore read errors but possibly log them" ?

To sum it up, what would be the best way to proceed ?

Thanks in advance for any insight :-)

Kind regards.

Swâmi Petaramesh <swami at petaramesh.org> http://petaramesh.org PGP 9076E32E

To unsubscribe from this group and stop receiving emails from it, send an email to zfs-discuss+unsubscribe at zfsonlinux.org.

More information about the zfs-discuss mailing list