LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 05-05-2012, 04:28 PM   #1
tjbugler
LQ Newbie
 
Registered: May 2012
Posts: 4

Rep: Reputation: Disabled
Linux Disk Converted to MBR by Windows


Long story short, a drive was taken out of an HP Media Vault (which runs a linux based OS) and placed in a Win 7 machine. Windows apparently recognized the drive and prompted the user to convert it to an MBR - the user selected yes.

The drive has a lot of info on it which is still there, but can't be accessed by either Windows or Linux (Ubuntu) - can't mount the disk. Photorec will recover most of the files, but is there a way I can recover the files and structure?

Any ideas would be greatly appreciated.

Last edited by tjbugler; 05-05-2012 at 04:30 PM. Reason: updates
 
Old 05-05-2012, 06:33 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,784

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
In my experience, Photorec works best when used with another app called testdisk. You can read about and download it here.

Here's the introduction on there web page:
Quote:
TestDisk is powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table). Partition table recovery using TestDisk is really easy.
 
Old 05-05-2012, 07:18 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
What does "sudo file -s /dev/<device>" say about the drive & any partitions?
Does a partition show up? What is the starting sector?

At one time, the default first sector of a partition was on sector 63. Now it's 2048. If the drive wasn't reformatted, maybe it was re-partitioned. Try attaching a loop device starting at sector 63 and see if a filesystem is detected.

sudo /sbin/losetup -fs /dev/<drive_device> -o $((63*512))
sudo file -s /dev/loop#

Where loop# is the loop device returned by the losetup command.

If that doesn't work, try an offset of 2048 (e.g. -o $((2048*512))
Using 512 byte sectors with all your tools like fdisk and df will prevent rounding errors.

Testdisk may be able to do this all for you, but gathering information on the state of the disk yourself may be helpful knowing what you are dealing with,.
 
Old 05-05-2012, 07:39 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,353

Rep: Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042
Of course (in addition to the above) it's also possible the device wasn't partitioned at all, but was used as a full device. If such, the "conversion to MBR" would have wiped out (at least) a large chunk of the metadata that defined the usage.

I'd be heading back to that media vault to see how exactly it uses its disks.
 
Old 05-05-2012, 08:19 PM   #5
tjbugler
LQ Newbie
 
Registered: May 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
There are no partitions and it was used as a full device. I am in the process of using Photorec to recover what I can, but unfortunately it doesn't recognize all file types and returns a lot of text files (seems to be parsing the unrecognized file types). I was hoping to be able to recover the structure as well as all of the files, but that is beginning to seem less likely.
 
Old 05-05-2012, 10:24 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,353

Rep: Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042
Once upon a time (as a test) I deliberately re-formatted an ext3 partition as NTFS. As it was a test, this was a newly created (ext3) filesystem with a small number of newly created files - i.e. no updates, no fragmentation. Then I ran "mkfs.ext3 -S ..." just to see if it would work. Note the warnings in the manpage.
It did. In that very controlled environment.

In your situation I might be tempted to take a dd image of the drive and play as above on the copy. Nothing to lose if you have the spare capacity for the copy.
 
Old 05-06-2012, 06:52 AM   #7
tjbugler
LQ Newbie
 
Registered: May 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks syg00,

I've been using Photorec and Diskgetor to recover as many files as possible, but I will definitely try your suggestion. Restoring the drive would be optimal! I'll post back when I get a chance to try it out (maybe later to day).
 
Old 05-06-2012, 10:01 AM   #8
tjbugler
LQ Newbie
 
Registered: May 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Okay, so in stopping to think about it... When I use photorec or testdisk it shows headings for linux swap, then ms data and ex2. Whether I try to restore from an NTFS or ex2, I get the same files (many of which are corrupted). Could there be something done with the swap file to recover the data or the drive in its entirety?

Note, I haven't tried syg00 option. I'm contemplating sending the drive to have it professonally recovered.
 
  


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
windows working OpenVPN file need to be converted to Linux hemi_426 Linux - Networking 6 07-19-2008 02:43 AM
Hello from a converted ex-Windows-er Triumph LinuxQuestions.org Member Intro 2 09-17-2007 02:30 AM
SATA Hard disk(Windows) MBR corrupted by IDE hard disk(Linux) Peter_APIIT Fedora 6 07-07-2007 12:20 AM
Converted from Windows to Linux Broady LinuxQuestions.org Member Intro 1 05-26-2007 10:52 PM
windows commands converted to linux. Moses420ca Linux - Newbie 4 07-26-2003 11:10 AM


All times are GMT -5. The time now is 07:22 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration