[TriLUG] fdisk to edit partition table: help please
Koleman Strumpf
cigar at email.unc.edu
Fri Aug 24 19:02:27 EDT 2001
I have a dual partition Pentium II with *GB IDE hard drive (a CCI
machine) with RedHat v5.2, and my lilo recently stopped working (due to a
foolish upgrade on my Win OS) --> as I describe below my partition table
seems to have gotten messed up. My rescue disk does not seem to function
(the PC just freezes up after spinning the floppy). At this point I am
just trying to salvage some files and then re-install if needed.
I got a hold of tomsrtbt v 1.7.358. When I try and mount my linux
partition I have problems. No problem mounting the Win partition (hda) but
when I try and mount Linux (hdb) I get:
# mount /dev/hda2 /test2
/dev/hda2: Unknown error
...
Transaction block size = 512
VFS: Can't find a valid MSDOS filesystem on dev 3:02.
mount: you must specify the filesystem
More information on the file system does not seem to help:
# mount -t ext2 /dev/hda2 /test2
attempted to access beyond end of device
03:02: rw=0, want=2, limit=1
EXT2-fs: unable to read superblock
mount: wrong fs type, bad option, bad superblock on /dev/hda2,
or too many mounted fule systems
When I first fdisk I get:
# fdisk /dev/hda
The number of cylinders for this disk is set to 1025.
This is larger than 1024, and may cause problems with:
1) software that runs at boot time (e.g., LILO)
...
Also, when I print the partition table I get,
# fdisk -l
Warning: invalid flag 0x0000 of partition table 5 will be corrected by
w(rite)
Disk /dev/hda: 255 heads, 63 sectors, 1025 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 262 2096608+ 6 DOS 16-bit >=32M
Partition 1 does not end on cylinder boundary:
phys=(519, 127, 63) should be (519, 254, 63)
/dev/hda2 262 514 2028096 5 Extended
Partition 2 does not end on cylinder boundary:
phys=(1022, 127, 63) should be (1022, 254, 63)
...
Finally, here is some more details:
# rescuept /dev/hda
# total size 16481808 sectors
unit: sectors
# 2047 MB fat partition (type 6): sectors 63- 4193279
# sector 4209351 looks like an ext2 superblock copy #1;
# in a partition covering sectors 4192965-4514264
# found all preceding superblocks OK
# Warning: overlapping partitions?
# 157 MB ext2 partition (type 83): sectors 4192965- 4514264
# 1945 MB ext2 partition (type 83): sectors 4514265- 8498384
# 0 MB candidate ext pt (type 5): sectors 8498385- 8498385
# 133 MB found in ept (type 82): sectors 8498448- 8771489
# 204 MB found in ept (type 83): sectors 8771489- 9189179
# 3004 MB found in ept (type 83): sectors 9189243- 15342074
# 518 MB found in ept (type 83): sectors 15342138- 16402364
# 3859 MB extended part ok (type 5): sectors 8498385- 16402364
/dev/hda0 : start= 63, size= 4193217, Id= 6
/dev/hda0 : start= 4192965, size= 321300, Id=83
/dev/hda0 : start= 4514265, size= 3984120, Id=83
/dev/hda0 : start= 8498385, size= 7903980, Id= 5
/dev/hda0 : start= 8498448, size= 273042, Id=82
/dev/hda0 : start= 8771489, size= 417627, Id=83
/dev/hda0 : start= 9189243, size= 6152832, Id=83
/dev/hda0 : start=15342138, size= 1060227, Id=83
Pretty clearly there is something wrong as the windows partition (type
6) is overlapping with the next partition (type 83).
Anyway, I was told over at the tomsrtbt listserv to "use fdisk to edit
your partition table to those beginnings and endings [listed in
rescuept], and then try to mount the filesystems, in the most brute force
approach." As a newbie this is all beyond me --> I could not figure out
from the man page or messing around with the fdisk menu how this is
done. Does anyone have any suggestions (perhaps using an example with the
type 82 partitions above) on how to proceed?
Thanks in advance,
Koleman
Koleman
More information about the TriLUG
mailing list