Difference between revisions of "FreeBSD Format and Partition"

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search
(Created page with "All FreeBSD 9.0 and later installations come with GPT. You can use gpart(8) instead of the classic fdisk(8) and disklabel(8). To remove existing partitions from a drive g...")
 
m
Line 1: Line 1:
 
All FreeBSD 9.0 and later installations come with GPT.  You can use gpart(8) instead of the classic fdisk(8) and disklabel(8).   
 
All FreeBSD 9.0 and later installations come with GPT.  You can use gpart(8) instead of the classic fdisk(8) and disklabel(8).   
 +
 +
AHCI - Advanced Host Controller Interface is a standard for disk drives and controllers. Enabling AHCI in the BIOS can give a 5-15% performance increase. Not all controllers offer AHCI.
 +
 +
For [[Solid State Computer Systems]] most SSD models support a feature called TRIM. TRIM is just a status update that triggers when the filesystem deletes a block, it also notifies the device that the block is no longer in use. The SSD firmware can then do some wear leveling functions. Without TRIM, it would not be able to tell whether that block was still in use. TRIM does not require AHCI.
 +
 +
== Some Commands ==
  
 
To remove existing partitions from a drive
 
To remove existing partitions from a drive
Line 20: Line 26:
  
 
mount /dev/vtbd0p4 /transip
 
mount /dev/vtbd0p4 /transip
 +
 +
== Partition a SSD for FreeBSD ==
 +
Applies to [[Solid State Computer Systems]] with FreeBSD 10.X and newer.
 +
 +
Do not enable TRIM unless the SSD supports it. Better yet, avoid SSDs that do not support TRIM.
 +
 +
Create the partition scheme.  In the GPT partition scheme make a boot partition of the size 512K.  Here we will use the new 4K-alignment which is what is advised for SSD drives.  More information is on [[Hard Drive Logical Block Format Migration to 4K- Alignment]].
 +
gpart create -s gpt ada0
 +
gpart add -t freebsd-boot -s 512k -a4k -l ssdboot ada0
 +
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i1 ada0
 +
  
  

Revision as of 13:14, 5 December 2020

All FreeBSD 9.0 and later installations come with GPT. You can use gpart(8) instead of the classic fdisk(8) and disklabel(8).

AHCI - Advanced Host Controller Interface is a standard for disk drives and controllers. Enabling AHCI in the BIOS can give a 5-15% performance increase. Not all controllers offer AHCI.

For Solid State Computer Systems most SSD models support a feature called TRIM. TRIM is just a status update that triggers when the filesystem deletes a block, it also notifies the device that the block is no longer in use. The SSD firmware can then do some wear leveling functions. Without TRIM, it would not be able to tell whether that block was still in use. TRIM does not require AHCI.

Some Commands

To remove existing partitions from a drive

gpart delete


gpart show

gpart recover vtbd0

gpart add -t freebsd-ufs -b BEGIN -s SIZE GEOM

gpart add -t freebsd-ufs -b 20971682 -s 18874240 vtbd0

newfs -U /dev/vtbd0p4

mkdir /transip

mount /dev/vtbd0p4 /transip

mount /dev/vtbd0p4 /transip

Partition a SSD for FreeBSD

Applies to Solid State Computer Systems with FreeBSD 10.X and newer.

Do not enable TRIM unless the SSD supports it. Better yet, avoid SSDs that do not support TRIM.

Create the partition scheme. In the GPT partition scheme make a boot partition of the size 512K. Here we will use the new 4K-alignment which is what is advised for SSD drives. More information is on Hard Drive Logical Block Format Migration to 4K- Alignment.

gpart create -s gpt ada0
gpart add -t freebsd-boot -s 512k -a4k -l ssdboot ada0
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i1 ada0