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 #1

Open
radostyle opened this issue Oct 16, 2016 · 3 comments
Open

Bad magic number in super-block #1

radostyle opened this issue Oct 16, 2016 · 3 comments

Comments

@radostyle
Copy link

I purchased a Kingston 16G SD card. I plugged it into the builtin SD card reader on my Ubuntu 16.10 Acer Aspire One netbook.

My sd card reader showed the card at mmcblk0 rather than and sd* drive. I had to modify the step to add a p1 suffix instead of just 1 suffix.

At the e2fsck step I got an error "ext2fs_open2: Bad magic number in super-block". At that point also I could not mount the partition.

So I had to create a bootable primary linux partition with fdisk. Then I used kpartx to mount the image and copied just the active partition from the image onto my sd card linux partion. I'm not sure why it didn't work, but here is what happened.

root@ja:/home/jon# sfdisk /dev/${dev} << 'EOF'

,,,*
EOF
Checking that no-one is using this disk right now ... OK

Disk /dev/mmcblk0: 14.4 GiB, 15489564672 bytes, 30253056 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: 0x00000000

Old situation:

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 1 987349 987349 482.1M 83 Linux

Created a new DOS disklabel with disk identifier 0x3964aacf.
Created a new partition 1 of type 'Linux' and of size 14.4 GiB.
/dev/mmcblk0p2:
New situation:

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 30253055 30251008 14.4G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

root@ja:/home/jon# e2fsck -f /dev/${dev}1
e2fsck 1.42.13 (17-May-2015)
e2fsck: No such file or directory while trying to open /dev/mmcblk01
Possibly non-existent device?

root@ja:/home/jon# fdisk -l

.... lines removed

Disk /dev/mmcblk0: 14.4 GiB, 15489564672 bytes, 30253056 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: 0x3964aacf

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 30253055 30251008 14.4G 83 Linux
root@ja:/home/jon# ls /dev/${dev}
/dev/mmcblk0
root@ja:/home/jon# e2fsck -f /dev/${dev}p1
e2fsck 1.42.13 (17-May-2015)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/mmcblk0p1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193
or
e2fsck -b 32768

@cellularmitosis
Copy link
Member

Hi @radostyle,

That seems odd that didn't work.

Have you tried writing the 4GB image to your SD card and seeing if you can boot from that? If that works, maybe you can find another way to grow the partition afterwards.

@radostyle
Copy link
Author

Hi Jason,

Yes I was able to write the image to my SD card, but I had to manually
create the partition. I formatted the partition with the command from the
rootfs preparation you documented Then I mounted the image with kpartx
and copied just the system partition to my manually created partition.
Then I used the command you gave to resize the filesystem. Thanks for your
image, documentation, and mirrored files.

On Oct 16, 2016 3:02 PM, "Jason Pepas" [email protected] wrote:

Hi @radostyle https://github.com/radostyle,

That seems odd that didn't work.

Have you tried writing the 4GB image to your SD card and seeing if you can
boot from that? If that works, maybe you can find another way to grow the
partition afterwards.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJRZQJyIQFhues0oaUDLJwKKL9ugXCUks5q0oLWgaJpZM4KX4ZB
.

@radostyle
Copy link
Author

I used the kpartx instructions here to mount the disk image:
https://nfolamp.wordpress.com/2010/08/16/mounting-raw-image-files-and-kpartx/

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

No branches or pull requests

2 participants