Freebsd / Drives larger than 1tb / gpart

This has taken me more than it should have.

Okay long story short: If you’re installing FreeBSD, then you should know that it doesn’t support drives larger than 1 tb drives by default from sysinstall / fdisk / label.
Quick and easy once you learn it, you realise that you can get the job done really quick by using gpart.

Problems you may encounter:

??(~)->gpart create -s gpt aacd1
gpart: geom ‘aacd1’: File exists

^^ This happens if you already tried (like i did) to mount the big 9 tb raid array through fdisk. Solution – dd the drives, and then you will erase the mbr, and it’s good to go:

??(~)->gpart show aacd1
=> 63 19503513477 aacd1 MBR (9.1T)
63 19503513477 – free – (9.1T)

??(~)-> dd if=/dev/zero of=/dev/aacd1 bs=1k count=1

??(~)->gpart show aacd1
gpart: No such geom: aacd1.

??(~)->gpart create -s gpt aacd1
aacd1 created

^^ And it works like a charm.
??(~)->gpart show aacd1
=> 34 19503513533 aacd1 GPT (9.1T)
34 19503513533 – free – (9.1T)

Time to make a partition and get this over with:

??(~)->gpart add -t freebsd-ufs -l bigraid aacd1
aacd1p1 added

??(~)->newfs aacd1p1

Once the partition is loaded, just add it to fstab:

/dev/aacd1p1 /var/www/html ufs rw 2 2

Then do a “mount -a” and it’s finished.

Took me a while to figure all this out. Hope it makes your life easier.

LE: for optimizing the block size: newfs -O2 -U -b 65536 -f 8192 -i 65536 /dev/ad5p1

LEE: for destroying partitions:

??(~)->gpart delete -i 1 ad7
??(~)->gpart destroy ad7