Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was trying to read data off a friend's bad flash drive using dd_rescue (basically the same as dd). I couldn't get it to save the data to a file though, so I did the following (I'm quite embarassed):
dd_rescue /dev/sda /dev/hda
I thought it would just add an image of the flash drive to hda! Now, my comp will POST but grub will not load (I had a dual boot Debian/Windows, it just says "Strike F1 to retry boot).
What can I do to recover what I had? I'm hoping at least one of the partitions remains. I'll ask about using dd properly in another post. I presume it has something to do with a bootdisk, but I don't know what to put on the bootdisk to check what remains on the HD and get the MBR set up.
The MBR and partition table is toast, as is the beginning of the first partition. Your other partitions should be alright, but it depends on how much dd wrote to the beginning of the drive and how large the first partition was in the first place. For instance, if you had a 64 MB /boot partition followed by your root partition, and you wrote 128 MB to the drive then you would have totally wiped out partition 1 and the beginning of partition 2.
Unless you have a backup of the partition table (MBR is easy enough to replicate) you are going to have a bit of a problem.
Boot with Knoppix, run testdisk, save what can be saved. Once partition table is restored you'll find everything is intact exept the hda1. OS in first partition has to be reinstalled, unless it was some Linux distro which can be rebuilt (like Gentoo).
I got Knoppix with testdisk, but still trouble. Here is what it says when I try to mount hda:
Quote:
Could not mount device.
The reported error was:
mount: I could not determine the filesystem type, and none was specified
Here is what shows up after I run fdisk -l after creating a new MBR with testdisk:
Quote:
Disk /dev/hda: 10.2 GB, 10254827520 bytes
16 heads, 63 sectors/track, 19870 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
This doesn't look like a partition table
Probably you selected the wrong device.
Device Boot Start End Blocks Id System
/dev/hda1 ? 1903842 603791 1492257792+ 9b Unknown
Partition 1 does not end on cylinder boundary.
/dev/hda2 ? 706379 977447 136618454 70 DiskSecure Multi-Boot
Partition 2 does not end on cylinder boundary.
/dev/hda3 ? 3839253 64813 245166142+ 72 Unknown
Partition 3 does not end on cylinder boundary.
/dev/hda4 ? 231194 3091252 1441469411+ e W95 FAT16 (LBA)
Partition 4 does not end on cylinder boundary.
Partition table entries are not in disk order
The ideal situation would be that Windows remains OK and I could rebuild Debian. Even if Windows is ruined I'd really like to restore Debian - had some mysql databases on it and a configuration I liked.
Do you recognize your disk layout? Testdisk can find old obsolete partitions, too. You do not mount hda which is entire HDD, you mount hda1, hda2, so on.
Thanks for the replies. I'm doing a little bit every day on this - I have a replacement computer at work so I can use that for now. Tomorrow or Thursday I am going to try to mount the hda1/hda2/hda3/hda4 partitions. I'm hoping at least hda2 and hda4 mount based on the post I made above - I don't know when it has file system unknown for hda1/hda3. I'll also try Helix if this doesn't work out. I'd really like to be able to rebuild the Debian partition, which I think should be hda1. I'll ask more after I try what's been suggested. Thanks again.
I'm not convinced you restored correct partitions with testdisk. You should see your partitions with Windows and Linux filesystems. Only hda1 should show up "Unknown". In any case, if contents of this drive is important to you I suggest you take an image of it with dd before you change anything.
I'm not convinced you restored correct partitions with testdisk. You should see your partitions with Windows and Linux filesystems. Only hda1 should show up "Unknown". In any case, if contents of this drive is important to you I suggest you take an image of it with dd before you change anything.
I believe hda1 should be Windows, hda2 is Debian, hda3 is swap, and hda4 is the flash drive data that I copied.
I edited /etc/fstab to look like the following:
Quote:
proc /proc proc rw,nosuid,nodev,noexec 0 0
/sys /sys sysfs rw,nosuid,nodev,noexec 0 0
/dev/shm /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0
/dev/pts /dev/pts devpts mode=0622 0 0
/dev/fd0 /media/fd0 auto user,noauto,exec,umask=000 0 0
/dev/cdrom /media/cdrom auto user,noauto,exec,ro 0 0
/dev/hdc /media/hdc auto users,noauto,exec,ro 0 0
# Added by KNOPPIX
/dev/hda1 /media/hda1 auto 0 0
/dev/hda2 /media/hda2 auto 0 0
/dev/hda3 /media/hda3 auto 0 0
/dev/hda4 /media/hda4 vfat 0 0
However, when I type mount /dev/hda2 /media/hda2, I get the message:
Quote:
mount: special device /dev/hda2 does not exist
Not sure where to go from here, maybe just a newb thing with not mounting properly?
If you sent flashdrive data to hda then it cannot be on hda4. fdisk -l output does not look good. As I said before, try that teskdisk again, hda2, hda3 and hda4 should be intact.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.