Is it possible to recover data from repartitioned disk?

This is a followup of My swap gets cluttered up untill I can't hibernate anymore. A guy there recommended me that it would be easy to increase my swap size. Now I cannot even log in to my user anymore..

Because I somehow knew that it is risky I followed a trustworthy instruction: https://opensource.com/article/18/9/swap-space-linux-systems

Now something is broken and I cannot even boot anymore.

So far I tried to remove the resume=... part, but it did not help.

Any help appreciated!!

There's a problem mounting the root filesystem. Either it is corrupted or the wrong partition is being mounted. The best thing to do is to boot from a live usb and see what's going on at the disk level of the installed system. Can you post the exact steps you did when you messed the system up?

1 Like

Can you boot off a live iso and run some commands for use so we can see what is going on?

lsblk -o NAME,TYPE,FSTYPE,UUID,PARTUUID,MOUNTPOINT
cat /etc/fstab
1 Like

I figured with some friends that I probably broke my filesystem because I resized the partion via fdisk (now I know better :/)
Sure, here is some info:

Now the question is, is there a way to rescue some of the data..?

Uhh...did you delete your partitions and recreate them?

I will rename your post and see if someone more experienced with data recovery stops by.

1 Like

As dalto already mentioned we really need to know what you did. Exactly how did you make the changes. If you expanded your swap by shrinking another partition we need to know exactly which partitions you modified.

Please do not make any further changes to this drive if you want to have any hope of recovering your drive. If you have modified partition tables, any data that was located near modified partition boundaries is likely corrupted. If you are lucky the majority of your data may still be intact and recoverable (depending on what you did).

The safest method of recovery is to copy block for block all data currently still on the drive to another larger drive using dd. Then you can use the program testdisk to attempt recovery from the duplicated drive.

Recovery directly from the original drive can be attempted using testdisk, but that reduces your chance of a successful recovery operation. This process can take a very long time depending on the size of the drive involved.

2 Likes

Yes, some of the data is likely to be recoverable

  1. don't touch the disk! Any write operation on those partitions is likely to overwrite your data. Instead, make a disk image of your disk and operate on that.
  2. you can try to recover your partitions with testdisk.
  3. failing that you can recover the files with photorec. However, the files will be unsorted and randomly named, with a lot of dublicates. It's going to be a lot of work to sort them out.
2 Likes

I guess (because we don't know) it is the 'repartitioning' part that makes the OS unbootable.
Nothing to do with 'data recovery'. The core.img is just broke as the repartitioning moved the first sector to the left. And maybe, just maybe, the UUID has changed and the wrong swap UUID is still in fstab and in resume. OP has not clarified and perhaps he does not know what we want to know.
@tillus we want to know how you repartition. What was before and what was after.

Anyway @tillus follow this [More Complicated Setups] and try to boot to Manjaro.
If booted , recheck UUID and fix at fstab and etc/default/grub and do 'grub-install' and 'update-grub'. Reboot normally.

1 Like

well it may be ext4 partition needs to be repaired
from live usb repair ext4 partition from gparted or partition manager.
if the partition is repaired chroot and add the new swap partition uuid to fstab and /etc/default/grub

also it seems you shrink your root partition when you are booted .

and the guide did not tell you to shrink your partition from a liveusb.

that guide was for lvm not for regular installation.

so
repairing partition from liveusb may solve your problem.

1 Like

Fixing uuid's alone will not make it boot.

1 Like

Hey guys, as you can maybe tell was my week quite busy. Sorry I did not answer yet.
What I simply did was to do a clean install of manjaro on my partition. :confused: Because I knew I could basically recover the most important data when I put the work in and I did not have a spare harddrive to put my partition on it..
Last but not least, thanks for all your support!

testdisk - is an eminent recovery tool

You may loose the original filenames but you will be able to reover a lot.

You need an extra disk at least at the size of the data to be recovered as testdisk will not change the source disk.