File system corruption / unable to mount /dev/sda*

My system partitioning is as follows in the photo :

I've been trying to grow the /dev/sda4 with the unallocated space to the right of it which supposed to go smooth but I lost the power in the middle of applying the operation and for some reason "unkown for me" I can't retry the operation neither mount the /dev/sda4 partition. whenever I try it shows the following message :

Please help me recover the partition it contains important data. Thanks.

it looks like to me (from the picture) you are running MATE at the same time you’re trying to grow one of it’s partitions. if this is the case I would say it will not work because it is in use. So if you fire up/boot a Live instance of MATE from a USB or whatever you have and then open up gparted and navigate to your OS hard drive you should be able to grow/expand your partition and way better luck in regaining your lost space.

Unless I am totally misreading the situation here.

Ain’t this just the same as ubuntu ? I’ve done this many times in ubuntu but this is my first time with MATE does it cause problems ?

well, I have never been able to work on a partition that is "mounted" in gparted as indicated in your picture. so maybe it is a MATE thing or maybe a GParted thing but to me it makes sense that you would not be able to expand your /dev/sda4 because it is "in use" and would have to be umounted or no key/lock in order to work on it in gparted.

No I took the screen shot when its mounted but actually not fully mounted it shows no data inside just sends me the error message in the second screen shot

Oh, so the picture was misleading then, I would use testdisk to recover any files I wanted recovered from the lost partition (make sure you have another harddrive/usb to copy to) and re-install my OS (IF that is were you are at)

steps can be found with pics on net don't have anytime left today but
sudo apt install testdisk

umount /dev/sda4
sudo testdisk /dev/sda4

Proceed
None
Advanced
--at this point you should be able to (Undelete)
Undelete
scroll through and find your files selecting them the letter a
once you have gathered all the files needed to recover press C
it will then ask you where to copy them to...

Sorry I must bounce, but I hope this helps in anyway, Good Luck
let me know...

@Amr.Magdy

Just as a suggestion, please boot from your live USB or CD as Blank said. From the live image, you can better mount and repair your data partition. Attempting to expand a partition while it is mounted (fully or not) will lead to errors. HTH.

1 Like

@mdooley Does Gparted accept to resize/format a partition mounted ? the answer is no … so why did I publish the first screen shot ? as said previously the purpose was only to show my partitioning schema so I can explain my situation. I’m pretty sure that the partition /dev/sda4 was unmounted so lets get back to the main point that I lost the data … I guess I will try your suggestion first to re-try operating from live USB/CD if that doesn’t work then I’m gonna try Blank’s solution about the testdisk thank you both. I’ll let you know.

Note that once you enlarge the partition you will have to grow the filesystem inside .
first you check the filesystem : e2fsck
second you enlarge the filesystem: resize2fs
Just google “linux ext4 grow filesystem” and you’ll find a lot of documentation about how to do it.

Regards,
BT
PS: You have to this from a live USB/CD and check that your partition is NOT mounted.

1 Like

@mdooley @Blank Thanks for both suggestions but re-trying from live USB/CD didn’t help much actually it didn’t do anything at all just the Gparted froze for hours for many tries and the testdisk only retrieved the data I personally deleted when the partition was healthy and working but couldn’t get my original data that wasn’t deleted so thanks anyways you’ve helped much, I think anyways its about the tabling system in the partition is corrupted somehow due to the resize (break) but I don’t a way to restore it or fix it

yeah tables are definitely not in my wheel house, but as far as testdisk goes, and I just checked it out on a healthy drive, you can still copy ( undeleded ) files to a new location. but once again I don’t know if my case is anyplace near yours. Not sure how it works with corrupt tables.
sorry and keep up the fight, good luck

I think this topic has confused ext4 (Linux) and NTFS (Windows) partition resizing.

That's a pretty risky unfortunate event. :frowning: If you can, perform a chkdsk on the drive by booting into a Windows Recovery environment (or installation CD) and opening the command prompt.

chkdsk /F C:

As it's NTFS, a Microsoft format, this should attempt to repair the file system.

If this partition doesn't even store Windows (and just data), I'd recommend switching to ext4 and keeping good regular backups of the drive.