Solved bsdlabel

Good morning Messieurs,

While discovering FreeBSD, I created a label on a Windows partition called ada0p4 and located on a another drive. But I didn't really want to do that and I would like to erase this label.
May you show me the safe way please?
I have read BSDLABEL(8) and i didn't find the answer.

Also, i have noticed that my FreeBSD partitions ada1p4/5/6 doesn't have any label. After a few research i found out that labels are a different and convenient way of naming partitions, comparer to UUIDs. Can they be useful for me, a humble desktop user who does nothing fancy?

Code:
[meca] $ gpart show
=>       34  976773101  ada0  GPT  (466G)
         34       2014        - free -  (1.0M)
       2048     921600     1  ms-recovery  (450M)
     923648     204800     2  efi  (100M)
    1128448      32768     3  ms-reserved  (16M)
    1161216  975611904     4  ms-basic-data  (465G)
  976773120         15        - free -  (7.5K)

=>       34  234454973  ada1  GPT  (112G)
         34          6        - free -  (3.0K)
         40     409600     4  efi  (200M)
     409640   72990720     5  freebsd-ufs  (35G)
   73400360    3590104     6  freebsd-swap  (1.7G)
   76990464  154900480     1  linux-data  (74G)
  231890944     262144     2  efi  (128M)
  232153088      53248        - free -  (26M)
  232206336    2097152     3  linux-swap  (1.0G)
  234303488     151519        - free -  (74M)

=>        63  3907029105  ada2  MBR  (1.8T)
          63           1        - free -  (512B)
          64  3907029104     1  fat32  (1.8T)

=>        0  975611904  ada0p4  BSD  (465G)
          0         16          - free -  (8.0K)
         16  975611888       1  !0  (465G)

=>       34  976773101  diskid/DISK-S2RBNB0HB79400F  GPT  (466G)
         34       2014                               - free -  (1.0M)
       2048     921600                            1  ms-recovery  (450M)
     923648     204800                            2  efi  (100M)
    1128448      32768                            3  ms-reserved  (16M)
    1161216  975611904                            4  ms-basic-data  (465G)
  976773120         15                               - free -  (7.5K)

=>        0  975611904  gptid/0f06cec9-956f-4b93-aa69-9627a33dbbce  BSD  (465G)
          0         16                                              - free -  (8.0K)
         16  975611888                                           1  !0  (465G)

=>        0  975611904  diskid/DISK-S2RBNB0HB79400Fp4  BSD  (465G)
          0         16                                 - free -  (8.0K)
         16  975611888                              1  !0  (465G)
 
Last edited:
bsdlabel isn‘t the right tool for GPT partitioning schemes.
I‘d recommend using gpart to create labels.
You don‘t really need labels, when your setup is static, but it‘s good to understand how they work.
The Handbook explains labels, but some answers are missing. I wrote a tutorial about GPT labels here which explains the parts the Handbook leaves out. In case you created a GPT label on /dev/ada0p4, you can remove it like this:
gpart modify -l ‘‘ -i4 ada0
(single or doubleqoutes without space inbetween)
 
Hi k.jacker,

Thank you for helping. Yes, I which to understand as much as I can about FreeBSD.

I am not sure it worked for me, I am going to read your tutorial and the Handbook.

Code:
root@vox:~ # gpart modify -l ‘‘ -i4 ada0
ada0p4 modified

It still showing me the label.


Code:
root@vox:~ # bsdlabel -A /dev/ada0p4
# /dev/ada0p4:
type: unknown
disk: amnesiac
label:
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 967868
sectors/unit: 975611904
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0        # milliseconds
track-to-track seek: 0    # milliseconds
drivedata: 0

8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  a:  975611888         16    unused        0     0   
  c:  975611904          0    unused        0     0     # "raw" part, don't edit

Code:
root@vox:~ # gpart show
=>       34  976773101  ada0  GPT  (466G)
         34       2014        - free -  (1.0M)
       2048     921600     1  ms-recovery  (450M)
     923648     204800     2  efi  (100M)
    1128448      32768     3  ms-reserved  (16M)
    1161216  975611904     4  ms-basic-data  (465G)
  976773120         15        - free -  (7.5K)

=>       34  234454973  ada1  GPT  (112G)
         34          6        - free -  (3.0K)
         40     409600     4  efi  (200M)
     409640   72990720     5  freebsd-ufs  (35G)
   73400360    3590104     6  freebsd-swap  (1.7G)
   76990464  154900480     1  linux-data  (74G)
  231890944     262144     2  efi  (128M)
  232153088      53248        - free -  (26M)
  232206336    2097152     3  linux-swap  (1.0G)
  234303488     151519        - free -  (74M)

=>        63  3907029105  ada2  MBR  (1.8T)
          63           1        - free -  (512B)
          64  3907029104     1  fat32  (1.8T)

=>        0  975611904  ada0p4  BSD  (465G)
          0         16          - free -  (8.0K)
         16  975611888       1  !0  (465G)

=>       34  976773101  diskid/DISK-S2RBNB0HB79400F  GPT  (466G)
         34       2014                               - free -  (1.0M)
       2048     921600                            1  ms-recovery  (450M)
     923648     204800                            2  efi  (100M)
    1128448      32768                            3  ms-reserved  (16M)
    1161216  975611904                            4  ms-basic-data  (465G)
  976773120         15                               - free -  (7.5K)

=>        0  975611904  gpt/%E2%80%98%E2%80%98  BSD  (465G)
          0         16                          - free -  (8.0K)
         16  975611888                       1  !0  (465G)

=>        0  975611904  gptid/0f06cec9-956f-4b93-aa69-9627a33dbbce  BSD  (465G)
          0         16                                              - free -  (8.0K)
         16  975611888                                           1  !0  (465G)

=>        0  975611904  diskid/DISK-S2RBNB0HB79400Fp4  BSD  (465G)
          0         16                                 - free -  (8.0K)
         16  975611888                              1  !0  (465G)
 
There is no label on /dev/ada0p4, just leave it as it is.
As I said, bsdlabel(8) is not the right tool. It is only useful with MBR partition schemes. You are using GPT scheme on both your drives.
 
Back
Top