I'm trying to shrink my raspberry pi images following this tutorial: https://softwarebakery.com/shrinking-images-on-linux
root@host:~# modprobe loop # no errors returned
root@host:~# lsmod | grep loop # returns nothing - this is strangeā¦
root@host:~# ls /dev/loop*
/dev/loop0 /dev/loop2 /dev/loop4 /dev/loop6 /dev/loop-control
/dev/loop1 /dev/loop3 /dev/loop5 /dev/loop7
root@host:~# sudo losetup -f
/dev/loop0
root@host:~# losetup /dev/loop0 myimage.img
losetup: myimage.img: failed to set up loop device: Operation not permitted
Why?? What am I doing wrong?
EDIT: Spending a couple days googling I've found no hints what could be a problem here. But I've noticed that some .img files are working just fine, while others giving "Operation not permitted".
Any clues what can be wrong with the image and possible fix solutions?