New SCSI drive partition information different for fdisk and cfdisk????

New SCSI drive partition information different for fdisk and cfdisk????

Post by Pete Willemse » Thu, 01 Mar 2001 16:05:14



Hello.

I recently installed Linux (Debian woody) on a P4 machine that has two SCSI
disks.  Linux installed well on the second disk (/dev/sdb) which is an IBM
Ultrastar 18GB SCSI disk. Everything seemed perfectly fine with the system
until I attempted to look at the partitions with PartitionMagic.

PartitionMagic reported that the Linux partition had an error.  So, I booted
Linux, ran fdisk and received the following report from "fdisk -l /dev/sdb":

----
Disk /dev/sdb: 1 heads, 35565080 sectors, 1 cylinders
Units = cylinders of 35565080 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sdb1   *         1         1  17652064+  83  Linux
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(0, 1, 1) logical=(0, 0, 64)
Partition 1 has different physical/logical endings:
     phys=(1023, 255, 63) logical=(0, 0, 35304192)
Partition 1 does not end on cylinder boundary:
     phys=(1023, 255, 63) should be (1023, 0, 35565080)
----

I never noticed this before, so I decided to run cfdisk.  It showed the
partition as being correct:

---
     sdb1           Boot            Primary     Linux ext2
18075.75
---

and the cfdisk table print produced:

---
Partition Table for /dev/sdb

         ---Starting---      ----Ending----    Start Number of
 # Flags Head Sect Cyl   ID  Head Sect Cyl    Sector  Sectors
-- ----- ---- ---- ---- ---- ---- ---- ---- -------- ---------
 1  0x80    1    1    0 0x83  255   63 1023       63  35304129
 2  0x00    0    0    0 0x00    0    0    0        0         0
 3  0x00    0    0    0 0x00    0    0    0        0         0
 4  0x00    0    0    0 0x00    0    0    0        0         0
---

My big question is why are fdisk and cfdisk reporting different information.
Which is correct?  My Linux installation is working, but this anomaly in the
partition table bothers me.  Might anyone have any information on why this
is occuring?

Many thanks for your time.

Pete Willemsen
University of Utah

 
 
 

New SCSI drive partition information different for fdisk and cfdisk????

Post by Rod Smi » Thu, 01 Mar 2001 23:13:50


[Posted and mailed]



Quote:> Hello.

> I recently installed Linux (Debian woody) on a P4 machine that has two SCSI
> disks.  Linux installed well on the second disk (/dev/sdb) which is an IBM
> Ultrastar 18GB SCSI disk. Everything seemed perfectly fine with the system
> until I attempted to look at the partitions with PartitionMagic.

> PartitionMagic reported that the Linux partition had an error.  So, I booted
> Linux, ran fdisk and received the following report from "fdisk -l /dev/sdb":

> ----
> Disk /dev/sdb: 1 heads, 35565080 sectors, 1 cylinders

This is extremely unusual. Also, compare it to the cfdisk report....

Quote:> and the cfdisk table print produced:

> ---
> Partition Table for /dev/sdb

>          ---Starting---      ----Ending----    Start Number of
>  # Flags Head Sect Cyl   ID  Head Sect Cyl    Sector  Sectors
> -- ----- ---- ---- ---- ---- ---- ---- ---- -------- ---------
>  1  0x80    1    1    0 0x83  255   63 1023       63  35304129

You can't have 255 heads and 1023 cylinders on a disk with just 1 head
and 1 cylinder. Apparently fdisk and cfdisk are using different methods
to determine the CHS geometry for the disk. This probably interacts with
the SCSI BIOS and/or Linux's SCSI drivers.

Having inconsistent CHS geometry is an invitation to disaster. I
therefore recommend that you back up, fix the problem, and restore.
Unfortunately, "fix the problem" is easier said than done. Without
knowing the precise cause of the problem, it's hard to say how to fix
it. As a first stab, though, I'd do this:

1) In Linux, use "dd if=/dev/zero of=/dev/sdb bs=512 count=1". This will
   completely wipe out the partition table, along with any flaky
   information it might contain that could be the root of the problem.
2) Since you mentioned you've got Partition Magic, I'd recommend
   booting it and using it to create new partitions. I believe that PM
   has some way to report the CHS geometry, so check that it doesn't use
   1 for the number of heads or cylinders. If it does, start over or try
   another tool.
3) When you re-install or restore Linux, check with fdisk and cfdisk to
   see that the CHS geometry is being reported consistently.

You might also investigate Linux driver options for your SCSI host
adapter. It's possible that this is caused, at least in part, by a SCSI
driver bug. Post information on what SCSI adapter you're using if you
continue to have problems and post again.

--

http://www.rodsbooks.com
Author of books on Linux & multi-OS configuration

 
 
 

New SCSI drive partition information different for fdisk and cfdisk????

Post by Pete Willemse » Sat, 03 Mar 2001 01:08:44


Rod,

Your suggestions worked great.  I'm still not sure of why cfdisk
initially created my paritions incorrectly. I'll investigate that if I
have time.

In any event, I zeroed out the partition table, had PartitionMagic
create *any* Linux partitions I needed and then I installed Linux.  The
CHS geometry reported by PartitionMagic is now in sync with what fdisk
reports: 2213 Cyl, 255 Heads, and 63 Sectors.

Thanks again for your help.

Pete Willemsen


> 1) In Linux, use "dd if=/dev/zero of=/dev/sdb bs=512 count=1". This will
>    completely wipe out the partition table, along with any flaky
>    information it might contain that could be the root of the problem.
> 2) Since you mentioned you've got Partition Magic, I'd recommend
>    booting it and using it to create new partitions. I believe that PM
>    has some way to report the CHS geometry, so check that it doesn't use
>    1 for the number of heads or cylinders. If it does, start over or try
>    another tool.
> 3) When you re-install or restore Linux, check with fdisk and cfdisk to
>    see that the CHS geometry is being reported consistently.

 
 
 

1. fdisk and cfdisk giving incorrect partition size information

Hi all,

For a long time, only about 8GB of the 30GB IDE hard disk in my RH 7.2
machine was being used in several partitions, with 22GB of free space
hanging off an extened partition. I attempted to create a new logical
partition, using cfdisk, out of the free space.

After the partition information was 'written', cfdisk gave me an error
of the sort "Can't re-read new partion table. Please reboot.." After
rebooting and mounting the new partition (hda7), here's the output of
'df':

Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/hda1               505605    456124     23377  96% /
/dev/hda3              1004052     18620    934428   2% /home
none                    127228         0    127228   0% /dev/shm
/dev/hda2              4032124   1905176   1922120  50% /usr
/dev/hda5               505605     58967    420534  13% /var
/dev/hda7                38859        13     36840   1% /da

Here is the output of print table cmd of fdisk /dev/hda:

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1        65    522081   83  Linux
/dev/hda2            66       575   4096575   83  Linux
/dev/hda3           576       702   1020127+  83  Linux
/dev/hda4           703      3647  23655712+   5  Extended
/dev/hda5           703       767    522081   83  Linux
/dev/hda6           768       832    522081   82  Linux swap
/dev/hda7           833      3647  22611456   83  Linux

cfdisk gives the same information.

Can anyone tell me what's going on here? Why the different partition
sizes being reported?

Thanks.

2. how to set up printing in NT using TCP/IP

3. cfdisk or fdisk can't find hard drive

4. Linux on Windows

5. new filesystem problems: "fdisk: can't write fdisk partition table: Invalid argument"

6. No such device

7. Problems with number of heads from DOS FDISK partitions and Linux fdisk on 8.4 GB drive

8. : ramdisk and repartitioning

9. FDISK partitioning problems (SCSI-1 drive)

10. Win95 FDISK not finding DOS partition on SCSI Linux drive

11. fdisk on first scsi drive - new installation

12. CFdisk doesn't See drive on 1542 SCSI

13. RH 5.0 install freaks out drive partition table...now can't fdisk the drive!