Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a turbolinux system with only one hard drive: /dev/hda
My partitions were like so:
/dev/hda1 for win 98
/dev/hda2 for linux
/dev/hda3 for swap
Well, while trying to create a second ext2 partition something went wrong and now my partition table seems scrambled. I cannot access it with fdisk or cfdisk.
fdisk says unable to read /dev/hda
cfdisk says something about bad partition table
sfdisk is way over my head
Now, the weird thing is that the system still works fine as far as LILO booting into win 98 or linux and both systems running ok.
But in linux I now cannot access /dev/fd0 or /dev/cdrom or /dev/windows (which has been working fine). I get Segmentation faults on all. Is this related?
I have tried gpart and rescuept and I cannot figure them out.
Is there anything else I can try?
I am assuming the system is going to fail hard sometime soon if I cannot fix the partition table.
The Segmentation fault error with mounts I mentioned in the first post is unrelated to the ptbl problem.
I forgot I had recently compiled a new kernel and have never tried to mount anything with it. Don't know why I have THAT problem, but that can wait until another day.
I went back to the original kernel and that problem is fixed.
Ok, forget gpart. Search for an app called "testdisk" its by a frenchman named "Grenier", IIRC.
Compile or if youve got Dos use the dos executable.
Make sure you know your CHS (cylinder, head, sector) data from either BIOS or a free app like Partition Magic's Partinfo, or dmesg.
Make sure you know approximately your partition layout.
(Unpack, compile) start testdisk and feed it the CHS values just to be sure. Turn to the harddisk and let it search for partitions.
Now for each partition you know is good, turn the [D] to [P] or [E]. Since your partition table is messed up, you wouldnt want to back it up, but if you do do "dd if=/dev/hdx of=/tmp/pt.hdx bs=1 count=64 skip=446 seek=446" where hdx is the harddisk.
Now let testdisk write the new partition table.
This works better than cfdisk which moans about 0 sized and invalid partitions but wont delete em.
Well, I tried all of the above with testdisk and testdisk can only see one extended partition (the one that should have been deleted in the first place).
And the situation did get worse.
LILO cannot see the partitions now, and yet I can still mount my linux part running tomsrtbt.
So my stuff is still there but nothing seems to be able to correct the partition table.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.