LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   recover partition + data (https://www.linuxquestions.org/questions/mandriva-30/recover-partition-data-569635/)

varun_saa 07-15-2007 09:18 PM

recover partition + data
 
Hello,

I had mandriva 2006 installed and I wanted
to upgrade to mandriva spring 2007.1

I have 2 dardisks - sda for OS installation
and sdb for databackup.

I blew my data disk sdb. Now it is unformatted.
Is there is a way I can recover my data.

Is there a software like " getdataback for windows "
for linux that will allow me recover my data ?

Please help.

Thanks in advance

Varun

GlennsPref 07-15-2007 10:22 PM

Hi a quick search with the smart package installer gave this info...

dd_rescue

Does copy data from one file or block device to another

Like dd, dd_rescue does copy data from one file or block device to another.
You can specify file positions (called seek and Skip in dd). There are several
differences:
o dd_rescue does not provide character conversions.
o The command syntax is different. Call dd_rescue -h.
o dd_rescue does not abort on errors on the input file, unless you specify a
maximum error number. Then dd_rescue will abort when this number is reached
o dd_rescue does not truncate the output file, unless asked to.
o You can tell dd_rescue to start from the end of a file and move bcakwards.
o It uses two block sizes, a large (soft) block size and a small (hard) block
size. In case of errors, the size falls back to the small one and is
promoted again after a while without errors.

dd_rhelp

A hard disk rescue helper

dd_rhelp is a bash script that handles a very useful program written
in C by Kurt Garloff which is called dd_rescue, it roughly act as the
dd linux command with the caracteristic to NOT stop when it falls on
read/write errors.

Both available from contrib-release repos. :)

(edit) also check out ddrescue (end edit)

More can be found here...

http://en.wikipedia.org/wiki/Dd_(Unix)

Cheers, Glenn

GlennsPref 07-15-2007 10:30 PM

also, from LQ....

http://www.linuxquestions.org/questi...d.php?t=511969
saikee
Senior Member

If the partition (or partitions) has not be formatted or written to then I expect a 100% recovery by just restoring the orginal partition table. Done it at least half a dozen times losing the entire partition table of my hda and hdc (both 200Gb) with 60 and 58 partition inside. I could only remember losing 1 to 2 partitions in total after these advantures (caused by installing systems indiscriminately).

The complete alteration or destruction of the partition table, situated in the 447th to 510th bytes of the MBR, has no influence on the content of the partitions, except causing the data inaccessible temporarily.

If the partition has been written onto then it is another matter as it would be necessary to format it first (thereby destroying the filing tracking/indexing system and replacing it with the new system) and new data overwritten onto the old data. In that case it is a forensic laboratory job to get what is left behind.

slimm609 07-15-2007 11:17 PM

try testdisk

it should be able to recover most if not all that information.

varun_saa 07-15-2007 11:21 PM

Hi GlennsPref,

The parition has not yet been reformatted or wrttien
yet.

So can you explain me how to proceed ?

Thanks

Varun

slimm609 07-15-2007 11:23 PM

Quote:

Originally Posted by varun_saa
Hi GlennsPref,

The parition has not yet been reformatted or wrttien
yet.

So can you explain me how to proceed ?

Thanks

Varun


testdisk is made for file recovery

GlennsPref 07-15-2007 11:47 PM

Hi, if you go to start/system/configure my computer (also called Mandriva Linux Control Center)

and select Mount Points, Create, delete Harddrive Partitions, select the drive to rescue, and click on "More"

You may be able to get the partition table back for that drive.

Most of the info in my previous post to this thread are quotes, and I have only done this once, quite a while ago(and it worked).

see how you go, this is the easiest and most straight forward way to begin.

There are more involved ways, but we'll try the fast and easy first, OK.

Regards, Glenn

ernie 07-15-2007 11:51 PM

As indicated by slimm609, Test Disk should be able to do the job you need to do (restore your partition). Test Disk is one of the tools included with
System Rescue CD (a live CD image (iso file) you can download and burn to disk. Start your computer with the System Rescue CD in the CD-ROM drive (the CD-ROM drive must be set as the first boot device in the system BIOS). After the system boots to a command prompt, you can enter the following command to get to a GUI interface:
Code:

startx
I have not had the misfortune to need the services of Test Disk yet, but I use partimage in my system backup routine and Gparted to manage my partitions. In my opinion, System Rescue CD is a must have collection for my disaster recovery toolbox.

HTH,

varun_saa 07-16-2007 05:20 AM

start/system/configure my computer (also called Mandriva Linux Control Center)

and select Mount Points, Create, delete Harddrive Partitions, select the drive to rescue, and click on "More"

You may be able to get the partition table back for that drive.

Well it restored a four small fat parition which I never
had.

I had one large 250GB sdb1 linux partition.

So what do I do next?

Varun

GlennsPref 07-16-2007 07:15 AM

Try clicking on "rescue partition table".

This should (?) get the partition table from the disk-drive.

Hopefully that will reinstate the partition table for the drive.

You may need to reboot to be able to mount it.

If so, then you may need to give it a mount point. Just use the name and address you used before, like

........ data and it's address... /data. It's full address will be /dev/sdb1, anyhow the program takes care of most of that, lucky you're not using LFS (Linux From Scratch).

You may even need to restore the partition table before it will work. Just don't save it till you have it working.

Good luck, (I did say it was a while ago, that I used this (about 3.5 years)),

regards Glenn

ps, this is really straight forward, but there are other ways to get your data back, but really messy.

GlennsPref 07-16-2007 07:36 AM

I found this.....http://wiki.mandriva.com/en/Docs/Support/Emergencies (last quartile of the page)

[quote] Diskdrake - works in both the GUI and CLI modes

(see http://linux.techteam.gr/docs/mandri...diskdrake.html)

In the CLI mode, you can move between icons with the Tab key. To select a menu item, use the arrow keys highlight it, then hit Tab until the Ok button is highlighted, and hit Enter.

To try and recover a lost partition table, try the following steps:

* Select the empty space entry.
* Select More.
* Highlight *Rescue partition table* and hit Enter.
* Cross your fingers and hope for the best.

I didn't have much luck with the Rescue partition table option in my tests, but you may have better luck. The other two options in the *More* menu work better. You can Save partition table to a file, and Restore partition table from a file. You might want to save the partition table to a floppy as a backup, in case something destroys it, or before trying to change things, so you can go back to your starting point.

One thing I do not like about diskdrake is that it is not consistant about how you navigate through the menus. For selecting things like the disk partition to work on, you highlight the entry, and then Tab to Ok, but in the More menu, you highlight the menu entry, and hit Enter. If you Tab to Ok first, you exit the menu. [end quote]

Try this before you try data recovery tools. All the best, Glenn

varun_saa 07-20-2007 02:50 AM

Thanks All,

MCC - rescue partition, did not
work. Though it should have.

But Test Disk worked perfectly.
I downloaded testdisk rpm installed
it and ran. And it restored completely
my partition. And I had all my data
back and safe.

So cool.

Phew ! I had my home dir will all mails
in sdb1.

That was a very narrow shave.

Thanks ALL again for teaching me a few
vital tips.

Varun

slimm609 07-20-2007 04:34 AM

testdisk will recover almost everything.


that is one of my must have utils.

GlennsPref 07-20-2007 07:22 PM

Thank you! I'm downloading testdisk too. To be sure, to be sure.

Regards, Glenn

verdverm 05-23-2008 05:27 PM

can I send testdisk money?
 
Praise the lord for testdisk!!!
Don't know how it works but it did

I hit too many keys during a Fedora 9 install and it went straight to default partition layout and started formatting my entire hard drive.
In a moment of panic I hard booted and lost my Logical Volume information with the partition table.

Tried fdisk, parted, gpart...

and to the rescue was testdisk

highly recommended


All times are GMT -5. The time now is 04:48 AM.