Recover a partition from aborted disk resize (home)
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Recover a partition from aborted disk resize (home)
Hi, did something more stupid than I realised and would like to fix it
My main laptop has arch dual-booting with windows, and I decided I wanted Fedora added.
So I thought, fire up livedisk and start gparted to shrink partitition. I was having issues with badblocks (SSD if relevant) so investigated shrinking in smalljumps.
However one test succeeded on resize, but the last step ,e2moveimage? was taking ages so I pressed cancel.
Bam! now my home partition doesnt have a filesystem
Photorec has recovered all files , but no filenames.
So rather than grepping through all photorec files (loads of perlscripts and documents) is there any way of fixing my partition so it shows up again?
thanks
Mike
for info this is the output of fdisk -l
/dev/nvme0n1p1 2048 534527 532480 260M EFI System
/dev/nvme0n1p2 534528 567295 32768 16M Microsoft reserved
/dev/nvme0n1p3 567296 58335231 57767936 27.6G Microsoft basic data
/dev/nvme0n1p4 248020992 250068991 2048000 1000M Windows recovery environment
/dev/nvme0n1p5 58335232 59299839 964608 471M Linux filesystem
/dev/nvme0n1p6 59359232 106678271 47319040 22.6G Linux root (x86-64)
/dev/nvme0n1p7 124899328 153718783 28819456 13.8G Linux swap
/dev/nvme0n1p8 153735168 242755583 89020416 42.5G Linux home
Caveat: I have no experience of gparted things breaking like that.
Get an image of that partition - dd should suffice, I prefer ddrescue. Work only on the copy, or preferably a copy of the copy. That way cock-ups don't matter, and you can quickly try something else.
Some time ago I deliberately reformatted a ext4 filesystem as NTFS to see if it would really break things. Using "mkfs -S ..." (capital S) and fsck I was able to get all my data back. However, this was a test - new filesystem with only a few files, no fragmentation, no indirect inodes.
Read the warnings in the manpage, but on an image I would certainly give it a try.
Maybe if you had a backup even if old you might be able to get information on partition information.
It's been my experience that if you don't save a copy of the information before you try the change it will be difficult to return. I think windows had a un-partition program but not sure if linux does. There is a ultimate boot cd that has a tool to fix broken partitions but don't know if it's been updated for decades.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.