Subject: bug#53212: feature request: mount option to specify the device number

From: Joachim Wagner <[email-masked]>
Date: Wed, 12 Jan 2022 16:59:52 +0000

Not sure whether this is coreutils or kernel. Maybe both.

A filesystem's device number such as reported by `stat` can be derived from 
major and minor of the underlying block device, e.g. xfs, or be allocated at 
mount time, e.g. btrfs. Even in the former case, the device number can change 
between restarts, e.g. when multiple dm-crypt devices are created in different 
order. Changing device numbers cause trouble for applications that use the 
device number to identify a filesystem across restarts, e.g. KDE's baloo file 
indexer.

A mount option to specify the device number would fix this trouble without 
requiring applications to move to alternative ways of identifying filesystems, 
e.g. based on UUIDs. This option could be general, i.e. the device number can 
be set for any filesystem, including those that normally derive it from major 
and minor of their block device(s).

The implementation would probably be simplified if the specified device 
numbers must come from a reserved pool. Otherwise, care must be taken that the 
numbers do not collide with automatically assigned device numbers, including 
those allocated later.

Replaces bug #53209

References:
https://bugs.kde.org/show_bug.cgi?id=402154
https://bugs.kde.org/show_bug.cgi?id=404057
https://bugs.kde.org/show_bug.cgi?id=413694
https://unix.stackexchange.com/questions/345220/btrfs-how-to-get-real-device-id
https://stackoverflow.com/questions/4309882/device-number-in-stat-command-output/4309947