LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-16-2005, 03:21 AM   #1
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 374

Rep: Reputation: 55
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.
 
Old 09-17-2005, 04:29 AM   #2
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
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).
 
Old 09-17-2005, 08:00 AM   #3
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 374

Original Poster
Rep: Reputation: 55
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.
 
Old 09-17-2005, 02:59 PM   #4
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
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?
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost partition table mngmd Linux - General 1 11-13-2005 09:34 PM
lost partition table linuxenthusiast Linux - General 8 02-25-2005 02:34 AM
another lost partition table in Drake 10 fostytou Linux - Software 1 05-04-2004 11:22 AM
fdisk gives me warnign about cylinder boundaries.. zeppelin Linux - Hardware 2 10-19-2003 08:44 AM
Lost partition table amp2000 Linux - General 6 10-28-2001 01:12 PM


All times are GMT -5. The time now is 02:31 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration