How do I create large partitions in FreeBSD?

Peter Steele psteele at maxiscale.com
Tue Dec 8 18:36:57 UTC 2009


We have 3U systems with 3Ware raid controllers configured to give us large 11TB logical drives. The diskinfo command shows this:

# diskinfo -v da1
da1
        512             # sectorsize
        11999933104128  # mediasize in bytes (11T)
        23437369344     # mediasize in sectors
        1458908         # Cylinders according to firmware.
        255             # Heads according to firmware.
        63              # Sectors according to firmware.
        Y08210901E792700BAB9    # Disk ident.

We want to create a BSD slice to cover the entire drive. My plan was to use the fdisk -I option:

# fdisk -I da1
******* Working on device /dev/da1 *******
fdisk: Class not found

# fdisk -p da1
# /dev/da1
g c1458908 h255 s63
p 1 0xa5 63 1962532467
a 1

but as you can see, the partition size that this creates is only 1TB (1962532467*512=1004816623104 bytes). The fdisk command clearly knows how large the disk really is:

# fdisk da1
******* Working on device /dev/da1 *******
parameters extracted from in-core disklabel are:
cylinders=1458908 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=1458908 heads=255 sectors/track=63 (16065 blks/cyl)

If I compute 1458908*255*63*512 this gives me 11999926794240, which is the correct size. But the -I option doesn't create a full sized partition.

How do we resolve this? We want a full size partition spanning the entire disk, and we need a scriptable solution since the configuration of these servers is handled through an automated process.




More information about the freebsd-questions mailing list