6

I have a bit of a problem. I am running Ubuntu 10.04 LTS on my laptop, and about 2 years ago I replaced the aging HDD with a 32 GB SSD. Today I tried to boot my computer, but it couldn't.

So I've put the SSD into an external HDD rack and booted a live CD Ubuntu 10.10 to try to recover data from the SSD. The SSD appears in the drop down menu but it won't mount.

Log:

ubuntu@ubuntu:~$ dmesg | tail
[ 2125.445659] sd 8:0:0:0: [sda] 62533296 512-byte logical blocks: (32.0 GB/29.8 GiB)
[ 2125.446983] sd 8:0:0:0: [sda] Write Protect is off
[ 2125.446988] sd 8:0:0:0: [sda] Mode Sense: 17 00 00 08
[ 2125.446992] sd 8:0:0:0: [sda] Assuming drive cache: write through
[ 2125.449084] sd 8:0:0:0: [sda] Assuming drive cache: write through
[ 2125.449098]  sda: sda1 sda2 < sda5 >
[ 2125.454285] sd 8:0:0:0: [sda] Assuming drive cache: write through
[ 2125.454293] sd 8:0:0:0: [sda] Attached SCSI disk
[ 2125.777836] JBD: no valid journal superblock found
[ 2125.777840] EXT4-fs (sda1): error loading journal

Is there a way to fix this so I can recover my data?

2 Answers 2

5

Just perform:

mke2fs -t ext4 -O ^has_journal /dev/sdX

(in your case sdX is sda1) to recreate the ext4 partition with the journal enabled. Or to reformat the partition:

mke2fs -F -L "PartitionLabel" -t ext4 -O ^has_journal /dev/sdX
1

Have you tried running fsck on it?

From the live boot, try something like:

fsck.ext4 -Dcfy -C 0 /dev/sdX#

That will:

-D - Optimize directories
-c - Check for bad sectors
-f - Force a check
-y - Assumes 'yes' to all questions
-C 0 - Prints info to stdout

You would just need to make sure, without mounting I believe, that you run it on X (the SSD) and each partition (only do EXT4 partitions).

That should fix system known issues, report back if you don't mind and I can update if I find other options.


Also found a link talking about the 'superblock' that may be worth checking though I am not familiar with this, but it uses similar commands:

sudo fsck.ext4 -v /dev/sdX

Output for a bad superblock should look like:

fsck /dev/sda5
fsck 1.41.4 (27-Jan-2009)
e2fsck 1.41.4 (27-Jan-2009)
fsck.ext4: **Group descriptors look bad**... trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/sda5

The superblock could not be read or does not describe a correct ext4
filesystem.  If the device is valid and it really contains an 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 <device>

Then check for location of superblock backups:

sudo mke2fs -n /dev/sdX

It should tell you the superblock backups are stored on blocks: # # #

Finally restore the backups (if they exist):

sudo e2fsck -b block_number /dev/sdX

Again, I haven't tried this and cannot speak to it's validity - hopefully someone else may know a bit more about this method. Source

1
  • 2
    Please don't blindly run fsck on a broken disk or file system: it can very easily take things from bad to worse in a hurry, particularly when using -y. Even in 2013, when this question was current, 32 GB was a comparatively trivial amount of storage space; common advice would be to make a sector-level copy (perhaps even two in this case, only touching one of them) and work on the copy, and see if you can get the filesystem back to a stable state, then either restore the fixed copy over the original, or simply extract the data from the fixed copy onto new media.
    – user
    Oct 2, 2016 at 12:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .