1

Ubuntu server 16.04.5 LTS has been running well with external USB drive for years but we've outgrown it. Trying to add a larger external USB drive before removing the old.

I have a four drive RAIDZ created in 2016. Ever since the create commands, it's auto-mounted at boot.

output of dmesg (hope this works)

I assume adding a drive altered the available list of drives and when zfs goes to grab them, doesn't find the right drives in the right order. But I don't know where to go to "hardwire" the assignment, in order for there to be no assumptions about which drives make the RAIDZ.

I have beginner skills at Ubuntu at best and would appreciate any insight and assitance. Thank you!

EDIT

With FDISK -l I've found that device assignment does change when I have both external USB drives attached. When I attach the new external USB drive and reboot, devices change as follows:

sda -> sdf; sdb -> sda; sdc -> sdb; sdd -> sdc; sde -> sdd; sdf -> sde; sdg is the new drive

How do I overcome the dynamic assignment of a device name like this so my mounts, etc. are always correct?

Thanks!

1 Answer 1

0

The normal way to do this is to add the devices to you zpool using their UUIDs or WWNs, which are available in /dev/disk/by-uuid and /dev/disk/by-id. This and more details about persistent naming for disks is available here.

To switch an existing pool over to the by-id method, try running:

sudo zpool export tank
sudo zpool import -d /dev/disk/by-id -a

The options tell import to search for devices in that directory, and keep searching until all devices have been checked whether they have ZFS data on them or not (even if there are multiple pools).

2
  • My create command was by-id - sudo zpool create -f shares0 raidz /dev/disk/by-id/ata-Hitachi_HUA723030ALA640_MK0331YHGDPGXA /dev/disk/by-id/ata-Hitachi_HUA723030ALA640_MK0331YHGDR86A /dev/disk/by-id/ata-Hitachi_HUA723030ALA640_MK0351YHG8HMRA /dev/disk/by-id/ata-Hitachi_HUA723030ALA640_MK0331YHGDR5ZA and the /etc/zfs/zpool.cache, while not really human readable, clearly has device paths (eg. /dev/sda) throughout it.
    – Kazz
    Dec 2, 2018 at 17:09
  • It took some time to satisfy myself that the backup I did have was complete and accurate before moving forward with the export/import. Once I was happy with the smaller backup content I took the "risk" of exporting and importing which was successful. Currently backing up to the larger external drive. Odd that the create commands used UUID but the zfs mount reverted to device paths. This fixed it as evident from the output of the zpool status command. Thank you!
    – Kazz
    Dec 6, 2018 at 16:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .