LABEL (The FreeBSD Disklabel Editor)

Israel Gelpi igelpi at
Wed Mar 15 13:35:28 UTC 2017

Thank you. You have given me a wealth of information. But as a novice I was need to study and understand these recommendations.  ‎Wish me success. :-)


Sent from my BlackBerry 10 smartphone.
  Original Message
From: Polytropon
Sent: Wednesday, March 15, 2017 5:13 AM
To: Israel Gelpi
Reply To: Polytropon
Cc: freebsd-questions at
Subject: Re: LABEL (The FreeBSD Disklabel Editor)

On Tue, 14 Mar 2017 21:09:17 +0000, Israel Gelpi wrote:
> Hello Sir, I had a SUN enterprise which I tested using a
> HDD diagnostics software called SCSI Tool-Box Suite. After
> testing I wiped the drive and mistakenly erased the Disk
> Label making the drive unusable (the operating system would
> not "mount'). Could you advise me on the how, I could
> restore/repair the Disk Label and to proper wipe a SUN
> without erasing the disk label.

If you intend to mount the disk again on Solaris (default
Sun operating system), you'd need to do two things:

1. create a label on the disk (disklabel or bsdlabel)

2. initialize the file UFS system (newfs)

Without those two (!) things, you won't be able to mount it.

(NB: The following explanations are FreeBSD-specific.)

The FreeBSD installer does all those things, but you can
do it manually, too: Boot FreeBSD from CD or USB in live mode
(shell access), then issue the required commands for the disk,
for example if /dev/da0 is the disk in question (without testing,
just from my memory):

        # bsdlabel -w /dev/da0
        # bsdlabel -e /dev/da0
                in the editor, change type for partition "a":
                "unused" -> "4.2BSD", then save & exit
        # newfs /dev/da0

If you need additional boot code on that disk (only required
if it should be a boot disk), write the boot code as well.
The same applies for newfs options you might want to add.

Now the disk /dev/da0 can be mounted. It contains a disklabel
with one BSD partition covering the whole disk,
often called "dedicated" because there i

You can find detailed information in "man bsdlabel" and "man
newfs". Additional online documentation can be found here:

Note that FreeBSD encourages the use of gpart, a tool that
can be used both for MBR operations (fdisk + bsdlabel) and
GPT operations, but there's nothing wrong in using the "classic
tools" for "legacy work". ;-)

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list