4.15.0-34-generic
Hello, for years I've been using 'dd' command to create .img files of partitions, and restoring them by mounting them and rsyncing them to the target partition.
I've never encountered any problems mounting my .img files until today when I noticed my newest .img file does not mount but my second oldest .img file does (yesterday I recall having no problem mounting as either ro or rw):
sudo mount -o loop,ro newest.img /temp/
produces the error:mount: cannot mount /dev/loop0 read-only
sudo mount -o loop,rw newest.img /temp/
produces the error:mount: /data/newest.img: failed to setup loop device: Operation not permitted
sudo mount newest.img /temp/
produces the error:mount: /data/newest.img: failed to setup loop device: Operation not permitted
Now when I try mounting the 2nd newest file (and all older):
sudo mount -o loop,ro 2nd_newest.img /temp/
WORKS!sudo mount -o loop,rw 2nd_newest.img /temp/
produces the error:mount: /data/2nd_newest.img: failed to setup loop device: Operation not permitted
sudo mount 2nd_newest.img /temp/
produces the error:mount: /data/2nd_newest.img: failed to setup loop device: Operation not permitted
The 'dd' command I've always used to create the .img files is:
sudo dd if=/dev/sda$partition of=/data/newest.img
The 'mount' commands I've always used to mount the .img file (for rsyncing to another mounted partition) is:
Code: Select all
sudo mkdir /sda$partition
sudo mount /dev/sda$partition /sda$partition
sudo mount /data/newest.img /temp
The 'rsync' command I've always used to restore the mounted .img files is:
sudo rsync -advAX --progress --delete /temp/ /sda$partition/
It seems somehow the .img file I'm creating is unmountable ( old ones work fine ). 'e2fsck' returned no errors on any partitions and loop devices appear to be all present and working. It just doesn't like my new .img files.
Without the ability to create and restore partition images I'm having an IT nightmare and my whole system is at risk of destabilizing.
It makes no sense unless some kind of system update changed the way my image capturing works.
Clues, please? Thanks. I've been troubleshooting and researching these errors for hours and failed to dig up anything useful.
UPDATE: I just discovered this mount command works for my newest.img:
sudo mount -o ro,norecovery,loop /data/newest.img /temp
The first time I mounted it this way it would not unmount (was busy) and I had to use 'umount -l'. Now it mounts and unmounts with the norecovery option and does not get 'busy'.
However, this does not explain why the newest.img requires 'norecovery' and the older ones do not.