udev: add /dev/loop/ symlinks
authorLennart Poettering <lennart@poettering.net>
Mon, 6 Mar 2023 11:55:59 +0000 (12:55 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 9 Mar 2023 15:41:26 +0000 (16:41 +0100)
commit5ac52d1f7b7cd11cad8b5c2e9812d7ee7560a517
tree89743dbfe6f39de867596156730f87830a565f2e
parent6f5ef9e4c7b240d67cdefb1232c9e85e43d31586
udev: add /dev/loop/ symlinks

This adds symlinks that allow accessing loopback block devices via stable
names that reference their backing block devices, make the unpredictable
naming of loopback devices less of an issue.

Example:

1. Create a loopback block device for a file $F

   losetup --find $F

2. Reference the backing block device via its inode:

   L="$(stat -c '/dev/loop/by-inode/%Hd:%Ld-%i' $F)"
   fdisk $L

In the above the loop device name (which might be /dev/loop47 or any
other name) is not used at all.
rules.d/60-persistent-storage.rules.in