FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 02-26-2010, 11:09 PM
walt
 
Default Who believes in cylinders?

There's been some talk here recently about partitions versus cylinder
boundaries, and when or even if they need to line up properly.

I'm confused. For many years now I've ignored "cylinders" completely
because I've read that modern disks are addressed by sector number only,
and disks don't know or care about cylinders. The "cylinder" seems to
be a fiction that sticks around like a drunk who refuses to leave when
the party is over.

The recent thread about the new disks with 1024-byte sectors has me
even more confused.

IIUC the new disks *do* care (at least) about where a partition
begins relative to it's own 1024-byte hardware sectors, and that
part makes perfect sense.

But, to me, that still leaves the "cylinder" as a completely useless
fiction that needs to join MSDOS in the scrap heap of history.

Am I right to separate the 1024-byte sector problem from "cylinders"
as being two entirely different and orthogonal ideas?

Is there really any need for the "cylinder" these days?

Happy Friday
 
Old 02-26-2010, 11:22 PM
Volker Armin Hemmann
 
Default Who believes in cylinders?

On Samstag 27 Februar 2010, walt wrote:
> There's been some talk here recently about partitions versus cylinder
> boundaries, and when or even if they need to line up properly.
>
> I'm confused. For many years now I've ignored "cylinders" completely
> because I've read that modern disks are addressed by sector number only,
> and disks don't know or care about cylinders. The "cylinder" seems to
> be a fiction that sticks around like a drunk who refuses to leave when
> the party is over.
>
> The recent thread about the new disks with 1024-byte sectors has me
> even more confused.
>
> IIUC the new disks *do* care (at least) about where a partition
> begins relative to it's own 1024-byte hardware sectors, and that
> part makes perfect sense.
>
> But, to me, that still leaves the "cylinder" as a completely useless
> fiction that needs to join MSDOS in the scrap heap of history.
>
> Am I right to separate the 1024-byte sector problem from "cylinders"
> as being two entirely different and orthogonal ideas?
>
> Is there really any need for the "cylinder" these days?
>
> Happy Friday

no. Until you have to beat fdisk into submission. Yes, cylinders are
anachronistic crap. Sadly a lot of tools (and the kernel) are still infected.
 
Old 02-27-2010, 12:31 AM
Mark Knecht
 
Default Who believes in cylinders?

On Fri, Feb 26, 2010 at 4:09 PM, walt <w41ter@gmail.com> wrote:
<SNIP>
> The recent thread about the new disks with 1024-byte sectors has me
> even more confused.

<hehe> Very sorry. ;-)

>
> IIUC the new disks *do* care (at least) about where a partition
> begins relative to it's own 1024-byte hardware sectors, and that
> part makes perfect sense.

And that is really the important point from that thread.

>
> But, to me, that still leaves the "cylinder" as a completely useless
> fiction that needs to join MSDOS in the scrap heap of history.

I believe you're correct.

>
> Am I right to separate the 1024-byte sector problem from "cylinders"
> as being two entirely different and orthogonal ideas?

Yes. Cylinders do exist on the disk but they are not something to be
used anymore.

>
> Is there really any need for the "cylinder" these days?

No, not as I understand it.

There may be some bits of software that suggest they can use them, but
I think with the advent of LBA directly addressing CHS is now retired
with only sector addressing being important due to the way the data is
physically placed on the drive. Who cares what cylinder it's on, and
who cares which head is getting the data? It doesn't matter to us
users...

Cheers,
Mark
 
Old 02-27-2010, 01:23 AM
BRM
 
Default Who believes in cylinders?

----- Original Message ----

> From: Mark Knecht <markknecht@gmail.com>
> To: gentoo-user@lists.gentoo.org
> On Fri, Feb 26, 2010 at 4:09 PM, walt wrote:
> > Is there really any need for the "cylinder" these days?
> No, not as I understand it.
> There may be some bits of software that suggest they can use them, but
> I think with the advent of LBA directly addressing CHS is now retired
> with only sector addressing being important due to the way the data is
> physically placed on the drive. Who cares what cylinder it's on, and
> who cares which head is getting the data? It doesn't matter to us
> users...

True user's don't care. However, Boot Loader writers (e.g. grub) need to care about it since LBA is not quite available right away - you have to focus on other things until you can load the rest of the boot loader.

So it's not 100% dead, but yes - most things no longer need to care about it.

Ben
 
Old 02-27-2010, 03:53 PM
walt
 
Default Who believes in cylinders?

On 02/26/2010 06:23 PM, BRM wrote:

----- Original Message ----


From: Mark Knecht<markknecht@gmail.com>
On Fri, Feb 26, 2010 at 4:09 PM, walt wrote:

Is there really any need for the "cylinder" these days?



Who cares what cylinder it's on, and
who cares which head is getting the data? It doesn't matter to us
users...



...Boot Loader writers (e.g. grub) need to care about it since LBA

> is not quite available right away - you have to focus on other things
> until you can load the rest of the boot loader.

Ah, this may be a big part of what's confusing me because I've done a
lot of playing around with grub.

At what point *does* LBA become available, and who makes it available?
Is this one of those stupid BIOS things?
 
Old 02-27-2010, 05:04 PM
Mark Knecht
 
Default Who believes in cylinders?

On Sat, Feb 27, 2010 at 8:53 AM, walt <w41ter@gmail.com> wrote:
> On 02/26/2010 06:23 PM, BRM wrote:
>>
>> ----- Original Message ----
>>
>>> From: Mark Knecht<markknecht@gmail.com>
>>> On Fri, Feb 26, 2010 at 4:09 PM, walt wrote:
>>>>
>>>> Is there really any need for the "cylinder" these days?
>
>>> Who cares what cylinder it's on, and
>>> who cares which head is getting the data? It doesn't matter to us
>>> users...
>
>> ...Boot Loader writers (e.g. grub) need to care about it since LBA
>
>> is not quite available right away - you have to focus on other things
>> until you can load the rest of the boot loader.
>
> Ah, this may be a big part of what's confusing me because I've done a
> lot of playing around with grub.
>
> At what point *does* LBA become available, and who makes it available?
> Is this one of those stupid BIOS things?
>

I don't think that it's specifically a BIOS thing, but BIOS is
involved at least on older machines.

LBA is always 'available' (as far as I know) because it's in the hard
drive. It's the way the drive expects the system to talk to it. The
issue is how do the software layers talk with the drive.

In the case of very old PC hardware, and I think it still exists for
compatibility reasons, programs used to use a IBM BIOS call - Int13 I
think - to talk to the drive at all. I'm not a software guy, and
certainly not an IBM BIOS assembly language guy, but it may be that
the Int13 call to BIOS required CHS. I don't know.

Basically you have to make some sort of call to find the drive and get
things moving. If BIOS enables LBA under the hood, which I expect it
does these days, then the Int13 call using CHS gets converted to LBA
and sent across the cable. The drive is however (I think) ALWAYS
responding to LBA. There's not a lot of reason for them to support
anything else excpet for internal testing.

Note that since CHS to LBA conversion is just a bunch of integer
multiples and adds if the system BIOS takes an Int13 call with CHS as
input it's simple for it to convert it to LBA, and since the important
part is sector alignment which is the least significant part it's the
one that most closely matches with the numbers in the LBA.

I'm pretty sure that once your system starts booting the consistent
use of LBA through the whole stack happens as the kernel gets itself
and appropriate drivers loaded, but again, this is all supposition on
my part. Once those are up and running it's probably LBA completely
and CHS isn't important. Note that for big drives it seems that fdisk
will __always__ tell me the drive has 63 sectors/track and 255 heads
but I sincerely doubt that's true physically.

Hope this helps, and I hope I'm not too far off base. Read more here
and help me understand better:

http://en.wikipedia.org/wiki/Logical_block_addressing

http://en.wikipedia.org/wiki/INT13

Cheers,
Mark
 
Old 02-27-2010, 05:17 PM
BRM
 
Default Who believes in cylinders?

----- Original Message ----

> From: walt <w41ter@gmail.com>
> To: gentoo-user@lists.gentoo.org
> On 02/26/2010 06:23 PM, BRM wrote:
> >> From: Mark Knecht
> >> On Fri, Feb 26, 2010 at 4:09 PM, walt wrote:
> >>> Is there really any need for the "cylinder" these days?
> >> Who cares what cylinder it's on, and
> >> who cares which head is getting the data? It doesn't matter to us
> >> users...
> > ...Boot Loader writers (e.g. grub) need to care about it since LBA
> > is not quite available right away - you have to focus on other things
> > until you can load the rest of the boot loader.
> Ah, this may be a big part of what's confusing me because I've done a
> lot of playing around with grub.
> At what point *does* LBA become available, and who makes it available?
> Is this one of those stupid BIOS things?

It becomes available once you can start processing enough instructions to support it.

Boot Loaders are typically broken into two or three parts: Stage 1, Stage 2, and (optionally) Stage 3.
Stage 1 focuses solely on loading Stage 2, and has historically been limited to a total size[1] to 512 bytes, actually 510 bytes as you should have a 2 byte bootable id at bytes 511 and 512). This limitation is primarily because the BIOS loads just the first sector on the bootable disk (identified by those two bytes) into memory. Now perhaps someone may be able to write assembly craftily enough to use LBA in the first stage.

Usually LBA is enabled in Stage 2 - since more code space is available you can do more - enable protected/long mode, page memory, load more code from disk, etc; so you don't have as many limitations. Intel/etc. were looking to change this somewhat with the EFI BIOSes, but I'm not sure that succeeded.

You'll have to talk to the grub/lilo/etc guys to get a better feel for this; but that's what I'm aware of.

Ben

[1] on x86 at least, other systems (e.g. Sun SPARC) build more into the "BIOS" to boot
loaders get more functionality faster and don't have to worry about it.
 
Old 02-27-2010, 05:20 PM
Etaoin Shrdlu
 
Default Who believes in cylinders?

On Saturday 27 February 2010, BRM wrote:

> Stage 1 focuses solely on loading Stage 2,
> and has historically been limited to a total size[1] to 512 bytes,

It's actually less than that, because the first 64 bytes of sector 0 contain
the partition table, so the maximum size of a stage1 bootloader is 510 - 64 =
446 bytes.
 
Old 02-28-2010, 10:13 AM
Mick
 
Default Who believes in cylinders?

On Saturday 27 February 2010 18:20:24 Etaoin Shrdlu wrote:
> On Saturday 27 February 2010, BRM wrote:
> > Stage 1 focuses solely on loading Stage 2,
> > and has historically been limited to a total size[1] to 512 bytes,
>
> It's actually less than that, because the first 64 bytes of sector 0
> contain the partition table, so the maximum size of a stage1 bootloader is
> 510 - 64 = 446 bytes.

Yep, that's why dd if=/dev/sda of=~/partition_table.img bs=446 count=1 will
make you a nice back up of your partition table, while bs=512 will back up
your complete MBR.
--
Regards,
Mick
 
Old 02-28-2010, 01:12 PM
David W Noon
 
Default Who believes in cylinders?

On Sun, 28 Feb 2010 13:10:02 +0100, Mick wrote about Re: [gentoo-user]
Re: Who believes in cylinders?:

>On Saturday 27 February 2010 18:20:24 Etaoin Shrdlu wrote:
>> On Saturday 27 February 2010, BRM wrote:
>> > Stage 1 focuses solely on loading Stage 2,
>> > and has historically been limited to a total size[1] to 512 bytes,
>>
>> It's actually less than that, because the first 64 bytes of sector 0
>> contain the partition table, so the maximum size of a stage1
>> bootloader is 510 - 64 = 446 bytes.
>
>Yep, that's why dd if=/dev/sda of=~/partition_table.img bs=446 count=1
>will make you a nice back up of your partition table,

Actually, it will backup your primary bootstrap code. Try:

dd if=/dev/sda of=~/partition_table.img bs=1 skip=446 count=64

Note that you will need to be root or in the "disk" group (or
equivalent on your system), so that you have access to /dev/sda as a
raw device file. [As ever, sudo is your friend.]

Also note that this backup will only contain the primary partitions and
any extended partition on that disk; all the logical drives within the
extended partition are mapped by secondary partition tables in their
local bootstrap records (LBRs). This makes for a more complicated
process to backup the complete partition table for the disk.

Worse still, all of my machines have at least 4 hard drives -- some as
many as 7. So this process has to be repeated for each physical disk.

Many years ago I wrote an OS/2 program to handle all of this. Perhaps I
should blow the dust off it, convert it to use POSIX functions and
publish it as FOSS.

> while bs=512 will back up your complete MBR.

True.
--
Regards,

Dave [RLU #314465]
================================================== ====================
dwnoon@ntlworld.com (David W Noon)
================================================== ====================
 

Thread Tools




All times are GMT. The time now is 08:50 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org