LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-05-2003, 09:33 PM   #1
gsbarry
Member
 
Registered: Jan 2003
Posts: 42

Rep: Reputation: 15
fdisk gives me different sizes for the same harddisk


I have a new harddisk(raw, without any formatting, 80GB)

I am going to connect it to hdb. When I run fdisk, it said the disk has:
255 heads, 63 sectors, 10011 cylinders

I didn't format it at this moment, but I try an experiment to connect it hdc

I run fdisk again, this time it said the disk has:
16 heads, 63 sectors, 159560 cylinders


Why fdisk gives me different setting?
If there any difference for me to format in these two ways?
 
Old 02-10-2003, 02:59 PM   #2
vladkrack
Member
 
Registered: Oct 2002
Location: Curitiba - Brazil
Distribution: Conectiva
Posts: 334

Rep: Reputation: 30
Strange, look at /proc/ide/hd?/capacity to see what it says ...
 
Old 02-10-2003, 09:56 PM   #3
gsbarry
Member
 
Registered: Jan 2003
Posts: 42

Original Poster
Rep: Reputation: 15
I have two harddisks, they are exactly the same.
Then I connect them to be hda and hdc.

I looked at the /proc/ide/hda/ and /proc/ide/hdc
in the "capacity", they are the same.

But in the "geometry"
hda shows:

physical 159560/16/63
logical 10011/255/63

but hdc shows:

physical 159560/16/63
logical 159560/16/63

I guess that fdisk just read the data from this file, so fdisk give me different reading on the same harddisk.
But why the geometry file have different reading? or said "why Linux regards the same disk with different settings?"

Thanks
 
Old 02-11-2003, 11:09 AM   #4
vladkrack
Member
 
Registered: Oct 2002
Location: Curitiba - Brazil
Distribution: Conectiva
Posts: 334

Rep: Reputation: 30
The physical is the value that kernel uses, and the logical is a value from the BIOS. Maybe something related to LBA use, but there's a situation that the BIOS is ignored:

<from: linux/drivers/ide/ide-geometry.c:74>
if ((cmos_disks & (0xf0 >> (unit*4)))
&& !drive->present && !drive->nobios) {
unsigned short cyl = *(unsigned short *)BIOS;
unsigned char head = *(BIOS+2);
unsigned char sect = *(BIOS+14);
if (cyl > 0 && head > 0 && sect > 0 && sect < 64) {
drive->cyl = drive->bios_cyl = cyl;
drive->head = drive->bios_head = head;
drive->sect = drive->bios_sect = sect;
drive->ctl = *(BIOS+8);
} else {
printk("hd%c: C/H/S=%d/%d/%d from BIOS ignored\n",
unit+'a', cyl, head, sect);
}
</from: linux/drivers/ide/ide-geometry.c>
 
Old 02-11-2003, 09:33 PM   #5
gsbarry
Member
 
Registered: Jan 2003
Posts: 42

Original Poster
Rep: Reputation: 15
But, from the code you quoted, my harddisk will use the bios setting. (not in ignored case since the sector is 63 only).
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
weird fdisk problem (Fdisk unable to see winxp partitions) khidot Slackware - Installation 5 04-07-2007 10:26 PM
Partition sizes for me Doctor Orange Linux - Newbie 2 08-13-2004 10:50 AM
Low Harddisk space. Can I just transfer the entire Linux to a bigger harddisk? davidas Linux - Newbie 12 04-13-2004 03:03 AM
Partitions sizes eweborg Linux - Software 1 03-09-2002 11:43 AM
disk druid doesn't see second harddisk (hdc) while fdisk does r@l.f Linux - Software 0 11-25-2001 10:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:56 PM.

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