LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-26-2013, 05:51 PM   #1
roberto32
LQ Newbie
 
Registered: Dec 2013
Location: Slovakia (Modra)
Distribution: Suse 13.1. LMDE 13, ubuntu 12.04(not a newbie but passwd recovery is really weird a bug?)
Posts: 21

Rep: Reputation: Disabled
recover after dd(part table on extended part lost) but data should be there


I've accidentally typed wrong number : dd if=/dev/urandom of=/dev/sda2 which is my extended parition where I've suse installed and I wanna install encrypted LMDE(I also have a /dev/sda1 which is data partition). COmmand line outputed that it wirtes only 1kb so it looks like all the parititons should be there unchanged only the partition table(begginging of part) of the extended partition is bad/destroyed. Gparted says that it's libparted bug(wrong signature 7c58) which apparently isn't but it interpreted it that way. And I didin't installed suse to MBR so there is no way to recover it I just need new one. So my question how to manully create partition table and where to place it (I assume that at the beggining of the sda2 partition)
 
Old 12-26-2013, 07:40 PM   #2
mlslk31
Member
 
Registered: Mar 2013
Location: Florida, USA
Distribution: Slackware, FreeBSD
Posts: 210

Rep: Reputation: 76
I know nothing about libparted. What do the following commands state?

Code:
fdisk -l /dev/sda

gdisk -l /dev/sda
The extended partition that you think you destroyed, what partitions were on there before?

If you're just looking for another fdisk tool to use, there's fdisk, sfdisk, and cfdisk for MBR partitions; gdisk for GPT partitions, maybe more tools. Partition reconstruction is hard unless you know exactly where your partitions used to start. As a safeguard, I do something like this:

Code:
fdisk -l /dev/sda > sda-partitions
Then I either move that sda-partitions file somewhere else or print it out, in case I make the same mistake you made. [FWIW, I have made this very mistake.]
 
Old 12-27-2013, 03:17 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Logical partitions are a linked-list - they are not addressed via a (single) partition table like primary partitions.
Over-writing with random data will certainly have obliterated the "disk signature" for the first logical partition. Testdisk may find the logicals for you and correct the signature - although determining the first logical may be beyond it. Whether the filesystem is usable is a different question - again testdisk may work for you.
Or not.

Restoring from your backup is the best recovery.
 
Old 01-02-2014, 10:39 AM   #4
roberto32
LQ Newbie
 
Registered: Dec 2013
Location: Slovakia (Modra)
Distribution: Suse 13.1. LMDE 13, ubuntu 12.04(not a newbie but passwd recovery is really weird a bug?)
Posts: 21

Original Poster
Rep: Reputation: Disabled
thanks guys for advice, especially for that fdisk > ...command it can avoid a lot of pain. And about that backup - I use btrfs, but I learned that once a week you should copy the snapshot to some external drive such as usb...
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
RFC 4884 - Extended ICMP to Support Multi-Part Messages othe Linux - Networking 0 06-21-2009 10:01 PM
LXer: Using TCT To Recover Lost Data On Linux Or Unix - Part Two LXer Syndicated Linux News 0 05-20-2009 06:00 AM
Need to recover lost partition table business_kid Linux - General 4 03-24-2008 10:42 AM
Howto recover lost and formatted data on lost partitions. Sören Schneider LinuxQuestions.org Member Success Stories 2 04-05-2006 06:38 AM
HELP!!! to recover lost inode table moden Linux - General 3 11-26-2002 05:53 AM

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

All times are GMT -5. The time now is 02:16 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