I want to mount both partitions of a .img disk image file at the same
time, by default 'mount -o ....' uses the same loop device so on
trying to mount the second partition one sees:-
mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/raspbian/2021-05-07-raspios-buster-armhf-lite.img.
How do I crete a second loop device and get mount to use it?
Chris Green <cl@isbd.net> wrote:
I want to mount both partitions of a .img disk image file at the same
time, by default 'mount -o ....' uses the same loop device so on
trying to mount the second partition one sees:-
mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/raspbian/2021-05-07-raspios-buster-armhf-lite.img.
How do I crete a second loop device and get mount to use it?
According to "man mount" (on my comp)
'mount -o loop' (no explicit loop device) should try to find/use
unused loop device. Alternatively you may use
'mount -o loop=…' to explicitly name loop device.
Chris Green <cl@isbd.net> wrote:
I want to mount both partitions of a .img disk image file at the same
time, by default 'mount -o ....' uses the same loop device so on
trying to mount the second partition one sees:-
mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/raspbian/2021-05-07-raspios-buster-armhf-lite.img.
How do I crete a second loop device and get mount to use it?
According to "man mount" (on my comp)
'mount -o loop' (no explicit loop device) should try to find/use
unused loop device. Alternatively you may use
'mount -o loop=…' to explicitly name loop device.
Andrzej Adam Filip <anfi@onet.eu> wrote:
Chris Green <cl@isbd.net> wrote:
I want to mount both partitions of a .img disk image file at the same time, by default 'mount -o ....' uses the same loop device so on
trying to mount the second partition one sees:-
mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/raspbian/2021-05-07-raspios-buster-armhf-lite.img.
^M
How do I crete a second loop device and get mount to use it?
According to "man mount" (on my comp)
'mount -o loop' (no explicit loop device) should try to find/use
unused loop device. Alternatively you may use
'mount -o loop=…' to explicitly name loop device.
That doesn't seem to work though:-
root@t470# fdisk -l 2021-05-07-raspios-buster-armhf-lite.img
Disk 2021-05-07-raspios-buster-armhf-lite.img: 1.75 GiB, 1874853888 bytes, 3661824 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9730496b
Device Boot Start End Sectors Size Id Type
2021-05-07-raspios-buster-armhf-lite.img1 8192 532479 524288 256M c W95 FAT32 (LBA)
2021-05-07-raspios-buster-armhf-lite.img2 532480 3661823 3129344 1.5G 83 Linux
root@t470# mkdir -p /tmp/boot
root@t470# mkdir -p /tmp/rootfs
root@t470# mount -o loop,offset=$((8192 * 512)) 2021-05-07-raspios-buster-armhf-lite.img
/tmp/boot
root@t470# mount -o loop,offset=$((532480 * 512)) 2021-05-07-raspios-buster-armhf-lite.img
/tmp/rootfs
mount: /tmp/rootfs: overlapping loop device exists for /home/chris/dld/pi/2021-05-07-raspios-buster-armhf-lite.img.
root@t470#
Alternatively you can install kpartx
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 171 |
Nodes: | 16 (1 / 15) |
Uptime: | 14:43:59 |
Calls: | 3,415 |
Files: | 10,837 |
Messages: | 3,216,214 |