LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-15-2008, 12:36 AM   #1
radeson
LQ Newbie
 
Registered: May 2008
Posts: 6

Rep: Reputation: 1
how to recover partitions


hi, i'm really stuck. I mounted .img file to my disk partition and I damaged my partitions. I wanted to just extract img but my data from hdd dissapeared. I can't boot system. The disk manager programs says that they cannot recognize partition information. The command was: mount file.img /dev/sda2 .Please how can I recover my partition? All my data are there. Thank you for help
 
Old 05-15-2008, 05:23 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Hello and welcome to LQ, hope you like it here.


Quote:
Originally Posted by radeson View Post
I mounted .img file to my disk partition and I damaged my partitions.
Only mounting a file should not damage partitions or partition layout as far as I know. You must have done more than mounting.


Quote:
Originally Posted by radeson View Post
I can't boot system. The disk manager programs says that they cannot recognize partition information.
What disk manager program? What is the exact error? Do you by any chance have a full backup of the harddisk or the MBR plus partition table? If not boot a Live CD like KNOPPIX and run 'man gpart' to get aquainted with 'gpart' before running it.


Quote:
Originally Posted by radeson View Post
The command was: mount file.img /dev/sda2.
Next time create a temporary directory: 'mkdir /mnt/temp', then mount it with 'losetup /dev/loop0 /path/to/file.img; mount /dev/loop0 /mnt/temp'. Maybe a bit more complex but less prone to SNAFUs.
 
Old 05-15-2008, 07:25 AM   #3
radeson
LQ Newbie
 
Registered: May 2008
Posts: 6

Original Poster
Rep: Reputation: 1
unSpawnThank's for the reply
Quote:
Only mounting a file should not damage partitions or partition layout as far as I know. You must have done more than mounting.
Im think so, but I just have done the command which i wrote. First i mounted it on my linux ext3 parition. Then I opened konqueror to have a look on extracted files but when I submited location "/" nothing was there. I thought that is some KDE bug or something like there, so i rebooted linux. When the grub was starting, I get error 1.5 . Btw Im running debian etch.
Quote:
What disk manager program? What is the exact error? Do you by any chance have a full backup of the harddisk or the MBR plus partition table? If not boot a Live CD like KNOPPIX and run 'man gpart' to get aquainted with 'gpart' before running it.
I have tried GParted live CD. It said to me that it has got Unknown Filesystem and unknown Used and Unused size. PowerQuest partition magic live cd did the same. All the night i was running gpart but it didn't solve anything. I know that my data are still ok, because i have tried testdisk photorec and it gave me what hdd content's, so there must be just some problem with parition tables or something like there. Any ideas? Btw: Now i'm running by kubuntu live CD and sorry of my English ;-)
 
Old 05-15-2008, 07:50 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,133

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Lets' try a few guesses:
- You mounted to a device node, not a mount point - I'm mildly surprised it allowed you to do that actually.
- Then you extracted the files; overwriting the start of the filesystem.
- / was mounted on /dev/sda2.
- some (most ???) of your data was untouched; but probably not all. But the f/s metadata is gone.

Photorec is probably as good an option as any, or start searching LQ for forensic.
 
Old 05-15-2008, 07:54 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
"GRUB error 1.5" isn't really an error message: it's the stage GRUB errors out. It should be followed by a number (for expl see http://www.gnu.org/software/grub/man...#Stage2-errors) but if testdisk (not protorec) shows you your partitions in right order and size, by all means go with that.
 
Old 05-15-2008, 09:08 AM   #6
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
somehow the partition table must have gotten screwed up. Otherwise gparted would not have reported unknown partition.

What is the output of fdisk -l ?
 
Old 05-15-2008, 01:36 PM   #7
radeson
LQ Newbie
 
Registered: May 2008
Posts: 6

Original Poster
Rep: Reputation: 1
finally I fixed the partition table by testdisk. I'm really happy that my data are now in safe. Thank you for help ;-)
 
Old 05-15-2008, 04:16 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Cool. Now go make some backups :-]
 
  


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
Need to recover partitions! Please help! protege Ubuntu 9 08-11-2006 07:50 PM
Recover software raid partitions knoppix d_t_baker Linux - Hardware 1 07-09-2005 07:19 AM
recover VFAT partitions masand Linux - Software 1 01-07-2005 11:09 AM
How to recover data on lost partitions Red Squirrel General 12 03-20-2004 12:37 PM
Need help to recover extended partitions/logical drives dwmass Linux - Hardware 1 11-06-2002 07:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:37 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
Open Source Consulting | Domain Registration