How to recover a (probably intact) ext4 partition

Hi All,

I have just tried accessing the ext4 partition on my external hard drive from my Ubuntu laptop, and getting the following message:


I’m guessing that this has been caused by using the same drive on Windows. There’s an NTFS partition before this ext4 partition. I suppose that Windows has done its usual thing, trying to take everything over, and thereby corrupting the ext4 file system. Good guess??? It was working fine on Linux before I connected the drive to Windows.

(Quick edit - here’s the partition table:)

So question 1 is of course how I can get the partition usable again. I would imagine that the data is all still there.

And question 2 is how to avoid this annoying stuff (other than using separate external drives or just giving up on Windows forever, which, alas, I’m not quite ready to do yet).

Thanks in advance, as ever :smiley:

Image the drive and use testdisk on the image. Should be able to get it going again. If so then you can write the image back to disk.

1 Like

Quick(er) way of recovery:
open a terminal, then do (as root!)

fsck.ext4 /dev/sda2

Use sudo if your system is configured for that.

1 Like