Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This 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.


  Search this Thread
Old 02-17-2004, 11:45 PM   #1
LQ Newbie
Registered: Feb 2004
Location: Australia
Distribution: Debian
Posts: 7

Rep: Reputation: 0
how do i fix a bad partition table?

i am having problems with my hardrive died so i am setting up a new one to match the old. It is a 200GB ATA/133 IDE HDD. i use Debian Linux. i have copies of all my data on another machine which i can copy across later.

i use knoppix to load then use cfdisk to set up my partitions. when i am ready to reboot and load using lilo i get the following errors when the hd partitions are being mounted.

Checking file systems...
fsck 1.27
/dev/hda9 contains a file system with errors, check forced.
Inode 33342 has illegal blocks
i have repartitioned a couple of times and each time one or more filesystems become corrupted.

Running fsck manually and fixing the errors doesnt help
if i try and then run cfdisk i get
FATAL ERROR: Bad primary partition 3: Partition ends after end-of-disk

if i do a 'fdisk -l /dev/hda' i get the following
Disk /dev/hda: 16 heads, 63 sectors, 266305 cylinders
/dev/hda1 1 247 124392 83 Linux
Partition 1 does not end on cylinder boundary:
phys=(95,53,48) should be (95,15,63)
The other hda(x)'s show the same error

i think knoppix is affecting my filesystems due to where i am mounting them. i made a directory /mnt on /ramdisk (/ramdisk/mnt) and mounted all my filesystems off that.

how do you format the hd to start again? or do you just delete all the partitions and start again?
where should i mount my filesystems so knoppix doesnt write into them?
Old 02-18-2004, 12:36 AM   #2
Senior Member
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
it shouldent write to them, but i had a simualr problem, heres the problem your using a ext2/3 file system, thsoe get curupt easly and you get thsoe errors, the only solustion i know of is to just remake the file system (this prety much delets whatever else was there so i hope u dont have anthing important there), id sugest to just change the filesystem to a difrent one, like reiserfs (jfs and xfs are also alternative, also theres other filesystem that arint concidered a linux FS you can use if you wanted to(as you probly know the kernel has suport for like 20 or so difrent FS's))
Old 02-18-2004, 08:04 AM   #3
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
i use knoppix to load then use cfdisk to set up my partitions.
Try saving the partition table to a file with sfdisk . For example...
sfdisk d /dev/hda > /mnt/images/backup/partfile

Save the MBR to a file also in case there is some issue with extended partitions.
dd if=/dev/hda of=/mnt/images/backup/mbrfile bs=512 count=1

Then you can restore the partition table and MBR before restoring the files.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bad Partition Table - Fedora Core 2 Remedy Linux - Hardware 2 05-04-2005 10:31 AM
trying to fix a bad partition table poiuytrewq Linux - Hardware 1 11-22-2004 11:07 AM
Bad Partition Table? tommcfarlin4 Linux - Software 2 08-21-2004 11:03 AM
Fixing a bad partition table pen^2 Linux - General 2 07-21-2004 06:25 AM
bad partition table thetruevoice Linux - Software 2 08-23-2001 04:34 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:05 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration