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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-05-2003, 09:33 PM
|
#1
|
Member
Registered: Jan 2003
Posts: 42
Rep:
|
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?
|
|
|
02-10-2003, 02:59 PM
|
#2
|
Member
Registered: Oct 2002
Location: Curitiba - Brazil
Distribution: Conectiva
Posts: 334
Rep:
|
Strange, look at /proc/ide/hd?/capacity to see what it says ...
|
|
|
02-10-2003, 09:56 PM
|
#3
|
Member
Registered: Jan 2003
Posts: 42
Original Poster
Rep:
|
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
|
|
|
02-11-2003, 11:09 AM
|
#4
|
Member
Registered: Oct 2002
Location: Curitiba - Brazil
Distribution: Conectiva
Posts: 334
Rep:
|
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>
|
|
|
02-11-2003, 09:33 PM
|
#5
|
Member
Registered: Jan 2003
Posts: 42
Original Poster
Rep:
|
But, from the code you quoted, my harddisk will use the bios setting. (not in ignored case since the sector is 63 only).
|
|
|
All times are GMT -5. The time now is 08:56 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|