In the event containers are being used on the server with images, attempting to
auto-mounting loop devices could interfere with their operation. We currently
don't have a use case where a user would want to auto-mount loop devices.
Initially suggested in
https://salsa.debian.org/freedombox-team/freedombox/-/issues/1854
Tests performed:
- Add a loopback device as follows and observe that is automatically mounted.
dd if=/dev/zero of=/tmp/test_disk bs=1M count=100
mkfs.ext4 /tmp/test_disk
losetup loop0 /tmp/test_disk
umount /dev/loop0
losetup -d /dev/loop0
- Add a loopback device as follows and observe that both partitions are mounted.
dd if=/dev/zero of=/tmp/test_disk bs=1M count=100
parted /tmp/test_disk
mklabel gpt
mkpart Part1 ext4 0% 50%
mkpart Part2 ext4 50% 100%
kpartx -avs /tmp/test_disk
mkfs.ext4 /dev/mapper/loop0p1
mkfs.ext4 /dev/mapper/loop0p2
umount /dev/mapper/loop0p1
umount /dev/mapper/loop0p2
kpartx -dvs /tmp/test_disk
- When --develop is removed or when code is modified to negate the not
condition, the partitions are not auto-mounted in the above cases.
Reported-by: James Valleroy <jvalleroy@mailbox.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>