LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 05-15-2010, 06:43 AM   #1
locksoflove
LQ Newbie
 
Registered: Jan 2007
Location: Germany
Distribution: Ubuntu Edgy Eft
Posts: 3

Rep: Reputation: 0
I think I corrupted MBR by copying to /dev/sdb1


Dear all,
rather by accident, I copied a file to a USB drive by saying

cp <file> /dev/sdb1

rather than

cp <file> /media/USBDISK

I was surprised that this was at all possible (without root privileges and all), but now the drive cannot be mounted.

I did a

dd if=/dev/sdb of=corrupted.disk

but I don't know how to recover the data.

Any help appreciated.

Locks
 
Old 05-15-2010, 07:45 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Overwriting part of a filesystem structure with the contents of a file is a good way to destroy that filesystem structure. Since you haven't posted any disk, partition, file size and filesystem details I can only suggest you run 'testdisk /debug /log /path/to/corrupted.disk' to see if you can examine, and possibly salvage, remaining contents of the partition.
 
Old 05-15-2010, 09:14 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
I hope you ran that dd command so that "corrupted.disk" went to a different physical drive.

Regardless, do not do anything to that drive that could cause a write. If the OS is on there, then do not boot it. Mount the drive in another computer such that you control any use of it. (Or simply boot the current computer from a different physical drive.

One standard advice is to first clone the problem drive. If that "corrupted.disk" file is on another drive, then you have done this. BUT---check to be sure the file is the right size. It should be equal to the total capacity of the drive, regardless of how it is partitioned, or what data is on it.

In addition to testdisk, the other standard tool is photorec (both from the same author)

Not really relevant, but writing to partition as you describe should not affect the MBR.
 
  


Reply


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
kernel panic - can't resume /dev/sdb1 waelaltaqi Linux - Software 0 12-02-2008 01:20 AM
USB Detection; when /dev/sda1 or /dev/sdb1 ravime Linux - Hardware 6 09-12-2007 07:15 AM
why I can't find /dev/sdb1 in fdisk -l breeze027 Linux - Server 1 08-02-2007 05:44 AM
mkfs => Could not stat /dev/sdb1, although partition exists the_low Linux - Hardware 1 11-20-2006 09:10 AM
USB key /dev/sdb1 permissions problem... zparihar Linux - Hardware 6 02-03-2005 06:22 PM


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