BBBlfs icon indicating copy to clipboard operation
BBBlfs copied to clipboard

Partition corrupted, superblock invalid !

Open tchepperz opened this issue 8 years ago • 4 comments

Hi, I'm trying to flash my BBB (rev C) with the lastest debian image via USB.

This is what I got when the flashing script finished

` Flashing now, be patient. It will take ~5 minutes!

0+300408 records in 0+300408 records out 3565158400 bytes (3.6 GB, 3.3 GiB) copied, 453.595 s, 7.9 MB/s

Resizing partitons now, just as a saefty measure if you flash 2GB image on 4GB board! 2: unknown command e2fsck 1.43.1 (08-Jun-2016) 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/sdc2

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

resize2fs 1.43.1 (08-Jun-2016) resize2fs: Bad magic number in super-block while trying to open /dev/sdc2 Couldn't find valid filesystem superblock.

Please remove power from your board and plug it again. You will boot in the new OS!`

I tried e2fsck command below, same error message (superblock corrupt)

I did `sudo mke2fs -n /dev/sdc2

mke2fs 1.43.1 (08-Jun-2016) Creating filesystem with 933632 4k blocks and 233856 inodes Filesystem UUID: 09628511-1ec4-4826-b819-1c09b67087ad Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736`

And then e2fsck -b blocknumber /dev/sdc2

For each block number below and I got the same error except for block 884736, but it finished with

`Inode 64425 block 33261 conflicts with critical metadata, skipping block checks. Illegal block #568330252 (381881341) in inode 64425. CLEARED. Error storing directory block information (inode=64425, block=0, num=471243006): Memory allocation failed

/dev/sdc2: ***** FILE SYSTEM WAS MODIFIED ***** e2fsck: aborted

/dev/sdc2: ***** FILE SYSTEM WAS MODIFIED ***** ` Nedless to say that my BBB is not booting.. I tried flashing 3 times and it's ever the same, flashing seems to corrupt my emmc partition. How could I fix this? If anyone has an idea.. Thanks

tchepperz avatar Nov 29 '16 13:11 tchepperz

Hey @tchepperz, I do not have to do any active development on this project. Can you ask in #beagle IRC channel for help? I think the beagle people can use now u-boot to achieve same thing my project does.

ungureanuvladvictor avatar Nov 29 '16 16:11 ungureanuvladvictor

Hi @tchepperz, I run into same issue using a bone-debian-8.8-machinekit-armhf-2017-05-21-4gb.img.xz image, which does not provide a 2nd partition in the image. Thus, when the script is deleting the 2nd partition it fails. My proposal for such case is just skipping resize implementation which are the following lines in bin/flash_script.sh:

142 echo 143 echo "Resizing partitons now, just as a saefty measure if you flash 2GB image on 4GB board!" 144 echo -e "d\n2\nn\np\n2\n\n\nw" | sudo fdisk /dev/$bbb > /dev/null 145 fi 146 sudo e2fsck -f /dev/${bbb}2 147 sudo resize2fs /dev/${bbb}2

If you manually want to resize, use gparted for that task.

br, rr

rubienr avatar May 27 '17 19:05 rubienr

This change seems to be all that's needed, to get BBBlfs working with the latest (9.1) debian images.

ndorf avatar Oct 18 '17 12:10 ndorf

This change seems to be all that's needed, to get BBBlfs working with the latest (9.1) debian images.

You are a life saver. Works on latest 10.3 debian too.

hellraiserinchief avatar Nov 27 '20 16:11 hellraiserinchief