[opensuse] How to align for 4kb sectors?
I've installed a new RAID array in my home server and the disks are using 4KB sectors instead of the traditional 512 byte sectors. How do I properly align the partitions to this disk? YaST partitioner shows "cylinders" and I can not come up with a formula to convert cylinders to sectors. My understanding is since 8 x 512 = 4096 (4kb) all I need to do is ensure that my partitions are aligned to multiples of 8 sectors. -- Med Vennlig Hilsen, A. Helge Joakimsen -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2011. 01. 17., Monday 05:43:29 Andrew Joakimsen wrote:
I've installed a new RAID array in my home server and the disks are using 4KB sectors instead of the traditional 512 byte sectors.
How do I properly align the partitions to this disk? YaST partitioner shows "cylinders" and I can not come up with a formula to convert cylinders to sectors. My understanding is since 8 x 512 = 4096 (4kb) all I need to do is ensure that my partitions are aligned to multiples of 8 sectors.
Unfortunately, it is not that trivial as aligning partition boundaries to multiples of 8. See this article (and comments): http://lwn.net/Articles/377895/ As for cylinder size, try fdisk from the command line. If you print the partition table for the drive (command is "p") then you get cylinder size. Tom -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, Jan 17, 2011 at 3:42 AM, <benefici@fastmail.fm> wrote:
On 2011. 01. 17., Monday 05:43:29 Andrew Joakimsen wrote:
I've installed a new RAID array in my home server and the disks are using 4KB sectors instead of the traditional 512 byte sectors.
How do I properly align the partitions to this disk? YaST partitioner shows "cylinders" and I can not come up with a formula to convert cylinders to sectors. My understanding is since 8 x 512 = 4096 (4kb) all I need to do is ensure that my partitions are aligned to multiples of 8 sectors.
Unfortunately, it is not that trivial as aligning partition boundaries to multiples of 8. See this article (and comments): http://lwn.net/Articles/377895/
That article is concerned with 4KB physical sector drives with 4KB logical sector addressing. That is highly uncommon. Most drives of concern have 4KB physical and 512 byte logical sectors. For them, alignment is the only issue. hdparm can show you your logical / physical sector size and I think both are in /sys/block/sda/queue/*. You can use a liveCD to look at that I assume prior to installing. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2011. 01. 17., Monday 15:15:13 Greg Freemyer wrote:
On Mon, Jan 17, 2011 at 3:42 AM, <benefici@fastmail.fm> wrote:
On 2011. 01. 17., Monday 05:43:29 Andrew Joakimsen wrote:
I've installed a new RAID array in my home server and the disks are using 4KB sectors instead of the traditional 512 byte sectors.
How do I properly align the partitions to this disk? YaST partitioner shows "cylinders" and I can not come up with a formula to convert cylinders to sectors. My understanding is since 8 x 512 = 4096 (4kb) all I need to do is ensure that my partitions are aligned to multiples of 8 sectors.
Unfortunately, it is not that trivial as aligning partition boundaries to multiples of 8. See this article (and comments): http://lwn.net/Articles/377895/
That article is concerned with 4KB physical sector drives with 4KB logical sector addressing. That is highly uncommon.
Please check again. A quote: "One simply cannot run XP on a device which has been properly partitioned for 4K physical sector sizes. To cope with that, drive manufacturers have introduced an even worse hack: shifting all 512-byte logical sectors forward by one, so that logical sector 64 lands at the beginning of a physical sector. So any partitioning tool which wants to lay things out properly must know where the origin of the device actually is - and not all devices are entirely forthcoming with that information. " This is the main reason I referred the original poster to the article: 512-byte logical sectors may be shifted by one.
Most drives of concern have 4KB physical and 512 byte logical sectors.
For them, alignment is the only issue.
hdparm can show you your logical / physical sector size and I think both are in /sys/block/sda/queue/*. You can use a liveCD to look at that I assume prior to installing.
Greg
Tom -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, Jan 17, 2011 at 10:25 AM, <benefici@fastmail.fm> wrote:
On 2011. 01. 17., Monday 15:15:13 Greg Freemyer wrote:
On Mon, Jan 17, 2011 at 3:42 AM, <benefici@fastmail.fm> wrote:
On 2011. 01. 17., Monday 05:43:29 Andrew Joakimsen wrote:
I've installed a new RAID array in my home server and the disks are using 4KB sectors instead of the traditional 512 byte sectors.
How do I properly align the partitions to this disk? YaST partitioner shows "cylinders" and I can not come up with a formula to convert cylinders to sectors. My understanding is since 8 x 512 = 4096 (4kb) all I need to do is ensure that my partitions are aligned to multiples of 8 sectors.
Unfortunately, it is not that trivial as aligning partition boundaries to multiples of 8. See this article (and comments): http://lwn.net/Articles/377895/
That article is concerned with 4KB physical sector drives with 4KB logical sector addressing. That is highly uncommon.
Please check again. A quote: "One simply cannot run XP on a device which has been properly partitioned for 4K physical sector sizes. To cope with that, drive manufacturers have introduced an even worse hack: shifting all 512-byte logical sectors forward by one, so that logical sector 64 lands at the beginning of a physical sector. So any partitioning tool which wants to lay things out properly must know where the origin of the device actually is - and not all devices are entirely forthcoming with that information. "
This is the main reason I referred the original poster to the article: 512-byte logical sectors may be shifted by one.
You're right, I didn't read it closely. And I had forgotten about the offset problem. That concept basically fell by the wayside a couple years ago and I don't think any new shipping drives have a offset. The key piece of the article is: === With luck, the off-by-one problem will go away before it becomes a big issue. As James Bottomley put it: "...fortunately very few of these have been seen in the wild and we're hopeful they can be shot before they breed." But that doesn't fix the problem with the alignment of partitions for use by XP. === Drives with the off-by-one issue are still very rare. And as the article you point out says, the issue of supporting disks as they are actually shipping is not Linux's, it's XPs. Basically I gather one is ill-advised to run XP from a drive with 4KB sectors. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Andrew Joakimsen wrote:
I've installed a new RAID array in my home server and the disks are using 4KB sectors instead of the traditional 512 byte sectors.
How do I properly align the partitions to this disk? YaST partitioner shows "cylinders" and I can not come up with a formula to convert cylinders to sectors. My understanding is since 8 x 512 = 4096 (4kb) all I need to do is ensure that my partitions are aligned to multiples of 8 sectors.
That is correct. (or at least that is also my understanding). -- Per Jessen, Zürich (3.2°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, Jan 16, 2011 at 11:43 PM, Andrew Joakimsen <joakimsen@gmail.com> wrote:
I've installed a new RAID array in my home server and the disks are using 4KB sectors instead of the traditional 512 byte sectors.
How do I properly align the partitions to this disk? YaST partitioner shows "cylinders" and I can not come up with a formula to convert cylinders to sectors. My understanding is since 8 x 512 = 4096 (4kb) all I need to do is ensure that my partitions are aligned to multiples of 8 sectors.
The installer and yast-partitioner auto-detect drive topology in openSUSE11.3 (and newer). Since you mention raid, the alignment should not only be to a 4KB sector, it should be to a full raid stripe, but not raid is supported yet I suspect. Look in /sys/block/*/queue for various topology data. (/sys is a kernel interface, not actual files). If partitions are not auto-aligned, please file a bug. Prior to 11.3 you're on your own. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, Jan 17, 2011 at 9:06 AM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
stripe, but not raid is supported yet I suspect.
but not all raid is supported yet I suspect. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, Jan 17, 2011 at 09:07, Greg Freemyer <greg.freemyer@gmail.com> wrote:
On Mon, Jan 17, 2011 at 9:06 AM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
stripe, but not raid is supported yet I suspect.
but not all raid is supported yet I suspect.
The RAID reports it is 512kb sectors. (I think the same thing happens with the disk direct) None of this helps answer my questions or get the partitions setup correctly: 1) How can I show sectors (instead of cylinders) in Yast partitioner? OR 2) How can I convert cylinders to sectors? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, Feb 3, 2011 at 3:07 PM, Andrew Joakimsen <joakimsen@gmail.com> wrote:
On Mon, Jan 17, 2011 at 09:07, Greg Freemyer <greg.freemyer@gmail.com> wrote:
On Mon, Jan 17, 2011 at 9:06 AM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
stripe, but not raid is supported yet I suspect.
but not all raid is supported yet I suspect.
The RAID reports it is 512kb sectors. (I think the same thing happens with the disk direct)
None of this helps answer my questions or get the partitions setup correctly:
1) How can I show sectors (instead of cylinders) in Yast partitioner? OR 2) How can I convert cylinders to sectors?
Did you read my post that the Yast Partitioner with openSUSE 11.3 will do it automatically. With older openSUSE, I don't know of a non-expert way. For an expert, I would likely use sfdisk, but there are lots of partitioners and you will be having to force them to work. If you go with sfdisk, you can start with something like: === # partition table of /dev/sda unit: sectors /dev/sda1 : start= 63, size= 4208967, Id=82 /dev/sda2 : start= 4209030, size= 41945715, Id=83 /dev/sda3 : start= 46154745, size=104872320, Id=83 /dev/sda4 : start=151027065, size=337365000, Id= f, bootable /dev/sda5 : start=151027128, size= 41945652, Id=83 /dev/sda6 : start=192972843, size=295419222, Id=83 ==== Hand edit that to be what you want and the run it back into sfdisk. It is not a trivial exercise, so I suggest you google for a tutorial. The only good part of it is that you are working with units of sectors, not cylinders. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thu, Feb 3, 2011 at 16:58, Greg Freemyer <greg.freemyer@gmail.com> wrote:
Did you read my post that the Yast Partitioner with openSUSE 11.3 will do it automatically.
Yes but when I look in /sys/block/sdb/queue there is nothing different than any other disk. Therefore how is the partitioner determining to do it automatically? I don't think it is. And none of the responses are helping to setup a correct partion scheme in Yast. All I want to know is how to show sectors in yast or how to convert sectors to cylinders! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2011/02/03 19:44 (GMT-0500) Andrew Joakimsen composed:
All I want to know is ... how to convert sectors to cylinders!
These things are not carved in stone, but mere logic convention. Most common is 255 (heads) times 63 (sectors per track) = (16065 SPC) on disks up to 2048G. Also common, but mostly on laptops, is 240 times 63 = (15120 SPC). Neither are compatible with 4k alignment. >2T convention I believe is too new for there to be an established convention except if EFI BIOS GPT is used. -- "How much better to get wisdom than gold, to choose understanding rather than silver." Proverbs 16:16 NKJV Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Andrew Joakimsen
-
benefici@fastmail.fm
-
Felix Miata
-
Greg Freemyer
-
Per Jessen