Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The light went out yesterday and my fragile root partition and home partitions failed. I tried recovering the partition with "fsck" in a slax live usb, but I got an error: "could this be a zero length partition" (I`m sorry I'm not near my computer and can't give you the exact error, but it was just a single line).

I booted to slax because the ubuntu live usb won't boot if there is a corrupted ext4 partition. Is there any way to fix the zero length partition, either by managing to boot into ubuntu live usb somehow or some other tool. Thanks alot!

share|improve this question
You must not have pointed fsck to the correct partition, or the disk is toast. The ubuntu livecd should boot regardless and you can check the drive's SMART status. – psusi Feb 21 '12 at 3:36
I did first did a "fdisk -l" to make sure it was the correct partition (/dev/sda7), but the disk itself still works. This is not the first time I get this error, I've had it a few times happen on my root partition, and my livecd wouldn't boot. Back then I erased the root partition and the livecd booted. The problem is this time it happened on my home partition, where I do have some important files. When booting the livecd, and pressing "down" I get "stdin" and "I/O" errors, which again only fix when there isn´t a corrupt partition on the drive. I hope that helps in some way :). – DeoxNa Feb 21 '12 at 6:03
It sounds like your drive is toast. Check the smart status and dmesg for IO errors. – psusi Feb 21 '12 at 15:00
up vote 0 down vote accepted

Sorry for taking such a long time to answer, but I was trying to fix the drive.

In the end I made a gparted live-usb, then ran testdisk (tutorial: I then had the infamous gparted error where the entire drive was "unallocated".

After some looking around I found out this means that the partition table is corrupt. The partitions themselves, though, were accessible. After using testdisk a number of times in an attempt to fix the partition table, to no avail, I looked up other tutorials.

One of them said to do: "fdisk /dev/sdX", then check if the partitions it presents are correct, then write the new partition table. This also didn't work for me.

I then found a tool called "fixparts" which fixes corrupt partition table. I then made sure that the partitions I wanted (were) primary or logical are correct. Unfortunately, fixparts didn't get my "files and downloads" partition (shared between OSs) correct. I panicked.

I ran testdisk again, and gparted showed "unallocated" again. But I still had access to my files. I made a backup of all my useful files, of the files I needed from /home and from the now damaged files partition. I then ran fixparts once more.

In gparted I tried to fix how the partitions were supposed to be, but it didn't let me. So I had to erase my home and files partitions (in the extended) then grow the extended (there were 22 gigs of unallocated for some reason, which were part of my original files partition). I made the new home, swap and files partitions. I then had to reinstall ubuntu, and while the 300+ mb of updates downloaded (I have slow internet) I left all the files from the backup copying overnight.

I write this post from my newly updated Ubuntu install, with all the files where they're supposed to be. I tell my odyssey in hope someone will find it useful and be able to fix their corrupt drives.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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