* Re: [gentoo-user] Re: Who believes in cylinders? [not found] ` <eiQ8a-2QF-3@gated-at.bofh.it> @ 2010-02-28 14:12 ` David W Noon 2010-02-28 18:29 ` Andrea Conti 0 siblings, 1 reply; 8+ messages in thread From: David W Noon @ 2010-02-28 14:12 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 1900 bytes --] 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) ====================================================================== [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] Re: Who believes in cylinders? 2010-02-28 14:12 ` [gentoo-user] Re: Who believes in cylinders? David W Noon @ 2010-02-28 18:29 ` Andrea Conti 0 siblings, 0 replies; 8+ messages in thread From: Andrea Conti @ 2010-02-28 18:29 UTC (permalink / raw To: gentoo-user > 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. Why reinvent the wheel? Just use 'sfdisk -d'. andrea ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <eiSWl-6VZ-9@gated-at.bofh.it>]
[parent not found: <eiSWl-6VZ-11@gated-at.bofh.it>]
[parent not found: <eiSWl-6VZ-13@gated-at.bofh.it>]
[parent not found: <eiSWl-6VZ-15@gated-at.bofh.it>]
[parent not found: <eiSWl-6VZ-7@gated-at.bofh.it>]
[parent not found: <eiWGC-44p-9@gated-at.bofh.it>]
* Re: [gentoo-user] Re: Who believes in cylinders? [not found] ` <eiWGC-44p-9@gated-at.bofh.it> @ 2010-02-28 20:28 ` David W Noon 0 siblings, 0 replies; 8+ messages in thread From: David W Noon @ 2010-02-28 20:28 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 846 bytes --] On Sun, 28 Feb 2010 20:10:02 +0100, Andrea Conti wrote about Re: [gentoo-user] Re: Who believes in cylinders?: >> 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. > >Why reinvent the wheel? Just use 'sfdisk -d'. No reinvention required: I already have an old wheel in the garage. There are already several Linux programs that can display partition tables, and present them in a manner more useful than a dd of some bytes from the MBR: fdisk, sfdisk, parted, etc. Mine would simply be another. -- Regards, Dave [RLU #314465] ====================================================================== dwnoon@ntlworld.com (David W Noon) ====================================================================== [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-user] Who believes in cylinders? @ 2010-02-27 0:09 walt 2010-02-27 1:31 ` Mark Knecht 0 siblings, 1 reply; 8+ messages in thread From: walt @ 2010-02-27 0:09 UTC (permalink / raw To: gentoo-user 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 :) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] Who believes in cylinders? 2010-02-27 0:09 [gentoo-user] " walt @ 2010-02-27 1:31 ` Mark Knecht 2010-02-27 2:23 ` BRM 0 siblings, 1 reply; 8+ messages in thread From: Mark Knecht @ 2010-02-27 1:31 UTC (permalink / raw To: gentoo-user 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] Who believes in cylinders? 2010-02-27 1:31 ` Mark Knecht @ 2010-02-27 2:23 ` BRM 2010-02-27 16:53 ` [gentoo-user] " walt 0 siblings, 1 reply; 8+ messages in thread From: BRM @ 2010-02-27 2:23 UTC (permalink / raw To: gentoo-user ----- 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-user] Re: Who believes in cylinders? 2010-02-27 2:23 ` BRM @ 2010-02-27 16:53 ` walt 2010-02-27 18:04 ` Mark Knecht 2010-02-27 18:17 ` BRM 0 siblings, 2 replies; 8+ messages in thread From: walt @ 2010-02-27 16:53 UTC (permalink / raw To: gentoo-user 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? ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] Re: Who believes in cylinders? 2010-02-27 16:53 ` [gentoo-user] " walt @ 2010-02-27 18:04 ` Mark Knecht 2010-02-27 18:17 ` BRM 1 sibling, 0 replies; 8+ messages in thread From: Mark Knecht @ 2010-02-27 18:04 UTC (permalink / raw To: gentoo-user 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] Re: Who believes in cylinders? 2010-02-27 16:53 ` [gentoo-user] " walt 2010-02-27 18:04 ` Mark Knecht @ 2010-02-27 18:17 ` BRM 2010-02-27 18:20 ` Etaoin Shrdlu 1 sibling, 1 reply; 8+ messages in thread From: BRM @ 2010-02-27 18:17 UTC (permalink / raw To: gentoo-user ----- 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. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] Re: Who believes in cylinders? 2010-02-27 18:17 ` BRM @ 2010-02-27 18:20 ` Etaoin Shrdlu 2010-02-28 11:13 ` Mick 0 siblings, 1 reply; 8+ messages in thread From: Etaoin Shrdlu @ 2010-02-27 18:20 UTC (permalink / raw To: gentoo-user 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. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] Re: Who believes in cylinders? 2010-02-27 18:20 ` Etaoin Shrdlu @ 2010-02-28 11:13 ` Mick 0 siblings, 0 replies; 8+ messages in thread From: Mick @ 2010-02-28 11:13 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: Text/Plain, Size: 605 bytes --] 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 [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-02-28 20:29 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <eiiJc-4g9-7@gated-at.bofh.it> [not found] ` <eizqG-3Da-15@gated-at.bofh.it> [not found] ` <eiAd4-4Q4-35@gated-at.bofh.it> [not found] ` <eiQ8a-2QF-3@gated-at.bofh.it> 2010-02-28 14:12 ` [gentoo-user] Re: Who believes in cylinders? David W Noon 2010-02-28 18:29 ` Andrea Conti [not found] <eiSWl-6VZ-9@gated-at.bofh.it> [not found] ` <eiSWl-6VZ-11@gated-at.bofh.it> [not found] ` <eiSWl-6VZ-13@gated-at.bofh.it> [not found] ` <eiSWl-6VZ-15@gated-at.bofh.it> [not found] ` <eiSWl-6VZ-7@gated-at.bofh.it> [not found] ` <eiWGC-44p-9@gated-at.bofh.it> 2010-02-28 20:28 ` David W Noon 2010-02-27 0:09 [gentoo-user] " walt 2010-02-27 1:31 ` Mark Knecht 2010-02-27 2:23 ` BRM 2010-02-27 16:53 ` [gentoo-user] " walt 2010-02-27 18:04 ` Mark Knecht 2010-02-27 18:17 ` BRM 2010-02-27 18:20 ` Etaoin Shrdlu 2010-02-28 11:13 ` Mick
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox