LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-08-2018, 07:20 PM   #1
Garrett85
Member
 
Registered: Jan 2011
Posts: 280

Rep: Reputation: 5
corrupt ssd, new partition table with parted


A long while back I had an SSD drive to get corrupted and as to date I've lost everything on the drive. I used dd to make an ISO image of the whole drive and then I created a copy of that iso. What I would like to do is to try and rebuild the partition table with some tool like parted and see if the file system is still there, if so great, if not that will mean a long tedious process of stitching the thing back together inode by inode which I don't know how to do. When using a tool like parted would it be better to use it on the device or on the ISO file?
And now to the thing that I need help with the most. I don't have much experience with tools like parted and I'm afraid I will actually overwrite/destroy the data that's on the drive/ISO while trying to rebuild the table. Is there anyone here who can walk me through the parted steps to get this safely done? Thanks.
 
Old 03-08-2018, 08:14 PM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, Manjaro
Posts: 8,783
Blog Entries: 14

Rep: Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069
Hi:

I've never had to rebuild a partition table before but you may want to use Test Disk.

https://www.linux.com/learn/how-fix-...on-table-linux
https://www.cgsecurity.org/wiki/TestDisk_Download

Can the partitions be mounted or are you getting operation system not found?
 
Old 03-08-2018, 08:19 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 16,969

Rep: Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564
always work on a copy of the data. That way you aren't stressing the device, and it doesn't matter if you screw something up - just take another copy and try again.
dd doesn't create iso's, it simply images the disk. Let's see this output.
Code:
partx --show some_image.file
 
Old 03-10-2018, 10:23 AM   #4
Garrett85
Member
 
Registered: Jan 2011
Posts: 280

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by syg00 View Post
always work on a copy of the data. That way you aren't stressing the device, and it doesn't matter if you screw something up - just take another copy and try again.
dd doesn't create iso's, it simply images the disk. Let's see this output.
Code:
partx --show some_image.file
This is my output.

Code:
me@mint-desktop /media/me/BCC22837C227F474 $ partx --show home.iso
me@mint-desktop /media/me/BCC22837C227F474 $ partx --show ./home.iso
Both attempts returned noting to the output.
 
Old 03-10-2018, 10:25 AM   #5
Garrett85
Member
 
Registered: Jan 2011
Posts: 280

Original Poster
Rep: Reputation: 5
device not mountable

Quote:
Originally Posted by Ztcoracat View Post
Hi:

I've never had to rebuild a partition table before but you may want to use Test Disk.

https://www.linux.com/learn/how-fix-...on-table-linux
https://www.cgsecurity.org/wiki/TestDisk_Download

Can the partitions be mounted or are you getting operation system not found?
I can't remember the exact error but no, the device is not mountable. It does show up in /dev/sdx but that's as far as I can get.
 
Old 03-10-2018, 12:16 PM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,378

Rep: Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979
Did you try testdisk?
 
Old 03-10-2018, 04:45 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 16,969

Rep: Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564
Quote:
Originally Posted by Garrett85 View Post
Both attempts returned noting to the output.
Hmmm - I would expect at least an error message. Try using sudo. What does this return
Code:
file home.iso
 
Old 03-10-2018, 05:51 PM   #8
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,998

Rep: Reputation: 1743Reputation: 1743Reputation: 1743Reputation: 1743Reputation: 1743Reputation: 1743Reputation: 1743Reputation: 1743Reputation: 1743Reputation: 1743Reputation: 1743
If you can loop mount the home.iso with
Code:
losetup /dev/loop0 home.iso
and you know the size of the drive, then
Code:
parted /dev/loop0
(parted) rm 1
(parted) rescue <start> <end>
(parted) quit
(where start and end are in units set by the parted 'unit' command)
will attempt to rescue the first partition and write the updated partition table.
I have not tried this with an image with multiple partitions. You may need to repeat for additional partitions.

PS - You may also need to use
Code:
(parted) set 1 boot on
to set the boot flag for the partition.

Last edited by allend; 03-10-2018 at 05:53 PM.
 
Old 03-10-2018, 06:50 PM   #9
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,378

Rep: Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979
If the image file is a whole disk with multiple partitions, you can use the mmls command from sleuthkit to find the offsets of the partitions, and then use the offset option in mount to mount the partition you want.
 
Old 03-12-2018, 06:16 PM   #10
Garrett85
Member
 
Registered: Jan 2011
Posts: 280

Original Poster
Rep: Reputation: 5
About to try some of these suggestions. This drive has been OOC for a while now but if I'm remembering correctly there's only one partition.
 
  


Reply

Tags
parted, ssd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dd to smaller partition gives corrupt superblock or partition table manscher Linux - General 5 07-10-2014 04:18 AM
Corrupt superblock or partition table jdtiede Linux - Hardware 2 12-29-2008 03:31 PM
corrupt partition table Verso Linux - Hardware 5 12-16-2003 10:23 AM
Corrupt Partition Table BigBadPenguin Linux - Hardware 3 09-02-2003 11:02 AM
Corrupt partition table mback Linux - Software 3 04-27-2002 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:23 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration