Data Rescue Links & Comments & Tips
-- Simple, basic methods anyone can use for many basic problems:
TestDisk -- PhotoRec -- Knoppix (or other Live CDs)
=>=> Update: More DETAILS on using PhotoRec: See Reply #5 below
Focus of this brief guide ...
is to point you in the direction of TestDisk & Photorec & Knoppix
for restoring lost partitions, lost/damaged MBR, or deleted files
Links: See References here at the end
=>=> Update: More DETAILS on using PhotoRec: See Reply #5 below.
Another way to install/use PhotoRec/TestDisk: into a personal directory
=>=> Reply #6: sidux Live Persistent Flash Drive
-- an excellent medium for conducting rescue/repair work
-- the post also serves a sa guide to preparing/using bootable flash drives
-- many useful topics that apply to Kubuntu live flash drives
- - - - -
OVERVIEW
Use TestDisk to recover deleted partitions, deleted partition tables, or deleted MBRs.
Use PhotoRec to recover lost/deleted files, even after reformatting the partition.
=>=> Update: More DETAILS on using PhotoRec: See Reply #5 below
Use Knoppix live CD to rescue data from a bad disk drive.
My personal experience
Tips
TECHNICAL Notes
REFERENCES
- - - - - - - - - - - - - - -
----- TestDisk (newer versions also include PhotoRec)
--- My experience with TestDisk was great: fixing deleted partitions; deleted MBR.
-- I deleted a data partition (using GParted, then re-boot); TestDisk found it and restored it to the partition table (in its original position as a Logical partition sdc5 on an external USB HDD among nine partitions sdc1-sdc9).
-- I (twice) deleted my partition table for the hard drive (which contained Kubuntu 7.10, swap, home, and 6 other partitions, including Extended). TestDisk correctly restored the partition table to the Master Boot Record. Upon re-booting, TestDisk correctly detected an installation of GRUB to the * boot sector * of the Kubuntu partition and booted into Kubuntu with no problems.
-- I messed up the partition table terribly; then used TestDisk to Analyze, then Search deeper, then put it back together right.
-- I ran other basic tests, experimenting with the menus.
--- Getting started with TestDisk
The TestDisk documentation is good and I can not improve upon it; and you should read all of it as there are various, useful facts to be aware of. Having said that, in my opinion, for many cases, I think you could skip the reading, jump right in, start TestDisk, and use it successfully to fix your problem. But I don't recommend it.
--- Installing & starting TestDisk (newer versions include PhotoRec)
-- To run testdisk, open Konsole and type sudo testdisk , then press Enter.
=> You must use sudo so TestDisk gives you a full and accurate listing of your drives.
TestDisk is included with many Live CDs; for the list see “TestDisk Live cd” on the site. In particular, it is on GParted, Knoppix, and System Rescue CD. However, a live CD may not have a current version, as I noticed with Knoppix. That may not, though, be a limitation.
I tested TestDisk from the following installations:
> On Knoppix
> Installed to Kubuntu 7.10 on a hard drive in the PC
> Installed to a Live persistent Kubuntu flash drive
> Installed during a live Kubuntu CD session (and so installed to ramdisk in RAM and therefore not permanent--after ending the live CD session, TestDisk is gone, along with the live Kubuntu).
Tips:
-- To install: Use K > System > Adept Manager, enter testdisk in the Adept window, click the “>” sign, Request Install, Apply. (Applies to installation on: hard disk, flash drive, or in a live Kubuntu CD session.) (If you have problems starting Adept, close it, then at Konsole run sudo dpkg --configure -a and sudo apt-get -f install; then open Adept Manager again.)
-- On GParted's main window, right-click, then select testdisk.
-- On Knoppix, open Konsole and run sudo testdisk. (See more Knoppix tips below.)
--- If a deleted partition is not found yet, but the Structure says OK, you can press Enter to tentatively accept an intermediate or partial result, then Search deeper, then, hopefully, the lost partition is found and you are able to Write a final partition table. Along the way, in the menus, you can list the partition contents, change the partition type, indicate Add or Delete partition, and other choices. You back out of a menu screen by pressing q (or selecting Quit). And you do not have to make any permanent changes to the MBR partition table unless you select Enter then Write.
--- AFTER running TestDisk: check fstab, filesystems, and GRUB
=> However, you MAY not have to do any of this!!!
fstab: If you changed the partitions or their order, you must edit /etc/fstab (in your affected Kubuntu), using the correct UUIDs for each partition. To get UUIDs:
From Live CD and HDD: ls /dev/disk/by-uuid/ -alh
From HDD: blkid
filesystem: If you have to repair Kubuntu filesystems, see this reference for complete tips on doing this using fsck:
http://users.bigpond.net.au/hermanzone/p10.htm
GRUB
If you used TestDisk to repair the partition table or Master Boot Record (MBR), when you re-boot, TestDisk will try to help you boot into your Kubuntu OS. IF GRUB had been installed * to the boot sector * of your Kubuntu partition, TestDisk will find it and boot you into Kubuntu. If not, then TestDisk, upon re-boot, presents you with this: 1234F. Type 1 and TestDisk will try the first partition boot sector; 2 for the second partition boot sector; etc.; F for floppy boot. If you can't boot into Kubuntu, you must use Super Grub Disk or GRUB methods to re-install GRUB to the MBR of the correct boot drive. See References.
> TECHNICAL NOTE: Installing GRUB everywhere!
This is one of many reasons I always install GRUB everywhere: to the main MBR, to other MBRs as appropriate, and to Kubuntu boot sector(s). Doing so often comes in handy.
-- Example Suppose Kubuntu is on sdb1 = (hd1,0), and your PC boots from the MBR on sda = (hd0). Then, from Konsole in Kubuntu or from live CD, you may install GRUB to the sdb MBR, to the sdb1 boot sector, and to the sda MBR as follows (do the sda MBR AFTER doing the sdb MBR!):
sudo grub
grub> root (hd1,0)
grub> setup (hd1,0)
grub> setup (hd1)
grub> setup (hd0)
grub> quit
$exit
--- More Technical Notes: -- See this section at the end --
- - - - - - - - - - - - - - -
----- PhotoRec (PhotoRec is included with recent versions of TestDisk)
=>=> Update: More DETAILS on using PhotoRec: See Reply #5 below.
--- To start PhotoRec, open K > System > Konsole, and type:
sudo photorec
My experience:
On both hard drive and flash drives, PhotoRec successfully recovered various types of files that I had deleted recently: .doc, .jpg, .wmv, .mpg, .pdf, .odt, .txt, and others. In all but one case, the recovered wmv/mpg movie file played without damage. It worked even after I loaded a partition with files, deleted those files, and reformatted the partition using GParted and re-booted. In a few cases, it failed to return all my lost files but always got most of them in good condition.
PhotoRec recovers files with 180+ file extensions from FAT, NTFS, EXT2/EXT3 filesystem, HFS+. It will do so even if the partition has been reformatted.
Tips:
> STOP! As soon as you notice that files are missing or accidentally deleted, STOP working in that Kubuntu partition; do not cause any more writes/saves to be made there. Boot into another partition or into a Live CD and run PhotoRec against the partition containing the lost files.
> After running PhotoRec, if you don't see all your files, run it again, perhaps restricting the search to just one or two file extension types.
> After running PhotoRec, you will have to sort out the results! It names the files it finds differently from how you named them; e.g., PhotoRec may return names like 2ebn45fg.jpg. It may return duplicates. It may return files that are NOT lost or deleted. You must sort this out! See the site for tips & references. You can do it manually if you don't mind the work, and if there are not too many files.
- - - - - - - - - - - - - - -
----- Knoppix Live CD (and other live CDs)
--- Use: To recover your data from hard drives and flash drives
Knoppix contains TestDisk, PhotoRec, GParted, dd command, dd_rescue, and a thousand+ other programs. You can use Knoppix to copy data off a hard drive and onto another drive or flash drive. You can use Knoppix to go into another drive/partition and fix GRUB, fstab, and other things.
--- List of applications included on the Knoppix Live CD:
On the introductory page (of the Live CD), click “Overview of installed packages”
You can save the list to the Desktop or to a flash drive.
--- Root Password: There isn't any. However, if you are asked for such (as I was when opening Adept Manager), then make one up yourself: Knoppix Menu -> Configure -> Set password for root.
--- Disk drives and flash drives are shown as icons on the Knoppix Desktop. They are mounted as RO (Read Only). By right-clicking on an icon you can Mount and you can Actions > Change read/write mode; thus, you can copy data off one drive and onto another drive or a flash drive.
--- Knoppix may contain older versions of programs, e.g., TestDisk. For Knoppix 5.1, to run testdisk at Konsole, you must first run the following command to fix a symlink:
ln -s libntfs.so.10 /usr/lib/libntfs.so.9
==>> You can use your Kubuntu Live CD to conduct rescue operations just as one would use Knoppix!
==>> You can use a Live persistent Kubuntu flash drive to do the same.
= = = = = = = = = =
TECHNICAL SECTION
----- BE PREPARED for recovery
In the best of all possible worlds, you should prepare for recovery BEFORE the need arises, and this brief guide points you in the right direction.
==> At the very least, have a live Kubuntu CD handy, perhaps have a recent copy of Knoppix handy, and make a note of some useful links (like this guide and the TestDisk & Knoppix sites).
==> Backup your bookmarks so you'll have them in any operating system you are using:
You should bookmark useful sites for emergencies, then save a current copy of your bookmarks to a flash drive.
-- How-to copy bookmarks in Firefox and then use them in any Firefox:
Open your /home/your_name folder in Konqueror or Dolphin; View > Show hidden files; click the hidden folder .mozilla; then click firefox; your profile folder is named with a string of 8 random characters followed by .default extension, like XXXXXXXX.default; click on it; look for bookmarks.html and copy that file off to a flash drive.
> RESTORE as follows: In any Firefox browser you are using, click Bookmarks | Organize Bookmarks, then File > Import > Import from File, then select the file (by clicking to navigate to the flash drive as a Storage media), and finally select Open. You can make restore easier by first copying the bookmark file off the flash drive and onto the Desktop.
----- COMMANDS to have handy when messing with your disk drives & MBRs
-- Save a link to useful commands (or copy/print a command guide). See References for my How-To: Commands at Konsole: Beginners. Note especially commands for mounting a flash drive, a hard drive, and commands to change ownership and permissions (chown; chmod), especially for flash drives.
-- To list your hard drives and partitions:
sudo fdsik -lu
df -h -T
-- Backup your MBR
To copy the MBR on sdc to a file called mbr.backup (in your current working directory):
sudo dd if=/dev/sdc of=mbr.backup bs=512 count=1
To restore:
sudo dd if=mbr.backup of=/dev/sdc bs=512 count=1
> You should have a copy of the MBR saved where it will be useful in an emergency; e.g., save it to a flash drive.
-- To see the MBR on your screen:
sudo dd if=/dev/sdc bs=512 count=1 | hexdump -C
NOTE about your MBR contents:
The first 446 bytes are the IPL (initial program loader code; e.g., GRUB or LILO);
The next 64 bytes are four 16-byte partitions and comprise the “partition table”;
The final 2 bytes comprise the endfile signature 55 aa.
-- For experimenting: Writing zeros to the MBR
To write zeros to the MBR on drive sdc:
sudo dd if=/dev/zero of=/dev/sdc bs=512 count=1
To write zeros only to the partition table of the MBR on drive sdc:
sudo dd if=/dev/zero of=/dev/sdc bs=1 count=64 seek=446
=> An excellent way to get GRUB Error 5: Partition table invalid or corrupt!
To write zeros only to the partition table and the 2-byte endfile of the MBR on drive sdc:
sudo dd if=/dev/zero of=/dev/sdc bs=1 count=66 seek=446
To write zeros only to the IPL (eg GRUB) of the MBR on drive sdc:
sudo dd if=/dev/zero of=/dev/sdc bs=1 count=446
----- TECHNICAL NOTE: Deciding What Type of Rescue to Conduct: Decision Tree
Where to go from where you are:
How TestDisk, PhotoRec, and Knoppix (or live CDs) fit into the picture
1 If there is no physical damage to the drive (and you can access the drive), go to 2.
=> If there is a physical problem, then you'll have to chase it down:
“Bad sectors” is classified as a physical problem (and you can determine such by running a drive diagnostic utility; e.g., Seagate's SeaTools CD).
=> If the drive is damaged and will not operate, you must contact a special data recovery lab and hope they can help.
=> If the drive will not operate, check the easy stuff first: are the cables connected well (power cable from the power supply to the drive? data cable from the motherboard to the drive?); if so, can you change the cables for new cables and try it? if it is a defective motherboard, can you remove the drive to a functioning system and try it there?
=> If you manage to get the drive running, then you must immediately copy your data off the bad drive onto a good drive, and then attempt to rescue your data from the good-drive copy using the methods of 2 below. (You will have to read the TestDisk docs carefully for dealing with an image file.)
-- Make an image of the bad drive: Two free Linux methods anyone can use to copy the bad drive's contents off to a good drive are the dd command and its DoD version, dcfldd (and the Helix Live CD that includes dcfldd). In both cases, run the dd command using the conv=noerror option so the command will continue to copy data even if it runs into errors.
2 What's the problem? Three possibilities:
> If the partition table is damaged or deleted, or if you've deleted partition(s), then use TestDisk.
(If the MBR is damaged, you may have to also re-install the bootloader's IPL.) Then you may have to edit/fix /etc/fstab and/or GRUB.
> If you've deleted some data files, use PhotoRec.
> To simply rescue data off a hard drive, use Knoppix (or another live CD).
= = = = = = = = = =
REFERENCES
TestDisk
http://www.cgsecurity.org/wiki/TestDisk
PhotoRec
http://www.cgsecurity.org/wiki/PhotoRec
Knoppix download:
http://www.knopper.net/knoppix/index-en.html
Knoppix info:
http://www.knopper.net/knoppix-info/index-en.html
Knoppix as a rescue CD
http://www.knoppix.net/wiki/Rescue_FAQ
Filesystem checking and repair:
http://users.bigpond.net.au/hermanzone/p10.htm
UFD persistent Live K710
Build a LIVE Kubuntu Flash Drive, How-To
http://kubuntuforums.net/forums/inde...089474.new#new
-- with Persistence: Reply #7
Commands at Konsole: Beginners
http://kubuntuforums.net/forums/inde...opic=3091607.0
(Especially for mounting drives and changing ownershoip & permissions using chown & chmod)
dd Command
http://kubuntuforums.net/forums/inde...opic=3090824.0
(Links for Helix Live CD and dcfldd command are there)
How To GRUB Methods - Toolkit
http://kubuntuforums.net/forums/inde...opic=3081671.0
(Re-install/fix GRUB)
Super Grub Disk, new site: http://supergrub.forjamari.linex.org/
GParted: http://gparted.sourceforge.net/
*****
=> IMPORTANT:
For more complicated cases, or quirky BIOSes/systems, you may need the following reference. The TestDisk site also includes some tips for dealing with different geometries.
Starman's work; start here and follow his many excellent links--
MUST reading for setting geometry parameters for older/nonstandard hard drives/BIOS, CHS settings, LBA mappings, hard drives, MBRs:
http://www.geocities.com/thestarman3...taRecovery.htm
and especially his MBR main index (to disks, partitions, booting, MBRs and all related subjects) @
http://www.geocities.com/thestarman3/asm/mbr/index.html
>>> EDITED to include more details: 2-27-07, 2-28-08
-- Simple, basic methods anyone can use for many basic problems:
TestDisk -- PhotoRec -- Knoppix (or other Live CDs)
=>=> Update: More DETAILS on using PhotoRec: See Reply #5 below
Focus of this brief guide ...
is to point you in the direction of TestDisk & Photorec & Knoppix
for restoring lost partitions, lost/damaged MBR, or deleted files
Links: See References here at the end
=>=> Update: More DETAILS on using PhotoRec: See Reply #5 below.
Another way to install/use PhotoRec/TestDisk: into a personal directory
=>=> Reply #6: sidux Live Persistent Flash Drive
-- an excellent medium for conducting rescue/repair work
-- the post also serves a sa guide to preparing/using bootable flash drives
-- many useful topics that apply to Kubuntu live flash drives
- - - - -
OVERVIEW
Use TestDisk to recover deleted partitions, deleted partition tables, or deleted MBRs.
Use PhotoRec to recover lost/deleted files, even after reformatting the partition.
=>=> Update: More DETAILS on using PhotoRec: See Reply #5 below
Use Knoppix live CD to rescue data from a bad disk drive.
My personal experience
Tips
TECHNICAL Notes
REFERENCES
- - - - - - - - - - - - - - -
----- TestDisk (newer versions also include PhotoRec)
--- My experience with TestDisk was great: fixing deleted partitions; deleted MBR.
-- I deleted a data partition (using GParted, then re-boot); TestDisk found it and restored it to the partition table (in its original position as a Logical partition sdc5 on an external USB HDD among nine partitions sdc1-sdc9).
-- I (twice) deleted my partition table for the hard drive (which contained Kubuntu 7.10, swap, home, and 6 other partitions, including Extended). TestDisk correctly restored the partition table to the Master Boot Record. Upon re-booting, TestDisk correctly detected an installation of GRUB to the * boot sector * of the Kubuntu partition and booted into Kubuntu with no problems.
-- I messed up the partition table terribly; then used TestDisk to Analyze, then Search deeper, then put it back together right.
-- I ran other basic tests, experimenting with the menus.
--- Getting started with TestDisk
The TestDisk documentation is good and I can not improve upon it; and you should read all of it as there are various, useful facts to be aware of. Having said that, in my opinion, for many cases, I think you could skip the reading, jump right in, start TestDisk, and use it successfully to fix your problem. But I don't recommend it.
--- Installing & starting TestDisk (newer versions include PhotoRec)
-- To run testdisk, open Konsole and type sudo testdisk , then press Enter.
=> You must use sudo so TestDisk gives you a full and accurate listing of your drives.
TestDisk is included with many Live CDs; for the list see “TestDisk Live cd” on the site. In particular, it is on GParted, Knoppix, and System Rescue CD. However, a live CD may not have a current version, as I noticed with Knoppix. That may not, though, be a limitation.
I tested TestDisk from the following installations:
> On Knoppix
> Installed to Kubuntu 7.10 on a hard drive in the PC
> Installed to a Live persistent Kubuntu flash drive
> Installed during a live Kubuntu CD session (and so installed to ramdisk in RAM and therefore not permanent--after ending the live CD session, TestDisk is gone, along with the live Kubuntu).
Tips:
-- To install: Use K > System > Adept Manager, enter testdisk in the Adept window, click the “>” sign, Request Install, Apply. (Applies to installation on: hard disk, flash drive, or in a live Kubuntu CD session.) (If you have problems starting Adept, close it, then at Konsole run sudo dpkg --configure -a and sudo apt-get -f install; then open Adept Manager again.)
-- On GParted's main window, right-click, then select testdisk.
-- On Knoppix, open Konsole and run sudo testdisk. (See more Knoppix tips below.)
--- If a deleted partition is not found yet, but the Structure says OK, you can press Enter to tentatively accept an intermediate or partial result, then Search deeper, then, hopefully, the lost partition is found and you are able to Write a final partition table. Along the way, in the menus, you can list the partition contents, change the partition type, indicate Add or Delete partition, and other choices. You back out of a menu screen by pressing q (or selecting Quit). And you do not have to make any permanent changes to the MBR partition table unless you select Enter then Write.
--- AFTER running TestDisk: check fstab, filesystems, and GRUB
=> However, you MAY not have to do any of this!!!
fstab: If you changed the partitions or their order, you must edit /etc/fstab (in your affected Kubuntu), using the correct UUIDs for each partition. To get UUIDs:
From Live CD and HDD: ls /dev/disk/by-uuid/ -alh
From HDD: blkid
filesystem: If you have to repair Kubuntu filesystems, see this reference for complete tips on doing this using fsck:
http://users.bigpond.net.au/hermanzone/p10.htm
GRUB
If you used TestDisk to repair the partition table or Master Boot Record (MBR), when you re-boot, TestDisk will try to help you boot into your Kubuntu OS. IF GRUB had been installed * to the boot sector * of your Kubuntu partition, TestDisk will find it and boot you into Kubuntu. If not, then TestDisk, upon re-boot, presents you with this: 1234F. Type 1 and TestDisk will try the first partition boot sector; 2 for the second partition boot sector; etc.; F for floppy boot. If you can't boot into Kubuntu, you must use Super Grub Disk or GRUB methods to re-install GRUB to the MBR of the correct boot drive. See References.
> TECHNICAL NOTE: Installing GRUB everywhere!
This is one of many reasons I always install GRUB everywhere: to the main MBR, to other MBRs as appropriate, and to Kubuntu boot sector(s). Doing so often comes in handy.
-- Example Suppose Kubuntu is on sdb1 = (hd1,0), and your PC boots from the MBR on sda = (hd0). Then, from Konsole in Kubuntu or from live CD, you may install GRUB to the sdb MBR, to the sdb1 boot sector, and to the sda MBR as follows (do the sda MBR AFTER doing the sdb MBR!):
sudo grub
grub> root (hd1,0)
grub> setup (hd1,0)
grub> setup (hd1)
grub> setup (hd0)
grub> quit
$exit
--- More Technical Notes: -- See this section at the end --
- - - - - - - - - - - - - - -
----- PhotoRec (PhotoRec is included with recent versions of TestDisk)
=>=> Update: More DETAILS on using PhotoRec: See Reply #5 below.
--- To start PhotoRec, open K > System > Konsole, and type:
sudo photorec
My experience:
On both hard drive and flash drives, PhotoRec successfully recovered various types of files that I had deleted recently: .doc, .jpg, .wmv, .mpg, .pdf, .odt, .txt, and others. In all but one case, the recovered wmv/mpg movie file played without damage. It worked even after I loaded a partition with files, deleted those files, and reformatted the partition using GParted and re-booted. In a few cases, it failed to return all my lost files but always got most of them in good condition.
PhotoRec recovers files with 180+ file extensions from FAT, NTFS, EXT2/EXT3 filesystem, HFS+. It will do so even if the partition has been reformatted.
Tips:
> STOP! As soon as you notice that files are missing or accidentally deleted, STOP working in that Kubuntu partition; do not cause any more writes/saves to be made there. Boot into another partition or into a Live CD and run PhotoRec against the partition containing the lost files.
> After running PhotoRec, if you don't see all your files, run it again, perhaps restricting the search to just one or two file extension types.
> After running PhotoRec, you will have to sort out the results! It names the files it finds differently from how you named them; e.g., PhotoRec may return names like 2ebn45fg.jpg. It may return duplicates. It may return files that are NOT lost or deleted. You must sort this out! See the site for tips & references. You can do it manually if you don't mind the work, and if there are not too many files.
- - - - - - - - - - - - - - -
----- Knoppix Live CD (and other live CDs)
--- Use: To recover your data from hard drives and flash drives
Knoppix contains TestDisk, PhotoRec, GParted, dd command, dd_rescue, and a thousand+ other programs. You can use Knoppix to copy data off a hard drive and onto another drive or flash drive. You can use Knoppix to go into another drive/partition and fix GRUB, fstab, and other things.
--- List of applications included on the Knoppix Live CD:
On the introductory page (of the Live CD), click “Overview of installed packages”
You can save the list to the Desktop or to a flash drive.
--- Root Password: There isn't any. However, if you are asked for such (as I was when opening Adept Manager), then make one up yourself: Knoppix Menu -> Configure -> Set password for root.
--- Disk drives and flash drives are shown as icons on the Knoppix Desktop. They are mounted as RO (Read Only). By right-clicking on an icon you can Mount and you can Actions > Change read/write mode; thus, you can copy data off one drive and onto another drive or a flash drive.
--- Knoppix may contain older versions of programs, e.g., TestDisk. For Knoppix 5.1, to run testdisk at Konsole, you must first run the following command to fix a symlink:
ln -s libntfs.so.10 /usr/lib/libntfs.so.9
==>> You can use your Kubuntu Live CD to conduct rescue operations just as one would use Knoppix!
==>> You can use a Live persistent Kubuntu flash drive to do the same.
= = = = = = = = = =
TECHNICAL SECTION
----- BE PREPARED for recovery
In the best of all possible worlds, you should prepare for recovery BEFORE the need arises, and this brief guide points you in the right direction.
==> At the very least, have a live Kubuntu CD handy, perhaps have a recent copy of Knoppix handy, and make a note of some useful links (like this guide and the TestDisk & Knoppix sites).
==> Backup your bookmarks so you'll have them in any operating system you are using:
You should bookmark useful sites for emergencies, then save a current copy of your bookmarks to a flash drive.
-- How-to copy bookmarks in Firefox and then use them in any Firefox:
Open your /home/your_name folder in Konqueror or Dolphin; View > Show hidden files; click the hidden folder .mozilla; then click firefox; your profile folder is named with a string of 8 random characters followed by .default extension, like XXXXXXXX.default; click on it; look for bookmarks.html and copy that file off to a flash drive.
> RESTORE as follows: In any Firefox browser you are using, click Bookmarks | Organize Bookmarks, then File > Import > Import from File, then select the file (by clicking to navigate to the flash drive as a Storage media), and finally select Open. You can make restore easier by first copying the bookmark file off the flash drive and onto the Desktop.
----- COMMANDS to have handy when messing with your disk drives & MBRs
-- Save a link to useful commands (or copy/print a command guide). See References for my How-To: Commands at Konsole: Beginners. Note especially commands for mounting a flash drive, a hard drive, and commands to change ownership and permissions (chown; chmod), especially for flash drives.
-- To list your hard drives and partitions:
sudo fdsik -lu
df -h -T
-- Backup your MBR
To copy the MBR on sdc to a file called mbr.backup (in your current working directory):
sudo dd if=/dev/sdc of=mbr.backup bs=512 count=1
To restore:
sudo dd if=mbr.backup of=/dev/sdc bs=512 count=1
> You should have a copy of the MBR saved where it will be useful in an emergency; e.g., save it to a flash drive.
-- To see the MBR on your screen:
sudo dd if=/dev/sdc bs=512 count=1 | hexdump -C
NOTE about your MBR contents:
The first 446 bytes are the IPL (initial program loader code; e.g., GRUB or LILO);
The next 64 bytes are four 16-byte partitions and comprise the “partition table”;
The final 2 bytes comprise the endfile signature 55 aa.
-- For experimenting: Writing zeros to the MBR
To write zeros to the MBR on drive sdc:
sudo dd if=/dev/zero of=/dev/sdc bs=512 count=1
To write zeros only to the partition table of the MBR on drive sdc:
sudo dd if=/dev/zero of=/dev/sdc bs=1 count=64 seek=446
=> An excellent way to get GRUB Error 5: Partition table invalid or corrupt!
To write zeros only to the partition table and the 2-byte endfile of the MBR on drive sdc:
sudo dd if=/dev/zero of=/dev/sdc bs=1 count=66 seek=446
To write zeros only to the IPL (eg GRUB) of the MBR on drive sdc:
sudo dd if=/dev/zero of=/dev/sdc bs=1 count=446
----- TECHNICAL NOTE: Deciding What Type of Rescue to Conduct: Decision Tree
Where to go from where you are:
How TestDisk, PhotoRec, and Knoppix (or live CDs) fit into the picture
1 If there is no physical damage to the drive (and you can access the drive), go to 2.
=> If there is a physical problem, then you'll have to chase it down:
“Bad sectors” is classified as a physical problem (and you can determine such by running a drive diagnostic utility; e.g., Seagate's SeaTools CD).
=> If the drive is damaged and will not operate, you must contact a special data recovery lab and hope they can help.
=> If the drive will not operate, check the easy stuff first: are the cables connected well (power cable from the power supply to the drive? data cable from the motherboard to the drive?); if so, can you change the cables for new cables and try it? if it is a defective motherboard, can you remove the drive to a functioning system and try it there?
=> If you manage to get the drive running, then you must immediately copy your data off the bad drive onto a good drive, and then attempt to rescue your data from the good-drive copy using the methods of 2 below. (You will have to read the TestDisk docs carefully for dealing with an image file.)
-- Make an image of the bad drive: Two free Linux methods anyone can use to copy the bad drive's contents off to a good drive are the dd command and its DoD version, dcfldd (and the Helix Live CD that includes dcfldd). In both cases, run the dd command using the conv=noerror option so the command will continue to copy data even if it runs into errors.
2 What's the problem? Three possibilities:
> If the partition table is damaged or deleted, or if you've deleted partition(s), then use TestDisk.
(If the MBR is damaged, you may have to also re-install the bootloader's IPL.) Then you may have to edit/fix /etc/fstab and/or GRUB.
> If you've deleted some data files, use PhotoRec.
> To simply rescue data off a hard drive, use Knoppix (or another live CD).
= = = = = = = = = =
REFERENCES
TestDisk
http://www.cgsecurity.org/wiki/TestDisk
PhotoRec
http://www.cgsecurity.org/wiki/PhotoRec
Knoppix download:
http://www.knopper.net/knoppix/index-en.html
Knoppix info:
http://www.knopper.net/knoppix-info/index-en.html
Knoppix as a rescue CD
http://www.knoppix.net/wiki/Rescue_FAQ
Filesystem checking and repair:
http://users.bigpond.net.au/hermanzone/p10.htm
UFD persistent Live K710
Build a LIVE Kubuntu Flash Drive, How-To
http://kubuntuforums.net/forums/inde...089474.new#new
-- with Persistence: Reply #7
Commands at Konsole: Beginners
http://kubuntuforums.net/forums/inde...opic=3091607.0
(Especially for mounting drives and changing ownershoip & permissions using chown & chmod)
dd Command
http://kubuntuforums.net/forums/inde...opic=3090824.0
(Links for Helix Live CD and dcfldd command are there)
How To GRUB Methods - Toolkit
http://kubuntuforums.net/forums/inde...opic=3081671.0
(Re-install/fix GRUB)
Super Grub Disk, new site: http://supergrub.forjamari.linex.org/
GParted: http://gparted.sourceforge.net/
*****
=> IMPORTANT:
For more complicated cases, or quirky BIOSes/systems, you may need the following reference. The TestDisk site also includes some tips for dealing with different geometries.
Starman's work; start here and follow his many excellent links--
MUST reading for setting geometry parameters for older/nonstandard hard drives/BIOS, CHS settings, LBA mappings, hard drives, MBRs:
http://www.geocities.com/thestarman3...taRecovery.htm
and especially his MBR main index (to disks, partitions, booting, MBRs and all related subjects) @
http://www.geocities.com/thestarman3/asm/mbr/index.html
>>> EDITED to include more details: 2-27-07, 2-28-08
Comment