Man page - rpi-loop-device-namer(8)

Packages contas this manual

Manual

RPI-LOOP-DEVICE-NAMER(8) System Manager's Manual RPI-LOOP-DEVICE-NAMER(8)

rpi-loop-device-namer - generate stable names for loop device symlinks

rpi-loop-device-namer MINOR_NUMBER

rpi-loop-device-namer is a utility script that generates stable symbolic link names for loop devices based on their backing files. It is primarily intended to be called by udev rules to create persistent device names.

The script takes a loop device minor number as input and outputs a systemd-escaped path suitable for use in /dev/disk/by-backingfile/ symlinks.

The minor device number of the loop device (e.g., "0" for /dev/loop0, "1" for /dev/loop1).

If the specified loop device has an associated backing file, the script outputs:

disk/by-backingfile/ESCAPED_PATH

Where ESCAPED_PATH is the systemd-escaped version of the backing file path.

If the loop device has no backing file, no output is produced.

$ rpi-loop-device-namer 0
disk/by-backingfile/var-swap

$ rpi-loop-device-namer 1
disk/by-backingfile/home-pi-disk.img

$ rpi-loop-device-namer 2
(no output)

/usr/lib/rpi-loop-utils/bin/rpi-loop-device-namer
The script itself.

/sys/block/loopN/loop/backing_file
Kernel sysfs file containing the backing file path for loop device N.

70-rpi-symlink-loop-devices.rules(7), rpi-setup-loop@.service(8), losetup(8), systemd-escape(1), udev(7)

This utility is typically called automatically by udev rules and is not intended for direct interactive use. The output format is specifically designed for use with udev's SYMLINK+= directive.

rpi-loop-utils rpi-loop-utils System Administration