I just came across an issue some of you may run across, and haven’t found a fix for, so I decided to share it with you.

But first, a little backstory.

I have a laptop with those shiny NVidia Optimus cards in it, yes it’s great but I have serious overheating issues, especially with Flash.
At some point (and this happens far too frequently), my laptop will hang so much that only a hard reset can be performed. Strangely, this happens when my disk is spinning continuously, and the heat coming from it is enough to fry an egg on.
But, that’s not your concern.

So after the reboot, I was greeted by a recovery screen where fsck had to be performed.
This I did, and pressed the relevant amount of ‘y’ to continue.
But alas, no X server.

Have the same issue? Well, not all is lost.

First run ‘fdisk -l’ to get a look at your layout.

In my case I got an ugly red message informing me that partition 2 did not start on a physical sector.

Subsequently, ‘fsck -y /dev/sda2’ just resulted in the zero-length error.

First, you must unmount all the partitions (especially those surrounding the problematic partition). I found that in my case, /dev/sda3 was mounted.
So performing ‘umount /dev/sda3’ went without issue.

After which I ran ‘fsck -y’

This would check all partitions. The -y flag here automatically fixes errors.

Once done, I could reboot using ‘shutdown -r now’ and the problem was gone.

Please note though, that this can be an early sign that you have a failing hard drive, so it’s important to back up your files as soon as possible. This doesn’t fix the drive, merely give you enough time to back things up.

Advertisements