You are not logged in.
I have a disk image file that contains two partitions, of which I want to mount the second partition.
When I do
$ fdisk -l Manjaro-ARM-phosh-pinephone-beta20.img I can see the sector size (512) and the partition start (500001), so I can calculate the offset, and try to mount it using:
$ mkdir pp-mnt
$ sudo mount -o loop,offset=256000512 Manjaro-ARM-phosh-pinephone-beta20.img pp-mntwhich fails after:
mount: pp-mnt: mount failed: Action is not permitted (translation mine).The pp-mnt directory is drwxr-xr-x and I also tried this as root, but I keep getting that error.
Additionally, /dev/loop0 does not exist, and even creating it with
$ sudo mknod /dev/loop0 b 7 0Results in:
# sudo losetup /dev/loop0 Manjaro-ARM-phosh-pinephone-beta20.img
# losetup: /dev/loop0: configuring loop device failed: device or address does not exist (translation mine)Can someone tell me how the loop back device under Arch should work and how to use it to mount disk images?
Last edited by diederick76 (2022-01-23 10:58:26)
Offline
something seems wrong with your loop device.
Reboot the machine,
execute
sudo losetup --verbose --find
sudo losetup --verbose /dev/loopX Manjaro-ARM-phosh-pinephone-beta20.imgby replacing X with the free number from the 1st command.
Please post the complete in+out, also logs from dmesg and journalctl, maybe the loop device gets lot loaded ?
Offline
Rebooting did the trick. There was a /dev/loop0 device afterwards. Thanks!
A classic turning it off and on again.
Last edited by diederick76 (2022-01-23 10:57:14)
Offline
Note that the mount command will handle loop devices automatically with no need to specify the loop option.
You can also use the shell to calculate the offset, for example:
# mount -o offset $((500001*512)) Manjaro-ARM-phosh-pinephone-beta20.img pp-mntJin, Jîyan, Azadî
Offline
Thanks, I didn't know that. I always go into python to do calculations.
Offline