[opensuse] Mayday! Disk Recovery Gurus - Need to Repair/Fix Partition Boundary - How??
Listmates, Uugh! I have a disk that is cratering and I need to get the data off it, if possible. (I just don't want to have to re-download all the suff -- mostly 11.0 rpms, but it is several Gig). The problem occurred last night during update of my 11.0 install on my laptop. I guess that the read/write head finally hit a bad spot in the disk and, for lack of better words, the disk went 'offline'. Meaning, kde was still running fine, but I was unable to access anything on the disk. I had to power-off to shutdown. (halt, reboot, shutdown commands could not be found...) I have swapped disks to my spare and I can access the failing disk over usb, but only for a minute or two. After I have mounted the partitions, if I start copying files, it will copy a few and then die. fskc starts, but then dies: 13:50 alchemy:~> fsck.ext3 -p /dev/sdb6 /dev/sdb6: recovering journal fsck.ext3: Attempt to read block from filesystem resulted in short read while trying to re-open /dev/sdb6 e2fsck: io manager magic bad! 13:51 alchemy:~> fsck.ext3 -p /dev/sdb6 fsck.ext3: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdb6 Could this be a zero-length partition? Unplugging/replugging the disk, I can get the disk info with fdisk, but I don't know how to repair the reported problem. Here is the partition information from fdisk: Device Boot Start End Blocks Id System /dev/sdb1 1 192 1536000 27 Unknown Partition 1 does not end on cylinder boundary. /dev/sdb2 192 10635 83886080 7 HPFS/NTFS /dev/sdb3 * 10636 38913 227143035 f W95 Ext'd (LBA) /dev/sdb5 10636 10897 2104483+ 82 Linux swap / Solaris /dev/sdb6 10898 13508 20972826 83 Linux /dev/sdb7 13509 38913 204065631 83 Linux Command (m for help): v Partition 1 does not end on cylinder boundary. 12403 unallocated 512-byte sectors The drive has visa on sdb2, some recovery stuff on sdb1, swap is sdb5, with / and /home as sdb6 and sdb7. I believe all the files are still there and are doing fine, but the partition table seems to be mucked up. What tools are available and how can I try to repair the partitions?? Any -- I mean Any -- help will be appreciated. Let me know if I can provide more info. Thanks. p.s. -- really hoping this isn't a rescue and dd if=/dev/sdbX of=BigDisk problem.... -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2010-01-08 at 14:32 -0600, David C. Rankin wrote: ...
Device Boot Start End Blocks Id System /dev/sdb1 1 192 1536000 27 Unknown Partition 1 does not end on cylinder boundary.
That is not neceasrily bad.
Any -- I mean Any -- help will be appreciated. Let me know if I can provide more info. Thanks.
p.s. -- really hoping this isn't a rescue and dd if=/dev/sdbX of=BigDisk problem....
Not dd, but dd_rescue. After that, use the disk manufacturer check/repair utility. Or, from Linux, smartctl. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAktHnDwACgkQtTMYHG2NR9WfSgCfY+DGN1Vxv3hHrTXNIatqe5TT Yu8An3PZLAASYTrw+m8dc2l/0QHh/rKQ =KnCh -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
The drive has visa on sdb2, some recovery stuff on sdb1, swap is sdb5, with / and /home as sdb6 and sdb7. I believe all the files are still there and are doing fine, but the partition table seems to be mucked up.
David, the partition table looks fine - have you tried running a SMART selftest on that drive? (smartctl -t short /dev/sda) /Per -- Per Jessen, Zürich (-4.2°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 01/09/2010 01:20 AM, Per Jessen wrote:
David C. Rankin wrote:
The drive has visa on sdb2, some recovery stuff on sdb1, swap is sdb5, with / and /home as sdb6 and sdb7. I believe all the files are still there and are doing fine, but the partition table seems to be mucked up.
David, the partition table looks fine - have you tried running a SMART selftest on that drive? (smartctl -t short /dev/sda)
/Per
Per, Yep, I've run a smart self test on it. It says it has had errors "In the past" but that it "passes" overall. I'll try and dig up the output from it. Right now it looks like I have been able to get everything back from the drive. I put the bad drive and it's replacement in a dell box with 2 sata connectors (I unplugged the original hd in the dell box), and booted from the gparted-live CD. I have been able to clone the system volume and vista without any issues and I've created an extended partition in the remaining 550G and I'm currently copying the / partition from the bad drive over. (I'll give it a 60/40 chance of being error free). The first time I tried the copy it failed due to multiply claimed inodes. I have run fsck.ext3 -c -y on the bad / partition and the only errors found were in 2 font files. (I ran it twice to confirm) I'll finish copying /, then copy /home, extend /home from its current 208G to whatever remains after copying the / partition over. Should be ~530G. Then finally, I'll copy the mbr to the new drive and see how it goes. Worse case, I'll just wipe / and reinstall. (with all the updated rpms in my local repository, install is just a 20 minute matter instead of a 3 hour ordeal [individual package selection]). In case I do have to reinstall, this would be a great opportunity to try the autoyast install feature. I have read a lot of pages on it, but I am still not clear where in the boot process you provide the xml file to the installer. You got a favorite link that might help?? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
Yep, I've run a smart self test on it. It says it has had errors "In the past" but that it "passes" overall.
Good, so the disk is most probably fine.
In case I do have to reinstall, this would be a great opportunity to try the autoyast install feature. I have read a lot of pages on it, but I am still not clear where in the boot process you provide the xml file to the installer. You got a favorite link that might help??
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). /Per -- Per Jessen, Zürich (-4.4°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
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 Richard -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
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
Richard
Guys, 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 ;-) The Problem: 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 Setup: 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 [1]: 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 [2]: 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. Final Steps: 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 -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday, 2010-01-13 at 17:54 -0600, David C. Rankin wrote: ...
I don't think I'll ever have to reinstall again. With zypper dub,
Dub? Is it a typo, perhaps you mean "dup"?
and the ability to move partitions to new drives, changing hardware will be a snap.
moving using...? Perhaps you said it, but I'm sleepy and perhaps I didn't see it. :-? - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAktOZ54ACgkQtTMYHG2NR9XGbACeLzY3vEhGsPbYJHCbB07y3eQA 6rIAn2ImRKIXJntKOA5J7CmgiVAcPSHO =m8X/ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
In case I do have to reinstall, this would be a great opportunity to try the autoyast install feature. I have read a lot of pages on it, but I am still not clear where in the boot process you provide the xml file to the installer. You got a favorite link that might help??
I do that by specifying it on the kernel command line. This means either writing in either a syslinux pr pxelinux config file or in grub menu.lst or by manually entering it at a syslinux/isolinux/pxelinux/grub prompt. autoyast=url-or-path-to-file.xml There may be places that linuxrc (the very early script that runs immediately after the installer kernel loads) checks by default but I find it just as easy to specify an arbitrary file. Example from a bootable usb stick with the kernel and initrd form a minimal/net install iso, and very little else label auto_or1 kernel linux append showopts initrd=initrd install="http://host/path/to/oss" autoyast="http://host/path/to/or1.xml" Stupid email probably wraps that. it's only 3 lines and the last one starts "append=..." If I knew what drive letter the usb stick would receive after booting, I could put the xml file on the usb stick and use this instead: autoyast="device://sdi1/autoinst.xml" If it was /dev/sdi Maybe theres a uuid or guid or label way to do that so you can write something that will always work regardless which /dev/sd* the stick gets. You could type this in manually at the isolinux boot prompt from a stock install dvd instead of setting up an install repo mirror and and creating bootable usb thumb drives. You would still need at least a regular usb thumb drive or web server just as a place to put the xml file. autoinst.xml can be generated by installing the autoyast package on a working box and then in yast go to misc autoinstallation. You can clone the working box or write out a default reference one or you can use that yast module to build a custom one and write it. -- bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Brian K. White wrote: ...Let's try an error-corrected version of that... (mostly everything was inconsequential typos, but too many of those and you can't exactly trust the consequential parts)
In case I do have to reinstall, this would be a great opportunity to try the autoyast install feature. I have read a lot of pages on it, but I am still not clear where in the boot process you provide the xml file to the installer. You got a favorite link that might help??
I do that by specifying it on the kernel command line. This means writing in either a syslinux or pxelinux config file or in grub menu.lst or by manually entering it at a syslinux/isolinux/pxelinux/grub prompt. autoyast=url-or-path-to-file.xml
There may be places that linuxrc (the very early script that runs immediately after the installer kernel loads) checks by default but I find it just as easy to specify an arbitrary file.
Example from a bootable usb stick with the kernel and initrd and very little else form a minimal/net install iso:
label auto_or1 kernel linux append showopts initrd=initrd install="http://host/path/to/oss" autoyast="http://host/path/to/or1.xml"
Stupid email probably wraps that. it's only 3 lines and the last one starts "append ..."
If I knew what drive letter the usb stick would receive after booting, I could put the xml file on the usb stick and use this instead:
autoyast="device://sdi1/autoinst.xml"
If it was /dev/sdi
Maybe there's a uuid or guid or label way to do that so you can write something that will always work regardless which /dev/sd* the stick gets.
You could type this in manually at the isolinux boot prompt from a stock install dvd instead of setting up an install repo mirror and creating bootable usb thumb drives. You would still need at least a regular usb thumb drive or web server just as a place to put the xml file.
autoinst.xml can be generated by installing the autoyast package on a working box and then in yast go to misc autoinstallation. You can clone the working box or write out a default reference file or you can use that yast module to build a custom file and write it out.
-- bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 01/10/2010 02:01 AM, Brian K. White wrote:
I do that by specifying it on the kernel command line. This means either writing in either a syslinux pr pxelinux config file or in grub menu.lst or by manually entering it at a syslinux/isolinux/pxelinux/grub prompt. autoyast=url-or-path-to-file.xml
There may be places that linuxrc (the very early script that runs immediately after the installer kernel loads) checks by default but I find it just as easy to specify an arbitrary file.
Example from a bootable usb stick with the kernel and initrd form a minimal/net install iso, and very little else
label auto_or1 kernel linux append showopts initrd=initrd install="http://host/path/to/oss" autoyast="http://host/path/to/or1.xml"
Stupid email probably wraps that. it's only 3 lines and the last one starts "append=..."
If I knew what drive letter the usb stick would receive after booting, I could put the xml file on the usb stick and use this instead:
autoyast="device://sdi1/autoinst.xml"
If it was /dev/sdi
Maybe theres a uuid or guid or label way to do that so you can write something that will always work regardless which /dev/sd* the stick gets.
You could type this in manually at the isolinux boot prompt from a stock install dvd instead of setting up an install repo mirror and and creating bootable usb thumb drives. You would still need at least a regular usb thumb drive or web server just as a place to put the xml file.
autoinst.xml can be generated by installing the autoyast package on a working box and then in yast go to misc autoinstallation. You can clone the working box or write out a default reference one or you can use that yast module to build a custom one and write it.
Brian/Brain typos/snypos, I get to say it again. Wow! That is the most information on the actual use of autoyast that I have found in one place - period. Reminds me of the fun we had when compiz first appeared and ATI was still trying to sort out the fglrx driver. With that in hand, I think I have enough info to attempt an autoyast install the next time I get to build a fresh box for my kids. Thanks again for sharing some of your brain :p -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Brian K. White
-
Carlos E. R.
-
David C. Rankin
-
Per Jessen
-
Richard Atcheson