PDA

View Full Version : gpart help?



OpenIntro
04-03-2005, 07:33 PM
I am attempting to run gpart via Knoppix 3.7 and honestly have no idea what I am actually doing.

I have gone to the RUN COMMAND line and said gpart -c /dev/hda1, but this just opens up a Terminal window that is blank and says FINISHED at the top. Doesn't seem like it is doing anything.

I have 1 80gb hard drive that has a C and D drive on it (2 partitions I guess)....is there a gpart tutorial anywhere? Or can anyone lend some gpart knowledge? I have looked through the man gpart, but hasn't really enlightened me as of yet ;)

fingers99
04-03-2005, 08:19 PM
We really need to know what you're trying to do with gpart.

For example, since you use gpart in order to check a partition table (and re-write it),

gpart /dev/hda

would seem a better choice.

http://www.stud.uni-hannover.de/user/76201/gpart/

has the author's description, but, essentially, you run gpart /dev/hda to check the partitions. If the check is consistent, use gpart gpart -W /dev/hda /dev/hda

OpenIntro
04-03-2005, 08:47 PM
thanks for the reply....i apologize for the double post....

I have a hard drive that seems to have been wiped out or crashed....when I boot it up, all I get is OPERATING SYSTEM NOT FOUND. More than anything, I am just trying to recover the data that is on the hard drive, and then probably replace the hard drive. Harry Kuhman suggested that I run gpart to see if we can recover the partition table, since when I boot up Knoppix, it doesn't seem to be picking up my hard drive.

I just tried gpart /dev/hda

and I get:

*** Fatal error: open(/dev/hda): Permission denied.

fingers99
04-03-2005, 08:55 PM
Try

sudo gpart /dev/hda

OpenIntro
04-03-2005, 09:00 PM
When I run that WITHOUT clicking the Terminal Window option, it does nothing. When I do check that option, I get:

*** Fatal error: open(/dev/hda): No such device or address.

OpenIntro
04-04-2005, 04:54 AM
Also, if I run....

sudo gpart /dev/hdc (which I tried since it was the C drive?), I get:

*** Fatal error: cannot get sector size on dev(/dev/hdc).

Harry Kuhman
04-04-2005, 05:11 AM
Also, if I run.... sudo gpart /dev/hdc (which I tried since it was the C drive?).... No, it's not the C drive. It's not even the C drive under XP. it's both C and D Partitions under XP, but that's not the same as saying which drive it is (I have D F and G partitions on my second drive, for example) It's the first drive, and Linux refers to the first drive on a normal IDE interface as hda. It refers to the partitions on hda as hda1, hda2, hda5 (the first logical partition in an extended partition) and so on. So what you want to be scanning with gpart is hda. If you can't run gpart against it you might want to consider the chance that the drive just isn't working. But I would test that theory with some software other than Knoppix before I sent the hard drive to someone and told them to overcharge me to extract data from it. You might even want to run gpart on another computer to see how it normally works.

OpenIntro
04-04-2005, 05:35 AM
So it's not that I'm doing something wrong with what I am typing? Or do I have to set something up first? The first time, I got permission denied. I have listened when I power up and it sounds like the disks are spinning normally....

Harry Kuhman
04-04-2005, 06:28 AM
So it's not that I'm doing something wrong with what I am typing? Or do I have to set something up first? The first time, I got permission denied. I have listened when I power up and it sounds like the disks are spinning normally....
I don't know what's happening for you. The very first time I actually ran gpart was just now, I opened a shell and typed:
sudo gpart /dev/hda
and it made a correct evaluation of a hard disk I have as the first disk on my primary IDE controler. It also was able to do the same with a hard disk that I have as the secondary on my second IDE controler with sudo gpart /dev/hdd. It is also very handy to do a sudo gpart -v /dev/hda, which will dump out what is in the current partition table. This may go a long way in helping understand what happened.

OpenIntro
04-04-2005, 07:22 AM
still says....

*** Fatal error: open(/dev/hda): No such device or address.

crapppppppppppppppppppppppppppppppppppppppppppppp. ...

Harry Kuhman
04-04-2005, 08:00 AM
still says....
*** Fatal error: open(/dev/hda): No such device or address.
That sure doesn't sound good for the drive. No matter what was written on sector 0, track 0, head 0, gpart should be able to bring in the bytes and display them to you if the drive was talking to it. I would still suggest that you try to look at the partition table with something else, even an old version of DOS and fdisk if you don't have anything else. fdisk will not understand NTFS partition types, but if it sees the drive at all then it should be able to at least tell you what the partiton table looks like, maybe saying unknown partition type. Obviously don't let fdisk make any changes, but if fdisk can see the drive then something very wacky is going on with Knoppix, if it can't then it sure seems like the software just isn't seeing the hard drive.

You might want to go into your BIOS and see if you can learn anything about the hard drive there. What you might learn depends a lot on the drive and the BIOS. My HP notebook is completely worthless, but even that would tell me the drive geometry when set to "auto", which actually tells you a lot since it confirms the computer and drive are talking to one and other.

Before rushing to send that drive off to someone who claims to be able to charge you large amounts of money and maybe recover files, I would also try to either find a friend with a noteook that will let you try the drive in his notebook, or get a notebook to 3 1/2 inch IDE adapter and try the drive in a desktop. If the drive hasn't talked to you up to this point it seems most likely that it is a drive failure, but that is not certain. It could be the IDE electronics on the motherboard that talk to the drive that have failed. I would confirm that it is the drive itself before I sent it to anyone who was about to charge me hundreds (ok, I'm actually too cheap to send it to anyone who would charge me hunderds and gaurantee nothing, but you get the idea). Obviously if you test it in another notebook I would have the Knoppix CD with you, as that notebook will have had its own hard drive removed. And I still think it is a good idea for you to see gpart run ok on some computer just to be comfortable about what you are typing.

And for a real scare about what can go wrong, here's an interesting article that was recently referenced on Slashdot: http://www.heise.de/ct/english/05/08/172/

fingers99
04-04-2005, 07:03 PM
*** Fatal error: open(/dev/hda): No such device or address.

crapppppppppppppppppppppppppppppppppppppppppppppp. ...

Is the drive picked up by the bios?

OpenIntro
04-04-2005, 08:48 PM
how do i check if this is the one picked up by the BIOS?

fingers99
04-04-2005, 09:29 PM
If it's hda it'll be the primary master. Unless you have your CDRom as primary master (unlikely, but possible). Just hit (usually) [del] before the box boots.

OpenIntro
04-04-2005, 09:38 PM
When I startup, I am getting this screen, which I had never seen before I started messing with Knoppix.....

Phoenix FirstBIOS(tm) Notebook Pro Version 2.0
Copyright 1985-2002 Phoenix Technologies Ltd.
All Rights Reserved

CPU = Mobile Intel (R) Pentium (R) 4 CPU 3.06Ghz
639K System RAM Passed
509M Extended RAM Passed
512K Cache SRAM Passed
System BIOS shadowed
Fixed Disk 0:
ATAPI CD-ROM: SONY DVD RW DW-U54A
Mouse initialized
S/N: 28166630-3207713
ERROR
0200: Failure Fixed Disk 0

Press <F1> to resume, <F2> to Setup


If I hit F2 and go into the BIOS Setup, and go to the Advanced Tab, I see:

Primary IDE Adapter: 0MB
Secondary IDE Adapter: CD-ROM

Harry Kuhman
04-04-2005, 10:06 PM
Primary IDE Adapter: 0MB
Secondary IDE Adapter: CD-ROM Not looking good for that hard drive. Again, I urge you to test the hard drive in another laptop or get a notebook to 3 1/2 inch adapter and test it in a desktop. Even one of those small external cases to attach a notebook by a USB interface would be helpful. The hard drive is the most likely canidate but it could be the notebook motherboard.

OpenIntro
04-04-2005, 10:14 PM
So it saying 0Mb is a bad sign? :/

Just a note, I ran gpart on my girlfriend's desktop, and it ran just fine...so at least I know how it works....

I have another laptop, and a desktop I could try it in. I have never done any removing of laptop hard drives before, so I'm not totally sure what I am doing. Which of the above options that you mentioned would be the easiest to test?

Harry Kuhman
04-04-2005, 10:33 PM
I have another laptop, and a desktop I could try it in. I have never done any removing of laptop hard drives before, so I'm not totally sure what I am doing. Which of the above options that you mentioned would be the easiest to test? Different laptops vary in their ease of access to the hard drive, so it's a case of your results may vary. Easiest in terms of not needing any extra hardware would be to test the drive in another laptop, assuming the other laptop can deal with a 80 gig drive. Since you say the current problem laptop is out of warranty then why not at least figure out what you need to do to access that hard drive. If it's not in your documentation there should be plenty of info on the web. Once you have done that you can decide if you want to open your other laptop (again, see it's documentation or search the web) or if you want to try sticking it in a hard drive. Sticking it in a desktop system would be easier for me, but it would mean that I would need to buy a notebook to 3 1/2 inch adapter (http://www.geeks.com/details.asp?invtid=HD-108&cat=HDD). This should be a small device that addapts your PC IDE cable to the notebook drive (different pin count) and a power connector as well. And in my case I would have to use my main desktop, older testbed systems I have would not support an 80 gig drive.