Edward van der Jagt wrote:
In my Suse 6.0 system I have 2 IDE disks (40Gb and 10Gb), and at this moment 1 SCSI disk. While working today I decided to add a new 2Gb partition to the 40Gb disk (/dev/hda). Until now I had only been using 13Gb of the disk. I used linux fdisk to add the partition (/dev/hda9) of size 2000M When exiting with the w command, fdisk exited with the line "unable to read /dev/hda" This is a line from the kernel (from genhd.c) so something is definitely wrong. After creation I alwasy do a fdisk -l to see the result. But now all I got was the "unable to read /dev/hda" message again.
I just tried sfdisk -l /dev/hda and this gives: ------------------ Disk /dev/hda: 240 heads, 63 sectors, 1023 cylinders read: Success
sfdisk: read error on /dev/hda - cannot read sector 25144561 Units = cylinders of 7741440 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System /dev/hda1 0+ 0 1- 7528+ 83 Linux native /dev/hda2 543 576 34 257040 82 Linux swap /dev/hda3 1 542 542 4097520 83 Linux native /dev/hda4 577 5292 4716 35652960 5 DOS Extended /dev/hda5 577+ 780 204- 1542208+ 83 Linux native /dev/hda6 781+ 848 68- 514048 6 DOS 16-bit FAT >=32M /dev/hda7 849+ 984 136- 1028128 83 Linux native /dev/hda8 985+ 1662 678- 5125648 83 Linux native ------------------ The partition table seems allright (except the new partition isn't present). But note the read error on /dev/hda
This probably has to do with the fact the the kernel reports the disksize wrong at bootup: <4>hda: Maxtor 54098U8, 8842MB w/2048kB Cache, CHS=1023/240/63, UDMA <4>hdb: ST310240A, 9541MB w/128kB Cache, CHS=1023/240/63, UDMA Typical is dat the geometry of hda is the same as hdb, and hda is definitely 40Gb, not 8.8Gb
Using cfdisk I get: FATAL ERROR: Bad primary partition Press any key to exit fdisk
Conclusion would be to repair the partition table.
Using rescuept it first seems to detect the correct partitions, but then retracts the partitions in the extended part (hda5 and on). Rescuept also says the total size is 18109035 sectors = 9.2Gb
Gpart detects hda1 through hda7 but on it's final guess it only prints hda3, hda2 and hda4 (the extended partition). Where hda4 is wrong: it only spans the space for hda5 and hda6
Fixdisktable only detects my hda1 and hda3
And even the data from the ones all three programs find are not equal.
Can anyone help me and tell me what to do ? I am afraid to reboot and then to loose all my data. Backups are ofcourse out of date (ever tried to backup a total of nearly 30Gb onto 2Gb DAT tapes ?) I do have a 20Gb disk lying around somewhere but obviously can't put it in my machine right now. I could put it into another machine, but copying 13Gb would take quite a while with 10Mbit ethernet. There has to be a better way ?!
I'm assuming that you didn't put any data into /dev/hda9, so that the only thing that was written to the disk was the partition table? Do you know your partition layout as fdisk sees it (different partitioning tools sometimes report partitions ending on different cylinders...)? I would first try restarting fdisk and deleting that last partition. Alternatively I would set up that alternate hard disk and leave your computers backing up overnight. If you manage to restart fdisk and remove the new partition, and everything seems to be back the way it was, then your first priority before trying again (other than backing everything up ;-) ) is to make the kernel see the drive with the correct geometry. But first things first... Good luck, Chris -- __ _ -o)/ / (_)__ __ ____ __ Chris Reeves /\\ /__/ / _ \/ // /\ \/ / ICQ# 22219005 _\_v __/_/_//_/\_,_/ /_/\_\