Skip to content

Conversation

ZachCook
Copy link
Contributor

@ZachCook ZachCook commented Oct 6, 2025

Allow specifying a symlink from /dev/ to select the device, so it can be a persistent block device name from /dev/disk/by-*/ directories or /dev/gpt-auto-root

Allow selecting a partition as device, which allows disk/by-partlabel device naming to work

This allows users to fix the issue where block device naming could change on every boot, and so configured device would sometimes be different from the expected device

As the added example shows, use the same semantics as existing block device naming:

/dev/sda            =>      device = sda
/dev/disk/by-*      =>      device = disk/by-* 
/dev/gpt-auto-root  =>      device = gpt-auto-root

If the config device is a valid symlink in /dev/ it replaces the device with the symlink target, so %device in format will show the name of the symlink target, not the symlink name

For partitions /sys/class/block/partition_name/ doesn't contain queue/hw_sector_size, so instead uses the /sys/class/block/disk_name/queue/hw_sector_size of the disk that contains the partition (/sys/class/block/disk_name/partition_name/)

Allow specifying a symlink from /dev/ to select the device, so it can
be a persistent block device name from /dev/disk/by-*/ directories
or /dev/gpt-auto-root

Allow selecting a partition as device, which allows disk/by-partlabel
device naming to work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant