I am having a problem with my ubuntu ext3 filesystem. I can't boot from it or mount the volume when running live CD.

When I try e2fsck I get: "Bad magic number in super-block while trying to open /dev/sda5". I have tried all the alternative superblocks with the same result.

I have heard you can delete the journaling system and mount as ext2, but the suggestions on how to do this (eg this one) all require a valid superblock. Is it credible that all the backup superblocks are corrupted or is there something else going on?

The filesystem seemed fine before I rebooted, so pretty sure it's recoverable. What else can I try?

Output from fdisk

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa4e507fa

/dev/sda1              26        8903    71303168    7  HPFS/NTFS
/dev/sda2            8903       38914   241061889    5  Extended
/dev/sda5            8904       13159    34186320   83  Linux
/dev/sda6           38167       38914     5999616   82  Linux swap / Solaris
/dev/sda7           13160       38166   200868696    7  HPFS/NTFS

Output from sudo file - `</dev/sda5`

bash: /dev/sda5: Permission denied

(What was this supposed to show?)

Output from sudo file -s `/dev/sda5`

/dev/sda5: data
  • 1
    which version of Ubuntu ? 8.04,9.04 or 10.04 ?
    – sushanth
    Mar 3 '11 at 16:13
  • It's Ubuntu 10.10 Maverick Meerkat.
    – thepeer
    Mar 3 '11 at 16:14
  • Are you sure you aren't using LVM?
    – jsbillings
    Mar 3 '11 at 16:17
  • @jsbillings The file system was definitely ext3; not sure what you mean by "using LVM". I did make some changes to the partitions on the disk today (under Windows; I dual boot), but successfully booted Ubuntu after that.
    – thepeer
    Mar 3 '11 at 16:21
  • 1
    LVM is the Logical Volume Manager. What I suspect is that /dev/sda5 isn't actually an ext3 partition, but a physical volume in an logical volume managed by LVM. lvm pvdisplay /dev/sda5 should identify whether it is an LVM physical volume or not.
    – jsbillings
    Mar 3 '11 at 16:29

I'm afraid there isn't a recognizable filesystem on this partition any more. It's time to restore from a backup.

Just in case there's a hardware problem such as bad RAM or a bad cable that's causing wrong data to be read, you can try reading from another machine. But that's very unlikely to be the case if you can neither boot from the partition nor read it from a live CD environment.

One thing that's suspicious is that you have an extended partition starting at cylinder 8903, but the first logical partition on it starts at cylinder 8904. Try sudo tail -c +513 /dev/sda2 | file - to see if there's something recognizable at the very beginning of the extended partition. (I'm not sure the offset is always 512, it might be 4096 or 32256 or some other number; note that you need to add 1 to the offset for the tail command.) If the problem is indeed that your partition table flipped a bit, use fdisk or your favorite partition editor to change /dev/sda5 back to starting at cylinder 8903.

  • The output from the tail command was: /dev/stdin: x86 boot sector; partition 1: ID=0x83, starthead 254, startsector 1, 68358144 sectors, extended partition table (last)\011, code offset 0x0. Is that the kind of thing you meant?
    – thepeer
    Mar 3 '11 at 23:20
  • @thepeer: I think that means my suspicion about the partition start is right, so you haven't lost your data after all! Try modifying the partition boundary, or removing and recreating the partition. Make sure you end up with a logical partition that starts at the first sector inside the extended partition. Mar 3 '11 at 23:23
  • GParted sees the volume as corrupt and refuses to work, and I can't figure out how to move the boundary with fdisk. Can you give me a hint?
    – thepeer
    Mar 3 '11 at 23:28
  • @thepeer: I don't know why GParted would say this. With fdisk, you have to delete the partition and re-create a logical partition at the right boundaries. I'm not sure if fdisk will spontaneously choose the proper boundary, you may need to go into expert mode. I suggest asking on Super User where you'll find people who know this stuff better than me (plus it's past my bedtime already), or perhaps their chat. Mar 3 '11 at 23:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.