[/DEV/HDA] BIG BIG EMERGENCY! (was since 28092001)
WHAT HAPPENED: ============== I am unable to access the harddrisk hda, I cannot read the partition table since: WHAT I DID: =========== I just executed lilo after changing the boot _order_ (boot dos second, linux first), nothing extraordinary really. Lilo completed correctly as always, but since then I cannot boot nor even access any partition n that hda. ERRORS: ======= error 0x40 uncorrectable error LBAsect=9 sector=0 end_request: I/O error dev 03:00 (hda) sector unable to read partition table It is according to badblocks a physical problem with bad sectors on my hd, which accidently cover precisely the first sectors (i.e. the partition table is dead), so we zero'ed the entire partition table AND NOW?: ========= Running fdisk /dev/hda says "cannot read partition data" Even trying with DOS6.22' DOS-FDISK (fdisk /mbr) did not bring me on, since it complains it cannot read/write the partition table. the disk hda is accessible via "dd" command, I can even output files on that dos partition such as config.sys to screen. The bios reads/autodetects the correct CHS data. EMERGENCY!!!!!!!!!!!!!!!!!!!!!!!!!!! REAL TROUBLE!!!!!!!! ========================================================= I need my data back. I cannot repartition hda, is there any tool to help me out of this desaster? Maybe this is a lilo bug? Since I have not done any thing to the data inside /etc/lilo.conf, only changed the order of appearance!!!! not more! HELP PLEEEEEEZ! -=================================================================- I included this original portion of my initial mail dated 28092001 to give you the background again, now what you advised me to do is "Rafael E. Herrera" wrote:
I'd suggest you use the program "gpart" at:
http://www.stud.uni-hannover.de/user/76201/gpart/
It is supposed to be able to recover a damaged partition. READ the instructions.
I tried that one thanks, but either it has a bug or I have more problems: If I run gpart (265910 bytes long) I get "segmentation fault" only. Why is that? Originally I wanted to simply copy it onto a 3,5" disk and boot from rescue CD 1 and run gpart from disk then, but when it does not even work on a different machine? Since I do not have any sheet of paper where I have written down the partition borders, I am somehow stuck here. Isn't there a way of dd'ng the partition contents into an ISO image? maybe like dd if=/dev/hda of=image.iso skip=??? bs=512 count=??? Then how should I set the offset to skip and the counts? There are no further errors on that hd except for the 4 sectors 0,1, 130, 131 (0,1 apparently are the partition table): badblocks -b512 -o /test /dev/hda 1000 gave me: 0 1 130 131 Also tried
ranish partition manager available from: http://www.users.intercom.com/~ranish/part/part.zip but to no avail.
Now that gpart did not work Michael H Warfield showed me some way to get a little ahead. Thanks Michael, you really teach me harddrives :-) -=================================================================- We did: "Project Cyl 0 is toast" " Boot from the Linux BBC or some other favorite bootable CD. Assuming that the drive is /dev/hda, run the following command: dd if=/dev/zero of=/dev/hda bs=1024 count=32" to zero all the partition table. I can execute fdisk on /dev/hda ever since! No errors, executed with no error. just 32 records in and out. Now running clean fdisk/cfdisk. Cool... You've written out 32 1K blocks (which is 64 sectors). That whiped out track 0 (plus one sector of track 1, but that should not be a problem). It didn't get near track 2 where those other two bad sectors are, but they shouldn't be giving you any trouble. Your first partition SHOULD start on cylinder 1 (partitions are normally on cylinder boundries - there are sloppy exceptions). The only problem here is that I have no clue of how my partitions were set, it was something like this /dev/hda1 6 0256 MB fat16/dos /dev/hda2 83 .... MB Linux 83 /dev/hda3 82 .... MD Linux Swap (presumably 0032 MB) /dev/hda4 6 1900 MB Rest: fat16 Data of my BBS only way is up: get some tool to scan partition boundaries and then resetup using fdisk, evacuate and BURN that hd... what tool does scan the boundaries? it is because the values above are far from estimated. -=================================================================- We did: "The soft solution" We'll assume that you know the geometry of the drive. Take your C/H/S and multiply them together and divide by 2 to get the size of that first cylinder in 1K blocks. Booted off the bootable CD, you can use ; what exactly do you mean? ; c*h*s ?? ; michael, please explain a little more, because I tried a dd ; and am sure i can access all the files on that hda (i can even ; output them to screen!), so that would help a lot. ; in case i missed something: i assume that I am supposed to ; multiply H*s, which is 128*63=8064 and divide that by 2, ; which results in 4032 ; is that correct ?? ; I ask before I try that out because I fear MORE damage. dd to copy from the bad drive (lets say /dev/hdb) to a file on a good drive (which is why the drive needs to be larger). ;original hda geometry: size 2564, 621 cyls, 128heads, 0 precomp landzone 4968, 63 sectors, LBA mode ;hdparg -g /dev/hda shows: ;geometry=621/128/63, sectors=5008752, start=0 CYLSIZE will be the size of cylinder zero here... I'll also assume that you have a big fat file system mounted on /mnt/0 to which you can write a copy of your file system. ; that cylsize equals the "first" cyl number zero, right? dd if=/dev/zero of=/mnt/0/oldfilesys bs=1024 count=$CYLSIZE dd if=/dev/hdb of=/mnt/0/oldfilesys bs=1024 skip=$CYLSIZE If that second dd command gives you errors, your drive is in serious hurt and you've had a hard drive hardware failure. Recovery will be expensive and unlikely to be successful. Now you should have an image of your drive on /mnt/0/oldfilesys with the first "cylinder" zeroed. Now either low-level format your old drive or replace it with an identical new drive. Partition the drive to EXACTLY what it was before the failure (or get ready to learn TCT). Now go back to your bootable CD and copy the data back... dd if=/mnt/0/oldfilesys of=/dev/hdb bs=1024 skip=$CYLSIZE Notes: I put $CYLSIZE into the head of the file to allow for the case where you might try reconstructive work on the image itself. It might also help with TCT in resurrecting a viable image if you want to work directly on that image. If you KNOW your partition table layout in cylinders and are real good at CHS -> sector number math, you can also try copyin off individual ; unfortunately I am not good at that ; furthermore, i have no idea of what my original partition table ; looked like partitions to other identically sized partitions. This is really not for the faint of heart and I would only try it if I had everything documented to the nines and it was a final act of despiration. Note... Preferred method of attack is to get the data copied to another identical drive. That way you don't run the risk of scragging that original drive and then discovering that you made a mistake in the copy process somewhere. If you have to use the single drive / lowlevel format approach, make sure the image contains good data and is intact, BEFORE begining the initialization. -=================================================================- I TRIED IT! I CAN ***ONLY*** VIA THIS WAY ACCESS THE DRIVE!!!! i just tried for a start dd if=/dev/hda of=/image skip=1024 bs=512 count=xxx and guess what? i have now been able to read the autoexec.bat of my there existing dos paartition. now, i plan to entirely evacuate all the data of the 4 partitions which still ARE there on hda. WHERE exactly does the data of the partition start on the drive? if i run using skip=63 with count=100 i get an i/o error and only 67 records copied. so it seems that a bit of the beginning of my valuable hda1 is damaged (test: 100-67=33*512 bytes lost ###IS THAT RIGHT?###) this question is about the SKIP= value which i shall enter. next, can you go into detail for the above "N" value (count=N) i tried with 63 but am unsure about it. What we can further test: On of the tools pointed to by that page is "fixdisktable". That tool is on the LNX-BBC rescue CD. It may well be on others. I can't find a lot of documentation on it, not even in the sources which are available here: ftp://bmrc.berkeley.edu/pub/linux/rescue/fixdisktable-0.3.tar.gz Oh, and regarding the TCT (The Coroner's Toolkit). That's on a lot of the bootable CD sets already. You can find out everything you wanted to know and a lot more about the TCT on their home page: http://www.porcupine.org/forensics/ Next, Michael, I did not quite get what you meant with these passages: Hmmm... You are only using primary partitions. Not sure if that's good news or bad news. Means that the table is all in one place. The secondary partitions under and extended partition are actually dazy chained through the drive. Means they are harder to find, but it also means they can be scanned for. But not applicable to partitions 1-4 that are in the primary table.
so varying all those values could end in even more desaster, so I await your advise and do not yet write the pt.
isn't there TWO pt (one backup) on any hd? so why not simply copying the backup over the first?
Not sure, but if you read the man pages on sfdisk (use with EXTREME caution) you'll find options for dumping a partition table to a file that can be later restored (assuming the file is not on a file system you can't get to :-) ). Could you please go into "clearer" detail? This fog around hds is hard to see through :-) I would like to test some partition sizes using fdisk, is that dangerous? I suppose not, as the only destination where partition data is written to, is the track 0 of the hda, isn't it? and I can easily overwrite that one, as above :-) i would like to edit these partition values from my brain to have them tested: hda1 001-066 266080 06 fat16 hda2 067-132 266112 83 Linux hda3 133-141 36288 82 Swap hda4 142-621 1.9G 06 fat16 i ask before i try that because i want to know if i could possible destroy even more using this test. tia! -- *º¤., ¸¸,.¤º*¨¨¨*¤ =Oliver@home= *º¤., ¸¸,.¤º*¨¨*¤ I http://www.bmw-roadster.de/Friends/Olli/olli.html I I http://www.bmw-roadster.de/Friends/friends.html I I http://groups.yahoo.com/group/VGAP-93 I I http://home.t-online.de/home/spacecraft.portal I
Telek0ma iBBMS - soon back online +49.4503.TRSi1/TRSi2 <<<
Oliver Ob wrote:
WHAT HAPPENED: ============== I am unable to access the harddrisk hda, I cannot read the partition table since:
WHAT I DID: =========== I just executed lilo after changing the boot _order_ (boot dos second, linux first), nothing extraordinary really. Lilo completed correctly as always, but since then I cannot boot nor even access any partition n that hda.
Have you tried to boot from the floppy or cdrom, then choose boot installed system, then try to boot the old system? You would have to try and figure out what partition it is on now. If you can boot it, once booted, start yast, SystemAdministartion,Kernel and Boot configuration, lilo configuration. Then tell lilo to install itself on the mbr; and rebuild lilo that way. Your problem makes my head spin :-) -- $|=1;while(1){print pack("h*",'75861647f302d4560275f6272797f3');sleep(1); for(1..16){for(8,32,8,7){print chr($_);}select(undef,undef,undef,.05);}}
participants (2)
-
Oliver Ob
-
zentara