On 01/09/2010 09:35 PM, Richard Atcheson wrote:
On Saturday 09 January 2010 10:01:31 Per Jessen wrote:
Sorry, no - I've never really had enough reason to take a closer look autoyast. (I just tar up a master system, and untar to whatever new boxes I need to install).
David,, have you considered using the program Spinrite by Gibson? It can nondescructively check and recover and also fix and recover data. One guru buddy swears by it. I've used it a couple of times and it seems to be worth the small cost, wheather you like Gibson or not.here's a URL if you want to look further: www.grc.com/intro.htm
Thanks for all your help. I was able to recover 100% of the information from the dying drive on my laptop and I thought I would drop a note about how it went in case anyone else is faced with something in the future -- or in case I lose my notes ;-)
One evening while in 11.0 and kde3, I lost all access to my hard disk. Kde was still running fine, but there was absolutely no access to the drive. A hard shutdown was required because the executables for shutdown, halt, reboot, etc.. "Could not be found"
Prior to the failure, the drive had had a few pending sector errors for the better part of a year. It finally quit. My initial approach to resurrecting the driver was the normal fsck it, create or update the bad blocks table with fsck -c -y and hope for the best.
The existing drive was a 320G seagate that was dual-boot XP and 11.0. I did a quick check and found newegg had 640G WD Scorpio laptop drives for $90 bucks so I grabbed one.
My goal was to avoid the reinstallation and reconfiguration of anything and just move the partitions to the new drive and then install the bootloader and be done. It takes a lot of time presently to load windows, load linux, configure your desktops, load the apps, load your virtual machines and incorporate all the tweaks that make the box yours.
As mentioned in the early responses to my post, the drive seemed to work better when it was cool as opposed to warm (in the laptop) so I decided to move the files and partitions with the bad drive just hanging out attached normal power and sata cables.
To perform the partition move, I opened a desktop case that had a two sata ports available and I disconnected the existing desktop drive and then just attached the power and sata cables to the old and new drives and, as mentioned, left them just hanging out the side of the case.
I downloaded gparted-live 0.4.6 and booted from the gparted disk. Then I just copy and pasted the partitions from old to new and applied the changes.
Note : for some reason, it worked better when I would copy a partition and 'Apply' the changes for the partitions one-at-a-time before setting up the next partition to copy. The two times I tried scheduling multiple partitions to be copied, gparted would fail and I would have to start over.
Note : again, for reasons unknown, copying XP partitions failed. There were no write errors, but for some reason, there were problems with the partition size created on the new disk not being big enough to hold the XP partition that was being copied to it. (I think the issues was probably due to the XP partition not ending on a cylinder boundary... or whatever the fdisk message to that effect was). The work around was to simply add 2k to the partition size for the XP partition in gparted. Then gparted was happy to copy and expand the problem partition by 2k.
With that workaround, gparted was able to copy the 1.5G windows recovery partition, the 80G windows partition, and the 2G swap, but then failed copying the 29G / partition due to the actual uncorrectable sectors problem. Here is where dd_rescue IS your friend. Since I wanted the disk laid out as:
sda1 - win recovery sda2 - XP sda3 - extended sda5 - swap sda6 - / sda7 - /home
I needed to have the / partition copied next. (it probably doesn't matter, but I want my large /home partition at the end of the disk, just in case I need to shrink it later). Since sda3 was already created on the new drive, the answer was to use ddrescue to create the new partition by executing 'ddrescue /dev/sdb6 /dev/sda'. Since gparted includes rescue features with ddrescue, I was able to perform this operation within gparted. ddrescue takes a while to run. It copies just like dd until it hits the problem on your disk, then slows and copies intently around the problem area, completes copying the remainder of the disk and then returns to refine data recovery around any of the original problems found and then prunes any cylinders containing errors. Facinating to watch -- just like watching the grass grow :p
(Note: ddrescue will give you the precise location on the disk of where you error occurred. I don't think it is logged anywhere when running from the live CD, so you may want to jot down the range of cylinders or inodes listed with errors just in case you need to go back and perform additional forensics to determine what was located there to begin with.
With sda6 on the disk, it was a simple (but slow) matter to use gparted to copy sda7 over to the new disk and expand the partition size to fill the remainer or the new disk.
With all partitions recovered, the only remaining task was to install the boot loader on the new disk. There are basically two options (1) use dd to copy the bootloader from the old to new disk, or (2) use the install dvd to boot and then chroot the system and install the boot loader manually. For option 1, you only want to copy 446 bytes of the MBR to avoid copying the old partition table to the new disk:
dd if=/dev/sda of=/dev/sdb bs=446 count=1
Not being too familiar with copying in/out of the mbr/partition table/signature, I just used the old standby. I booted with the 11.2 install dvd, chrooted the system under /mnt, used grub, typed 'find /boot/grub/stage1', set the root with the results and then setup the disk, quit grub, exited the chroot, and rebooted with fingers crossed.
No need for the finger crossing, it all worked perfectly.
I don't think I'll ever have to reinstall again. With zypper dub, and the ability to move partitions to new drives, changing hardware will be a snap.
Pick out the good parts of the post and save them somewhere. It will save you a whole lot of time googling when you are faced with a similar challenge :p