PiShrink: PiShrink fails on latest Debian Stretch
When running PiShrink on Debian 9, I get a lot of *2fs and mount errors:
$ sudo ./pishrink.sh ~/Desktop/shared/FULL_raspbian+RetroPie.img tune2fs: Input/output error while trying to open /dev/loop0 Couldn’t find valid filesystem superblock. tune2fs: Input/output error while trying to open /dev/loop0 Couldn’t find valid filesystem superblock. mount: /dev/loop0 is write-protected, mounting read-only mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. md5sum: /tmp/tmp.o0QqAkNH7P/etc/rc.local: No such file or directory ./pishrink.sh: line 63: [: !=: unary operator expected umount: /tmp/tmp.o0QqAkNH7P: not mounted e2fsck 1.43.4 (31-Jan-2017) e2fsck: Operation not permitted while trying to open /dev/loop0 You must have r/w access to the filesystem or be root resize2fs 1.43.4 (31-Jan-2017) resize2fs: Operation not permitted while trying to open /dev/loop0 ./pishrink.sh: line 136: [[: Couldn’tfindvalidfilesystemsuperblock.: syntax error: invalid arithmetic operator (error token is “'tfindvalidfilesystemsuperblock.”) expr: syntax error expr: syntax error expr: syntax error resize2fs 1.43.4 (31-Jan-2017) resize2fs: Operation not permitted while trying to open /dev/loop0 Couldn’t find valid filesystem superblock. ERROR: resize2fs failed… mount: /dev/loop0 is write-protected, mounting read-only mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. mv: cannot stat ‘/tmp/tmp.o0QqAkNH7P/etc/rc.local.bak’: No such file or directory umount: /tmp/tmp.o0QqAkNH7P: not mounted`
$ sudo dmesg | tail [ 1636.561900] UDF-fs: error (device loop0): udf_read_tagged: read failed, block=5911639, location=5911639 [ 1636.561904] UDF-fs: error (device loop0): udf_read_tagged: read failed, block=5911747, location=5911747 [ 1636.561909] UDF-fs: error (device loop0): udf_read_tagged: read failed, block=5911491, location=5911491 [ 1636.561913] UDF-fs: error (device loop0): udf_read_tagged: read failed, block=5911745, location=5911745 [ 1636.561917] UDF-fs: error (device loop0): udf_read_tagged: read failed, block=5911489, location=5911489 [ 1636.561921] UDF-fs: error (device loop0): udf_read_tagged: read failed, block=512, location=512 [ 1636.561925] UDF-fs: error (device loop0): udf_read_tagged: read failed, block=256, location=256 [ 1636.561928] UDF-fs: error (device loop0): udf_read_tagged: read failed, block=512, location=512 [ 1636.561930] UDF-fs: warning (device loop0): udf_fill_super: No partition found (1) [ 1636.571291] isofs_fill_super: bread failed, dev=loop0, iso_blknum=16, block=32
Can anybody tell me what the hell is going on? The errors seem to have to do with no permissions to me, but I’m sure I’m running the script as root. P.S.: Please don’t look at my formatting 😃
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 36 (4 by maintainers)
I just ran this fork-commit of pishrink.sh without errors on my RPi3-image, hopefully it will grow again when I need it: https://raw.githubusercontent.com/simonj0/PiShrink/2b4a63299ef25b20142122a2fec9e3209fcd5380/pishrink.sh
Hey @DismissedGuy @vdonchev @Duiesel @sookah you can check out my project PiShrink dockerized | Docker Hub PiShrink:
You can see how I create the Ubuntu Docker image, the installation process is very similar for Debian.
macOS setup
Install Docker Desktop on Mac
Make a copy of a Raspberry Pi SD card that you want to shrink (see instructions here).
Using the Terminal, access the directory containing the Raspberry Pi image:
This needs to be fixed. Pishrink is basically broken for any x86 users with the current version. I’ve tried everything and can’t get it to work unless I copy the file into the target machine.
I have the same problem with ubuntu 16.04.3 (32b) running on Virtualbox (Win10). I solved it by copying the .img file from shared Virtualbox Folder to Virtual Machine home directory and running the script from there.
How did you take the image? It looks like that might be broken