Superblock read error| Diagnosing correct ext file system | Surviving fsck.ext3.ext4 messages in Precise Pangolin 12.04.

Finally it happened. My laptop was a bit slow yesterday evening as also in the morning. In the evening it simply did not boot. It has Precise Pangolin 12.04 with Cinnamon. Unity has not been removed. The message it displayed was:

General Error mounting filesystem.
A maintenance shell will now be started.
Control-D will terminate this shell................
sulogin.............etc. etc.

Apparently the disk could not be read. A typical File system error. After the boot loader hands over the command to OS, the first thing it reads from disk is called “Superblock” which includes the disk’s geometry information, available free space, and most important is the location of the first i-node i.e. beginning of disk.

Now I rebooted with Puppy Linux (A 200 MB Distro with everything we need) but it could not find Wifi radio driver on the Dell XPS laptop but it booted well and quick. Puppy did not have fsck.ext3 command. So I rebooted with Knoppix and tried this command on the Terminal:

       fsck.ext3 -n /dev/sda2

This was the output:

"Superblock could not be read or does not describe correct ext2 
filesystem. If the device is valid and really contains an ext2
filesystem (and not swap or ufs or something else), 
then superblock is corrupt, and you might try
...............alternate superblock"

fsck.ext4 helpIt also suggested a command with alternate superblock number but that could have ruined harddisk. It did once earlier. “fsck –help” was not helpful either. Actually it was but message was hidden and I did not notice the relevant part earlier.  So how I survived this time?

Surviving stupid fsck messages in Precise Pangolin 12.04 with Cinnamon

Now the hardisk is under some kind of freeze and no system, Puppy or otherwise, will mount it. I can remove the hdd and try to install the hard disk to a Windows XP and try to access it with explore2fs. Often it works well. After backing up, I could reformat it. That is the simplest and superfast way. But data is not my major concern on laptop. Current data is in sync with cloud. Home folder is on different partition. May be that one may survive.

Trying Alternate Superblock

The ext2 file systems place numerous copies of the Superblock throughout the disk. Actually it is one Superblock after every Group block. A group block is equal to 8192 blocks, thereby, the first redundant Superblock would be at 8193, second at 16385. But the above information is not complete. The ext3, stores superblock info according to the Block size of the file system. Yes it may have different Block Size on different disks. Now there is another problem that file system could be ext4 which is not supported by either Gparted or by above fsck.ext3 command. I do not remember what I chose at the time of installation. Now I rebooted into the lap top with Knoppix. It is a real comprehensive package. A 4+ GB installation distro is supposed to have it all. Command blkid disclosed that the file system was ext4 (as also its UUID  if there was some conflict later). So the correct command was:

            fsck.ext4 -v /dev/sdaX
            (X is the partition number)

The -v switch makes it verbose. Another way to use fsck is with -t switch:

            fsck -t ext4 -v /dev/sdaX

Now this worked on one partition on which /home was installed. It exited on Ubuntu OS installation with error but it does not matter. Knoppix could mount home partition with no difficulty. I shall be back with new installation on the same old root “/” partition by reformatting the same. No problem case closed except one. But something persisted me to press on. This the command for trying to find out  alternate superblock:

	sudo mke2fs -n /dev/xxx

It will give an output like this:

    	Superblock backups stored on blocks:
    	32768, 98304, 163840, 229376, 294912, 819200, 884736, 
        1605632, 2654208

We have tonote down the above numbers, correctly. Now restoring the superblock from the backup, again replacing the x’s with partition name, and block_number with the first backup superblock or the next one, if that does not work. We may add -y also to this command or else sit right in front and supply yes every time it asks.

       	sudo fsck.ext4 -b block_number /dev/xxx

Retry after after replacing the “block_number” with actual number from previous message. Now the final message.

        /dev/sdXX:  *****  FILE SYSTEM WAS MODIFIED *****
        ............................(0.9% non-contiguous), 
        1232435......

Alas the above could mount the disk in Knoppix but did not boot from Ubuntu. Recovery console of Precise also could not repair the corrupt system. What will I do. Re-format it? That is easier. I will decide tomorrow.

Google searches are not reliable.

Do not trust old posts. Use options on Google Search to switch to latest posts. Apply mind. All that was required was ext4 and not ext3 but none suggested to check that first. That is how I had ruined one hard disk when I first encountered similar error. At that time I had tried e2sck but the file system was ext3. So we have to be careful.
However there is a Testdisk project under GPL which is also worth trying. May be next time.

Similar Links:

Shop Amazon Electronics – Get 20 or More Off Select Laptops

Precise Pangolin Sucks!

Alternatives to Unity

© Sandeep Bhalla

Advertisements

Please share your views.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s