Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-14-2013, 06:20 AM
|
#1
|
|
Member
Registered: Jan 2010
Location: india/pune
Distribution: Arch
Posts: 120
Rep:
|
I backed up and zero outed mbr and kept back up on same disk
I took backup of mbr by
Code:
dd if=/dev/sda of=mbr-backup bs=512 count=1
then zero outed it
Code:
dd if=/dev/zero of=/dev/sda bs = 512 count=1
Problem here is i forgot to copy the the backup in pendrive.So i want to detect my partition (ext4) on which the mbr-backup is present so that i can restore it.
I tried testDisk:
It detects partition table type as EFI GPT
when i analyse it shows the archlinux partition but does not list the files saying .. Can't open filesystem. Filesystem seems damaged.
Any help appritiated
|
|
|
|
01-15-2013, 02:52 PM
|
#2
|
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,380
|
Your file system is gone dude, you did a data dump to the drive. Your best option here is to do a fixmbr from a windows recovery disc to rebuild a new MBR.
|
|
|
|
01-15-2013, 03:12 PM
|
#3
|
|
Moderator
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 12,207
|
Since the OP only zeroed out the MBR the file-system is untouched. The fun thing is that Testdisk should be able to recover the disk, since you have made a backup copy of the MBR. Did you make a deep scan with Testdisk?
|
|
|
|
01-15-2013, 03:49 PM
|
#4
|
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,380
|
Tobi, since he output the dd to /dev/sda wouldnt that kill the partition as well or am I wrong here? Sorry to the OP if I was.
|
|
|
|
01-15-2013, 03:53 PM
|
#5
|
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,380
|
I see where I went wrong here, I completely overlooked the byte size and count arguments. Without those two arguments then I would be correct as the entire /dev/sda disk would have been overwritten but only the first 512byte block wouldve been over outputted to by the dd command here.
Again, sorry to the OP not sure why I didnt see that the first time through, been a long day heh
|
|
|
|
01-15-2013, 05:06 PM
|
#6
|
|
Senior Member
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 3,798
|
Isn't it possible to just create a partition starting at the beginning of the disk with a length which is approximately the same as it was? 99 chances out of 100 you get the beginning of the partition right and you can mount the file system. Of course it would produce errors when checking the fs, but maybe you are able to get the mbr image file.
jlinkels
|
|
|
|
01-15-2013, 05:21 PM
|
#7
|
|
Moderator
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 12,207
|
Should be possible, if you can figure out if the partition should begin at sector 63 (partitioned by older Windows versions and older versions of Linux) or sector 2048. And of course assuming that the partition with the MBR copy on it was the first partition in the disk.
|
|
|
|
01-15-2013, 06:09 PM
|
#8
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,231
|
Quote:
Originally Posted by rhklinux
I tried testDisk:
It detects partition table type as EFI GPT
|
This likely means all the old presumptions about partition location are invalid.
I'm mildly surprised the OP could actually zap the dummy MBR that gpt uses for compatibility. "dd" is kinda stupid that way - it does what its told to do.
If testdisk won't find your files, you might have to resort to a scraper like photorec or foremost. Ugly, very ugly.
|
|
|
|
01-15-2013, 08:51 PM
|
#9
|
|
Moderator
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 12,207
|
It is Arch Linux. I assume that the OP would know if he used GPT or MBR for partitioning the disk.
|
|
|
|
01-15-2013, 09:29 PM
|
#10
|
|
Member
Registered: Aug 2009
Distribution: CentOS
Posts: 693
|
If the disk was, at some time in the past, partitioned with GPT, then there would be a backup GPT at the very end of the disk. If you've zeroed out the MBR and its primary partition table, testdisk is going to see that old backup GPT and think that was how the disk was last partitioned.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:20 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|