All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: utility to rebuild ext4 partition?
PostPosted: December 1st, 2022, 13:19 
Offline

Joined: November 13th, 2018, 6:16
Posts: 26
Location: United Kingdom
Totally my own fault as I pressed too many buttons without a backup, but am hoping that all is not lost.

I have a 1TB Sata Disk in my Linux Laptop. I had a problem with the Grub file and tried to rebuild it but without any luck. This morning, I could reboot the laptop system by first booting from a USB drive, then using Grub utilities to boot the laptop, I should have made a backup at that point but... I tried to rebuild the Grub file and it looks like somehow the partition table and maybe some of the root partition were overwritten. Not surprisingly the system will no longer boot.
I've booted another system and attached the 1Tb drive via USB, I can scan the 1TB drive using Testdisk which can see the partition data and the directories under root but all of the sub directories such as home are empty with no chance of copying any data. I've run Foremost against a partial dd copy of the drive and it finds files, as does Photorec which is running now.

I'm wondering if anyone on here knows a way to rebuild the directories in the partition?

Thanks.


Top
 Profile  
 
 Post subject: Re: utility to rebuild ext4 partition?
PostPosted: December 1st, 2022, 13:56 
Offline
User avatar

Joined: June 11th, 2013, 17:01
Posts: 1710
Location: Phoenix, AZ USA
You can't 'rebuild' with ext4, you are beyond that now. Best you can hope for is to recover the data and start afresh. You made a good choice by making an image of the drive (not sure why you would only want to make a partial image). If you want to start imaging again use HDDSuperclone. But use a decent data recovery software such as DMDE, R-Studio or UFS Explorer. and DO NOT save any data back to the drive you are recovering from.

_________________
HDD, SSD, Flash and RAID Data Recovery
Founder of The Data Recovery Professionals Group


Top
 Profile  
 
 Post subject: Re: utility to rebuild ext4 partition?
PostPosted: December 2nd, 2022, 5:35 
Offline

Joined: November 13th, 2018, 6:16
Posts: 26
Location: United Kingdom
Thanks for the advice, I'll look into the packages you've suggested.
The reason I made a partial image is that I don't have a large enough drive to take the whole partition from the SSD so decided it was best to experiment on a test area.


Top
 Profile  
 
 Post subject: Re: utility to rebuild ext4 partition?
PostPosted: December 2nd, 2022, 6:29 
Offline

Joined: November 13th, 2018, 6:16
Posts: 26
Location: United Kingdom
I forgot to add (too late to edit my post above) that I do actually have a large enough disk to make a full copy but it has backup data on it. I'll copy the backups to a smaller drive then use the backup drive for making an image of the problem drive. When I rebuild the main 1TB drive I'll make some smaller partitions next time!


Top
 Profile  
 
 Post subject: Re: utility to rebuild ext4 partition?
PostPosted: December 2nd, 2022, 12:13 
Offline
User avatar

Joined: June 11th, 2013, 17:01
Posts: 1710
Location: Phoenix, AZ USA
cancunia wrote:
The reason I made a partial image is that I don't have a large enough drive to take the whole partition from the SSD.

Unfortunately SSDs do not work in the same way as HDDs. They have a nasty habit of permanently deleting data. However making an image is the best idea. Good luck.

_________________
HDD, SSD, Flash and RAID Data Recovery
Founder of The Data Recovery Professionals Group


Top
 Profile  
 
 Post subject: Re: utility to rebuild ext4 partition?
PostPosted: December 11th, 2022, 9:49 
Offline

Joined: November 13th, 2018, 6:16
Posts: 26
Location: United Kingdom
ddrecovery wrote:
Unfortunately SSDs do not work in the same way as HDDs. They have a nasty habit of permanently deleting data. However making an image is the best idea. Good luck.


Thanks for your help, I used a mix of tools and got a lot of data back.
TestDisk / PhotoRec
Foremost
R-Linux (R-Studio)

Testdisk allowed me to restore the partitions
Photorec recovered a lot of files, along with the Python program (sort-PhotorecRecoveredFiles
) to sort the files.
Foremost recovered some files but not as many as Photorec
R-Linux was overall, the most useful tool as it recovered files with their original names and directories.


Top
 Profile  
 
 Post subject: Re: utility to rebuild ext4 partition?
PostPosted: December 12th, 2022, 13:18 
Offline
User avatar

Joined: May 13th, 2019, 7:50
Posts: 907
Location: Nederland
Quote:
Testdisk allowed me to restore the partitions


Assuming you did on original drive: next time skip this step, a tool like R-Linux will detect the file systems whether partition table is present/intact or not. Arguably rebuilding partition table is low risk step, but if it can be avoided you should IMO.

_________________
Joep - http://www.disktuna.com - video & photo repair & recovery service


Top
 Profile  
 
 Post subject: Re: utility to rebuild ext4 partition?
PostPosted: December 12th, 2022, 13:35 
Offline

Joined: November 13th, 2018, 6:16
Posts: 26
Location: United Kingdom
Arch Stanton wrote:
Quote:
Testdisk allowed me to restore the partitions


Assuming you did on original drive: next time skip this step, a tool like R-Linux will detect the file systems whether partition table is present/intact or not. Arguably rebuilding partition table is low risk step, but if it can be avoided you should IMO.


Yes, I've learned a lot from this experience. I started with TestDisk & wanted the partitions as I thought at first that the files might just be there ready to be copied off, and when I had the partitions restored, it was better to make an image of the partition rather than an image of the whole 1TB drive. Hopefully there will not be a next time, but if there is, I'll start with R-Linux!

Thanks again for the help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 43 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group