LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Partition Table (Cylinder boundaries) and lost space (https://www.linuxquestions.org/questions/linux-general-1/partition-table-cylinder-boundaries-and-lost-space-363856/)

imitheos 09-16-2005 03:21 AM

Partition Table (Cylinder boundaries) and lost space
 
Hello.
I didn't find anything in search so i am asking.
I have a doubt if this is the proper forum or hardware forum but i think itisn't pure hardware
question.

My question is why should a partition end on a cylinder boundary when Linux doesn't use
CHS (I don't care about compatibility with windows).

Let me mention an example.
I have a 80GB sata disk. "SCSI device sdb: 156250000 512-byte hdwr sectors (80000 MB)"
It has 156,250,000 sectors. When i run fdisk/cfdisk I get the geometry of C9726,H255,S63
which pretty much is the default used by large disks in LBA (H255,S63 and C is total
sectors/255/63).

This results to 156,248,190 sectors.
The first partition starts in 63 sector (due to DOS compatibility that the first head was unused)
which is not needed for linux and cfdisk has a maximize command that starts the partition in
sector 1. Ok with this.

But i can't use the sectors from 156,248,190 and beyond.
fdisk let you choose them if you use "sector mode" and not "cylinder mode(default)", but
when you run cfdisk or "sfdisk -V" or any other tool you get the message that the partition
runs beyond the end of the disk.

The sectors that are not used are 1810 which results to 926,720 . I don't ask about the
wasted space which is 1M but just why this is happening.

the fdisk manual mentions:
Code:

In a DOS type partition table the starting offset and the size of  each
partition  is  stored  in  two  ways:  as an absolute number of sectors
(given in 32 bits) and as a Cylinders/Heads/Sectors  triple  (given  in
10+8+6  bits).  The former is OK - with 512-byte sectors this will work
up to 2 TB. The latter has two different problems. First of all,  these
C/H/S fields can be filled only when the number of heads and the number
of sectors per track are known. Secondly, even if we  know  what  these
numbers  should be, the 24 bits that are available do not suffice.  DOS
uses C/H/S only, Windows uses both, Linux never uses C/H/S.

So, linux partitioning tools should let you use all the sectors.
Am i right ?
Is there a way to use all the sectors ?

I tried to use a different geometry when creating the partition table. I used C12500,H250,S50
and it works. I can get all the sectors, but "sfdisk -l /dev/sdb" mentions:

Code:

Disk /dev/sdb: 9726 cylinders, 255 heads, 63 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/250/50 (instead of 9726/255/63).
For this listing I'll assume that geometry.

Nowadays, disks don't have a fixed geometry, so what is reported to BIOS or anywhere
shouldn't matter but i ask in order to be sure i don't break anything.

Thank you for your time.

addy86 09-17-2005 04:29 AM

Since you're not going to run another OS than Linux, you should have no problems (without guarantee).
If you want to avoid the wasted sectors, you could manually edit the partition data on disk (Don't do it! I've done it once (for other reasons), and it worked, but 1 MB is not worth the effort).

imitheos 09-17-2005 08:00 AM

Quote:

Originally posted by addy86
Since you're not going to run another OS than Linux, you should have no problems (without guarantee).
If you want to avoid the wasted sectors, you could manually edit the partition data on disk (Don't do it! I've done it once (for other reasons), and it worked, but 1 MB is not worth the effort).

I am capable of manually editing the partition table but i don't need to since i can avoid the waste space by using some
partition tool. It is not about the 1MB.I asked to know why this is happening.

Thank you for replying.

addy86 09-17-2005 02:59 PM

I guess the reason is: to stay backwards compatible. But maybe nowerdays it would be better to make the standard behaviour of partition programs to not align the partition to some antique boundaries, or at least provide an option to avoid the alignment; after all, partitions behind the first couple of physical GB can't be accessed using CHS, so why remain backwards-compatible?


All times are GMT -5. The time now is 07:59 PM.