[systemd-devel] rename a block device

Pascal patatetom at gmail.com
Mon Apr 25 14:25:55 UTC 2022


hi,

the udev rules prohibit renaming anything other than a network device :
what is (would be) the way to really rename a block device (not just to
create a symbolic link) ?

the objective behind this question is (would be) to give access to the
block device through an associated read-only loop device (eg. as a logical
forensic write-blocker).

here is the idea very roughly :
SUBSYSTEM=="block", NAME=".%k", RUN="/usr/local/bin/fakeblkdev %k" # this
doesn't work :-(
and taking for example /dev/sda and /dev/loop0 :
instead of being called /dev/sda, the device would be called /dev/.sda
(would be slightly "hidden"), it would be accessible through /dev/loop0
with losetup -r /dev/loop0 /dev/.sda and would finally be made "normal"
with ln -s /dev/loop0 /dev/sda.
the script /usr/local/bin/fakeblkdev called by udev would do most of the
association work between block device and loop device.

regards, lacsaP.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20220425/f4c2a4a0/attachment.htm>


More information about the systemd-devel mailing list