Aligned partitioning of 2TB disk with Linux fdisk
Recent versions of fdisk
start the first partition at sector 2048 by default. If you're seeing some other behavior, then either you're using a rather elderly version of fdisk
or there's a bug in the version of fdisk
that you're using.
You could also use parted
or GParted for this task. They both work with MBR disks as well as with GPT disks, so using one of these tools does not necessitate switching to GPT. That said, GPT does have certain advantages, even on smaller disks. They're minor, but you might want to consider using GPT to get these advantages. (These include having CRCs of important data structures to spot problems, having a backup of important data structures to help recovery from some types of problems, having partition labels, eliminating the awkward primary/extended/logical quagmire, and of course supporting over-2TiB disks.)
UPDATE:
Newer versions of fdisk (e.g. v2.20.1) do not have the issue of truncating the cluster number as described in the question any more. Therefore, one can now simply use
fdisk -c /dev/sdX
to create a partition starting at 2048 and ending at 3906252047 to create the desired layout.
ORIGINAL ANSWER:
I found one way to do it:
fdisk -S 16 -H 1 -c /dev/sdX
Then, I can create a partition that starts at 129 and ends at 244,140,753.
Now, if I do fdisk -l -u /dev/sdX
, I will get:
Disk /dev/sdX: 2000.4 GB, 2000365289472 bytes
1 heads, 16 sectors/track, 244185216 cylinders, total 3906963456 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xee3e796d
Device Boot Start End Blocks Id System
/dev/sdX1 2048 3906252047 1953125000 fd Linux raid autodetect
and blockdev --getsize64 /dev/sdX1
gives me exactly 2,000,000,000,000.
Now the big question: Does anyone see a problem with the -S 16 -H 1? :)