LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 12-03-2019, 05:54 PM   #1
redtuxuk
LQ Newbie
 
Registered: Dec 2019
Posts: 2

Rep: Reputation: Disabled
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
 
Old 12-03-2019, 07:14 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.
 
Old 12-06-2019, 07:28 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
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.
 
Old 12-07-2019, 04:49 AM   #4
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,484

Rep: Reputation: Disabled
Check out if replacing a super block will work, it works on a Linux only system, I don't dual boot.

https://www.cyberciti.biz/faq/recove...ted-partition/
 
Old 12-08-2019, 03:02 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
I would dd off this drive and play with copies if data is really important.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How To Resize an Existing Hard Disk Partition Using the Boot Disk TracyTiger Slackware 6 10-13-2014 11:48 AM
Partitioning Troubles - Resize Operation Has Been Aborted resuni Linux - Hardware 13 06-10-2010 10:26 AM
Aborted a Gentoo Install. Kindly recommend me ways to recover my files. bap_120790 Linux - Newbie 17 02-09-2009 07:08 AM
lost fat32 partition during resize. Is it possible to recover some files? gkiagia Linux - Hardware 3 07-23-2006 09:15 AM
Disk Partition Resize Trouble and Partition Questions GNewbie Linux - Newbie 2 11-15-2005 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration