Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad magic number in super-block while trying to open loop device #243

Open
JohanNicander opened this issue Sep 30, 2022 · 3 comments
Open

Comments

@JohanNicander
Copy link

Setup

OS: Ubuntu 20.04.5 LTS (bare metal)
sd-card OS: Raspberry Pi OS Light (64-bit)

Steps to reproduce error

Clone the sd card (same results using dd)

$ pv < /dev/sda > my-image.img

Run PiShrink

$ pishrink.sh my-image.img
pishrink.sh v0.1.2
pishrink.sh: Gathering data ...
tune2fs: Bad magic number in super-block while trying to open /dev/loop6
tune2fs 1.45.5 (07-Jan-2020)
pishrink.sh: ERROR occurred in line 298: tune2fs failed. Unable to shrink this type of image

Extra info

$ file my-image.img
my-image.img: DOS/MBR boot sector; partition 1 : ID=0xc, start-CHS (0x40,0,1), end-CHS (0x3ff,3,32), startsector 8192, 524288 sectors; partition 2 : ID=0x83, start-CHS (0x3ff,3,32), end-CHS (0x3ff,63,32), startsector 532480, 30384128 sectors
$ fdisk -l my-image.img
Disk my-image.img 14.74 GiB, 15829303296 bytes, 30916608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8b97fb85

Device         Boot  Start  End      Sectors  Size  Id Type
my-image.img1        8192   532479   524288   256M  c  W95 FAT32 (LBA)
my-image.img2        532480 30916607 30384128 14.5G 83 Linux
mount -t ext4 my-image.img /mnt -o loop,offset=272629760,ro
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/loop2, missing codepage or helper program, or other error.
@fredrikfalkman
Copy link

I have had the same problem running Pishrink on Mac, Ubuntu and Raspian. Also trying to compress Raspberry Pi OS Light (64-bit) 24Gb SD card.

Screen Shot 2022-10-14 at 00 35 17

@Drewsif
Copy link
Owner

Drewsif commented Feb 14, 2023

So that error usually means the OS does not know what the partitions filesystem is. Can anyone confirm if the partition layout changed in the latest Raspberry Pi OS Light?

@develcore
Copy link

develcore commented Apr 2, 2023

Same error.

OS: Debian Bullseye
sd-card OS: Raspbian Buster
mmcblk0p1 is fat32.
mmcblk0p2 is f2fs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants