LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how do i fix a bad partition table? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-fix-a-bad-partition-table-147454/)

rj1 02-17-2004 11:45 PM

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
UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY
________
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?

SciYro 02-18-2004 12:36 AM

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))

homey 02-18-2004 08:04 AM

Quote:

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.


All times are GMT -5. The time now is 10:59 AM.