i was putting a 2.5" 500G WD disk into a usb enclosure
and i noticed that instead of technical information
they used to put there (chs, lba, etc) most of the
space was taken up by a notice about this being
"advenced format drive", and how speed will suffer if
used with windows xp, etc, without partition
realignment.

and it had jumpers -- i haven't seen jumpers on drives
for ages.  IIUC, the jumpers can be used to indicate an
"offset-by-one": make LBA 63 aligned on hardware
sector.  quite the backwards compatibility.


i got curious how visible this speed difference would
be, so while i was setting up the disk anyway, i made
this unscientific experiment.

some modern linux distros (and win7) use 2048 sectors
as offset for their first partition, an alignment of
1MB.  openbsd's fdisk uses 64.  one thing it does not
do is creating partition sizes divisble 


1. openbsd default

Disk: sd3       geometry: 60801/255/63 [976773168 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
*3: A6      0   1   2 -  60800 254  63 [          64:   976768001 ] OpenBSD

partition: [a]
offset: [64]
size: [976768001]
FS type: [4.2BSD]
Rounding size to bsize (64 sectors): 976768000

# time newfs /dev/rsd3a
/dev/rsd3a: 476937.5MB in 976768000 sectors of 512 bytes
586 cylinder groups of 814.44MB, 26062 blocks, 52224 inodes each
super-block backups (for fsck -b #) at:
...
 972425408, 974093376, 975761344,
      280.28 real         6.32 user         7.59 sys


2. linux style

Disk: sd3       geometry: 60801/255/63 [976773168 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
*3: A6      0  32  33 -  60800 254  63 [        2048:   976766017 ] OpenBSD

partition: [a]
offset: [2048]
size: [976766017]
FS type: [4.2BSD]
Rounding size to bsize (64 sectors): 976766016

# time newfs /dev/rsd3a
/dev/rsd3a: 476936.5MB in 976766016 sectors of 512 bytes
586 cylinder groups of 814.44MB, 26062 blocks, 52224 inodes each
super-block backups (for fsck -b #) at:
...
 972425408, 974093376, 975761344,
      280.78 real         6.99 user         6.01 sys


3. non-aligned

Disk: sd3       geometry: 60801/255/63 [976773168 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
*3: A6      0   1   1 -  60800 254  63 [          63:   976768002 ] OpenBSD

partition: [a]
offset: [63]
size: [976768002]
FS type: [4.2BSD]
Rounding size to bsize (64 sectors): 976768001

# time newfs /dev/rsd3a
/dev/rsd3a: 476937.5MB in 976768000 sectors of 512 bytes
586 cylinder groups of 814.44MB, 26062 blocks, 52224 inodes each
super-block backups (for fsck -b #) at:
...
 972425408, 974093376, 975761344,
      339.51 real         4.46 user         5.63 sys

quite a difference.


one thing fdisk does not seem to do yet:

generate partition sizes divisible by 8.
while maybe not necessary on an openbsd only system,
in multiboot configurations it might be a matter
of being a good neighbour in cases where openbsd
is not the last partition on the disk.

-f
-- 
i'm so close to hell i can almost see vegas!

Reply via email to