Need clarification regarding gpart behavior

Hi,

I have two SSD's connected to my system (one boot disk and other disk with a gpt partition). In "gpart show" it shows the same second disk twice (one with "label" and other without a "label"). Why is that?

Code:
root@11_2_rel:~/freebsd_git/sys/modules/ntb # gpart show
=>       40  976773088  ada0  GPT  (466G)
         40     409600     1  efi  (200M)
     409640  968474616     2  freebsd-ufs  (462G)
  968884256    7888871     3  freebsd-swap  (3.8G)
  976773127          1        - free -  (512B)

=>        40  1000215136  ada1  GPT  (477G)
          40   536870912     1  freebsd-ufs  (256G)
   536870952   463344224        - free -  (221G)

=>        40  1000215136  diskid/DISK-14010C061290  GPT  (477G)
          40   536870912                            1  freebsd-ufs  (256G)
   536870952   463344224                               - free -  (221G)

When I try to mount the disk from /dev/ufs, the "non-label" version of the entry is not seen in "gpart show"

Code:
root@11_2_rel:~/freebsd_git/sys/modules/ntb # mount /dev/ufs/ada1p1 /mnt/
root@11_2_rel:~/freebsd_git/sys/modules/ntb # gpart show
=>       40  976773088  ada0  GPT  (466G)
         40     409600     1  efi  (200M)
     409640  968474616     2  freebsd-ufs  (462G)
  968884256    7888871     3  freebsd-swap  (3.8G)
  976773127          1        - free -  (512B)

=>        40  1000215136  diskid/DISK-14010C061290  GPT  (477G)
          40   536870912                            1  freebsd-ufs  (256G)
   536870952   463344224                               - free -  (221G)

When I try to mount the disk from /dev/gpt, the "label" version of the entry is not seen in "gpart show"

Code:
root@11_2_rel:~/freebsd_git/sys/modules/ntb # mount /dev/gpt/ada1p1 /mnt/
root@11_2_rel:~/freebsd_git/sys/modules/ntb # gpart show
=>       40  976773088  ada0  GPT  (466G)
         40     409600     1  efi  (200M)
     409640  968474616     2  freebsd-ufs  (462G)
  968884256    7888871     3  freebsd-swap  (3.8G)
  976773127          1        - free -  (512B)

=>        40  1000215136  ada1  GPT  (477G)
          40   536870912     1  freebsd-ufs  (256G)
   536870952   463344224        - free -  (221G)

Is this behavior expected? Why so?
 
Because FreeBSD could announce a device and/or partition and/or filesystem under multiple labels/aliases; see glabel(8).

Once you start using one of the labels, like mount a specific partition, other aliases will be hid.

BTW it is a good idea to increase partition alignment; I tend to use 1MB as this should be universally compatible no matter what the storage device is: gpart add -t freebsd-ufs -a 1M -l label ada0.
 
Back
Top