1

Attempting to set up dual boot Windows 7 and Arch Linux.

Samsung 840 EVO 120GB SSD.

Erase Block Size: 1536KiB. Sectors: 3072 (512 * 3072 = 1572864 = 1024 * 1536)

This appears to be straightforward when partitioning the drive with GPT.

However, I already have Windows 7 installed where I did it by booting the USB install media via USB (and not UEFI) so Windows 7 installed itself on the disk with an MBR.

Therefore when I am trying to install Arch and I run fdisk -b 3072 /dev/sda it fails because 3072 is invalid, but it accepts -b 4096. It appears to assume that no SSD exists which is not actually block aligned to 1 or 2MB boundaries.

Similarly, Windows' 100MB System Reserved partition starts at sector 2048. This is also not aligned!

What to do? Can I rescue or kludge this to save reinstalling Windows? Or am I operating under false assumptions? There is a lot of confusing information out there, much of which is probably outdated.

1 Answer 1

3

Don't use fdisk's -b option in this context! That option sets the disk's logical sector size, which you should not need to set, because the kernel almost invariably detects it correctly. You'd only need that option if you had a buggy driver or were doing development work with a virtual disk or something like that.

Instead, what you should do is to manually compute the optimum alignment value. For instance, if you know you want a partition to begin at somewhere around sector 200000, you would:

  1. Divide 200,000 by 3072, yielding 65.1.
  2. Round up (or possibly down, if there's space before your initial start-point guess), yielding 66.
  3. Multiply by 3072, yielding 202,752.
  4. Enter that value as the start point for the partition.
  5. Enter the desired end point or partition length. Note that the end point does not need to be aligned, although if you make it 1 less than a multiple of 3072, the result will be no wasted space between partitions.

This is most easily done with fdisk or parted, although if you want to use parted you must type unit s to set units to sectors. (Recent versions of fdisk default to units of sectors.) GParted is pretty much hopeless for this task. Note that you needn't bother with aligning your extended partition; it holds just a single 512-byte data structure of its own, so in a very real sense, it can't be properly aligned. The logical partitions contained within the extended partition should be properly aligned, though.

When you're done, divide all your partition start points by 3072. They should all be whole numbers (again, with the possible exception of the extended partition).

2
  • Thanks for clarifying! If you (or anyone else!) has more information and references/links, please post them.
    – Steven Lu
    Commented May 11, 2014 at 21:56
  • Looks like Windows' C:/, which is /dev/sda2, is at sector 206848 which is on a 1MiB boundary. This is perhaps not ideal. I'll want to customize the install next time to adjust it, I think. Anyway this all probably doesn't matter too much, it's a pretty modern SSD...
    – Steven Lu
    Commented May 12, 2014 at 1:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .