Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to format a partition under FreeBSD and change it to UFS filesystem. I searched the web but even the "fdisk" man page is not clear at all. Any help would be clearly appreciated !

My current partition is :

fdisk /dev/da0
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=121601 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=121601 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 1953520002 (953867 Meg), flag 80 (active)
    beg: cyl 0/ head 1/ sector 1;
    end: cyl 768/ head 254/ sector 63
The data for partition 2 is:
The data for partition 3 is:
The data for partition 4 is:
share|improve this question

migrated from Nov 6 '10 at 14:40

This question came from our site for professional and enthusiast programmers.

haven't used *BSD, but in linux land the mkfs collection of programs are used to create filesystems – Hubert Kario Nov 6 '10 at 16:11
yes I'm a Linux expert but it seems that FreeBSD is completely different when dealing with disks. – db_ch Nov 6 '10 at 17:04

The FreeBSD handbook is an invaluable resource and has a section that details how to add disks to an existing system: Adding Disks.

share|improve this answer

fdisk for partitions
bsdlabel for slices (for the uninitiated, like partitions for partitions)
newfs for UFS (the native file system)

Quick 1 partition, 1 slice disk:

fdisk -BI [drive]
bsdlabel -wB [drive]s1
newfs [drive]s1a

After which you could mount it with something similar to:

mount [drive]s1a /mnt
share|improve this answer

Nowadays you should use gpart to partition the disk (fdisk/disklabel are being overtaken by gpart since it supports GPT), newfs to format UFS[2] partitions and zpool to create ZFS filesystems. For example to initialize a new, unused disk with a UFS filesystem:

gpart create -s gpt adaX
gpart add -t freebsd-ufs adaX
newfs /dev/adaXp1

gpart create -s mbr adaX
gpart add -t freebsd adaX
gpart create -s bsd adaXs1
gpart add -t freebsd-ufs adaXs1
newfs /dev/adaX1s1a

If the disk is already partitioned and you want to repartition it, see what's already present with:

gpart show adaX

You can then delete partitions using "gpart delete -i y adaX:

gpart delete -i 4 adaX

You can use "gpart destroy" to destroy the scheme if you want to change it from MBR to GPT for example:

gpart destroy adaX
gpart create -s gpt adaX

GPT is generally preferred nowadays unless you have to interoperate with systems which don't understand it since it can break the 2TB limit and have up to 2^32-1 partitions (in theory!).

share|improve this answer
up vote 0 down vote accepted

My question was answered on :

Hope it will help someone else :-)

And as requested this is the answer from the link above (if it again becomes unavailable) :

da0 is your drive. The first slice (partition) on that is called s1. fdisk says you have that slice created, so /dev/da0s1 should be present. That's what you format with newfs:

# newfs /dev/da0s1
# mount -t ufs /dev/da0s1 /mnt/usbdisk
# ls -ltr /mnt/usbdisk
total 2
drwxrwxr-x  2 root  operator  512 Nov  6 18:11 .snap

Best regards

share|improve this answer
nope, please add the essential parts of the link :D – Sir l33tname Jul 5 '14 at 20:45
yes seems the link has gone 404. The new link is : – db_ch Jul 23 '14 at 11:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.