Linux System Repair Best Practices
Posted: 08 Nov 2016, 18:11
First of all, thank you for this awesome utility - TestDisk. I will make a contribution. I've read TestDisk step-by-step and I'm very grateful for the documentation provided and the support of this forum. Here's my story.
I planned to use a mythbuntu live disk to install mythbuntu onto a HDD using a DVD in my laptop's (Dell Vostro 1520) DVD drive via a USB dock attached to my laptop. Before I knew what happened I apparently corrupted the laptop's GRUB and/or boot sector. The OS on my laptop is AVLinux, an audo-optimized Debian system. I think it is the "6" version, a 32-bit system.
Before working with TestDisk I dd'd the problem ("Source") disk (340GB) to a USB-connected ("Rescue") disk (2TB). Should I first try to get the Rescue disk to boot rather than the Source disk? How do I reinstall/repair GRUB on a USB-connected HDD? I suppose launch the LiveCD from the laptop's DVD drive, but then how do I make sure the attempted repair is done to the USB-attached drive and not to the laptop's onboard drive? I see this but it seems like my dd image might somehow "get in the way" of the replacement GRUB installation. Maybe not. Probably just overthinking the problem.
I think there were two partitions installed -- a swap and an ext4. I believe I can see both and can browse the files in the ext4. I suspect the partitions are Primary (swap) and Extended (ext4). Don't know that it matters, as I think TestDisk will "just" figure that out.
TestDisk reports the first partition is "bad" but that, I expect, is because GRUB is gone. Am I correct that its ok to write a new partition table with this first partition labeled "bad"? Should I first try to mark it "P"?
Some of the directories and files in ext4 I browse are red. I understand that means they're deleted. Can/should I do anything special to them before writing a new partition table?
I've tried to copy files to another drive. Some of the files (/boot directory) copy fine, but when I try to copy my /home directory a few files (304) copy and the rest all "fail". I now see that maybe I should "H"ide deleted files first before attempting to copy. I suppose only the copy utility within TestDisk itself (as opposed to, for example, rsync) has any chance of success in this context. Any other suggestions about what I may be doing wrong on this score would be appreciated.
I thought I had a testdisk.log to share but apparently did not get it copied. I'll try to grab it tonight and attach to this post FWIW.
I planned to use a mythbuntu live disk to install mythbuntu onto a HDD using a DVD in my laptop's (Dell Vostro 1520) DVD drive via a USB dock attached to my laptop. Before I knew what happened I apparently corrupted the laptop's GRUB and/or boot sector. The OS on my laptop is AVLinux, an audo-optimized Debian system. I think it is the "6" version, a 32-bit system.
Before working with TestDisk I dd'd the problem ("Source") disk (340GB) to a USB-connected ("Rescue") disk (2TB). Should I first try to get the Rescue disk to boot rather than the Source disk? How do I reinstall/repair GRUB on a USB-connected HDD? I suppose launch the LiveCD from the laptop's DVD drive, but then how do I make sure the attempted repair is done to the USB-attached drive and not to the laptop's onboard drive? I see this but it seems like my dd image might somehow "get in the way" of the replacement GRUB installation. Maybe not. Probably just overthinking the problem.
I think there were two partitions installed -- a swap and an ext4. I believe I can see both and can browse the files in the ext4. I suspect the partitions are Primary (swap) and Extended (ext4). Don't know that it matters, as I think TestDisk will "just" figure that out.
TestDisk reports the first partition is "bad" but that, I expect, is because GRUB is gone. Am I correct that its ok to write a new partition table with this first partition labeled "bad"? Should I first try to mark it "P"?
Some of the directories and files in ext4 I browse are red. I understand that means they're deleted. Can/should I do anything special to them before writing a new partition table?
I've tried to copy files to another drive. Some of the files (/boot directory) copy fine, but when I try to copy my /home directory a few files (304) copy and the rest all "fail". I now see that maybe I should "H"ide deleted files first before attempting to copy. I suppose only the copy utility within TestDisk itself (as opposed to, for example, rsync) has any chance of success in this context. Any other suggestions about what I may be doing wrong on this score would be appreciated.
I thought I had a testdisk.log to share but apparently did not get it copied. I'll try to grab it tonight and attach to this post FWIW.