2

If I wanted to prevent the creation of /dev/sd{a,b,c,...}{,1,2,3,...} devices in my system, but still have /dev/disk/by-uuid/* and /dev/disk/by-label/* created for those disks, could I do so, sanely/cleanly (especially without having to redo it each time I do an upgrade)?

Or is the creation of the /dev/sd* devices a default kernel thing that is unreasonably tricky to override (appreciating the subjectivity of 'unreasonable')?

As for why, it's because I really want to do all my ZFS stuff by label or UUID, and don't want to confuse or tempt myself (or other members of my team) in the future.

I haven't built the server yet, but I can confidently say the boot/root will be on a dedicated HPE Smart Array controller (so assuming /dev/cciss/* -- feel free to correct me); and all the ZFS pool members will be on a separate HBA (HPE H241), if that helps to isolate the devices.

Bonus props if any attached USBs continued to discover as /dev/sda, sdb, etc., but certainly not essential.

Targeting Ubuntu 16.04 for "business reasons", but would be interested in other distros too.

(Cross-posted from: https://askubuntu.com/questions/944584/preventing-dev-sda-sdb-from-being-created-while-leaving-dev-disk-by-uuid, after a few weeks without interest...)

  • "don't want to confuse or tempt myself": it will probably much easier to just be firm with yourself and the team than fighting udev to prevent creation of the "basic" /dev/sd* devices. Which can break in interesting ways, even if you manage to pull it off. After all, the various symlinks need a target ... – dirkt Sep 19 '17 at 6:15
1

This would require updating rules for udev supplied by your vendor. A ruleset that is being updated when the vendor pushes out updates or someone reinstalls that package because of "issues". To be honest this is a path you don't want to follow as it time that could be used for real issues instead of some cosmetic thing.

As for the H241, Ubuntu 16.04 doesn't appear on the support matrix from HPE. You make want to check that, otherwise CentOS 7 should be an option as it should be "binary compatible" with RHEL 7 if you don't have a support contract.

1

I know this may not be the best answer but it is dead simple to change the drives to by id if you can have some downtime. I tend to create by /dev then switch to id so I can identify disks and move them if need be.

# zpool export poolname

# zpool import -d /dev/disk/by-id/ poolname (same poolname as was export)

I believe this works with uuid as well but I don't use it so I never tested it.

Your Answer

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

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