• 0 Votes
    8 Posts
    1k Views
    RanmaR

    @mitu
    That's aces, thanks Mitu. I was just worried that there might be some jiggery-pokery going on behind the scenes, and if I kept doing this it could cause a problem I hadn't thought of.

  • 0 Votes
    13 Posts
    868 Views
    ByteThisB

    @GoodBoy said in [PiShrink] Creating new /etc/rc.local does not end - takes forever.:

    @mitu

    My apologies.

    I would say I waited about an hour and it was still trying to create the etc/rc.local

    It is a 64GB card, with about 32GB used space. I have just put the image on a 128GB card and I am going to camp this one out for a few hours.

    If that doesn't work, I am thinking about removing the etc/rc.local and retrying it. Not too sure what that will achieve but it's worth a go.

    @GoodBoy Why are you trying to shrink the image if you are going to place it on a 128 GB card ? Do a backup of the image..transfer it to the 128GB card and .you will have to expand the filesystem to access the full space on the card

  • 0 Votes
    8 Posts
    2k Views
    papinistP

    I have a similar problem trying to shrink my image with pishrink.

    pi@pi-VirtualBox /media/sf_SD__images $ sudo ./pishrink.sh 64gb_Papberry_arcade.img
    [sudo] password for pi:
    tune2fs: Attempt to read block from filesystem resulted in short read while trying to open /dev/loop0
    Couldn't find valid filesystem superblock.
    tune2fs: Attempt to read block from filesystem resulted in short read while trying to open /dev/loop0
    Couldn't find valid filesystem superblock.
    mount: /dev/loop0 is write-protected, mounting read-only
    mount: /dev/loop0: can't read superblock
    md5sum: /tmp/tmp.JImqrA1mnE/etc/rc.local: No such file or directory
    ./pishrink.sh: line 63: [: !=: unary operator expected
    umount: /tmp/tmp.JImqrA1mnE: not mounted
    e2fsck 1.42.13 (17-May-2015)
    e2fsck: Operation not permitted while trying to open /dev/loop0
    You must have r/w access to the filesystem or be root
    resize2fs 1.42.13 (17-May-2015)
    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.42.13 (17-May-2015)
    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: /dev/loop0: can't read superblock
    mv: cannot stat '/tmp/tmp.JImqrA1mnE/etc/rc.local.bak': No such file or directory
    umount: /tmp/tmp.JImqrA1mnE: not mounted

    @mitu running the command you said, this is the output:

    pi@pi-VirtualBox /media/sf_SD__images $ parted -m 64gb_Papberry_arcade.img unit B print
    WARNING: You are not superuser. Watch out for permissions.
    BYT;
    /media/sf_SD__images/64gb_Papberry_arcade.img:64021856256B:file:512:512:msdos::;
    1:4194304B:63963135B:59768832B:fat16::boot, lba;
    2:63963136B:63864569855B:63800606720B:ext4::;

    (I don't know how to use the forum editor to make this code looks like yours, with black background)