Does FreeBSD use UUID to identify partitions

NickC

New Member


Messages: 12

Just a quick install related question if that is ok before I start my first FreeBSD install. Does FreeBSD use UUID to identify partitions?

Reason for asking is that I intend to install this in a multi disk environment where after the install other disks may be installed or removed above this one in the chain. Will FreeBSD still keep working in that situation? I have found that a many versions of Linux fail to boot unless they remain at exactly the same place in the disk drive chain. In the windows world it is just a case of setting the BIOS to boot from the correct disks MBR, but that is not always the case in the Linux world, and maybe the *nix world.

Thanks,
nick
 

Crest

Active Member

Reaction score: 66
Messages: 211

FreeBSD supports UUIDs to identify GPT partitions. It's recommended to label your GEOM providers in some way. UFS(2) supports filesystem labels directly with newfs -L $name. GPT partitions can be labeled with gpart add -l $name. Any GEOM provider can be labeled with glabel except for GPT formatted disks because glabel would overwrite the secondary table. ZFS finds its GEOM providers by on-device meta-data and doesn't care about labels.
 
OP
N

NickC

New Member


Messages: 12

Thanks for your replies. From what you say if this does not use UUIDs by default then perhaps it is not the ideal OS to use in a multi-disk environment.

Cheers,
Nick
 

wblock@

Beastie Himself
Developer

Reaction score: 3,685
Messages: 13,851

That's a strange conclusion. See glabel(8), where it shows that UUIDs appear in /dev/gptid. So yes, UUIDs are "natively suppored", even though more readable and maintainable labels are also available.
 
OP
N

NickC

New Member


Messages: 12

Perhaps I didn't phrase the question very well, and may have misunderstood your answer. Let me put it a different way:
Lets say I have two disk drives
drive 0
drive 1
I then do a default install of FreeeBSD on drive 1, writing the boot loader to the MBR of drive 1. If drive 0 is then removed from the system will FreeBSD still boot? Also what about if another drive is install further up the chain, lets say our current drive 1 -> drive 2 because a new drive 1 was inserted.
 

wblock@

Beastie Himself
Developer

Reaction score: 3,685
Messages: 13,851

Both bsdinstall and the older sysinstall write entries in /etc/fstab with absolute disk numbers. Those need to be changed to labels or UUIDs to make the disk relocatable.
 
OP
N

NickC

New Member


Messages: 12

Does there happen to be a simple article anywhere describing how to do this. Something that even a Windows sysadmin and Linux/*nix noobie could understand ;)
 

wblock@

Beastie Himself
Developer

Reaction score: 3,685
Messages: 13,851

Labels are easier, see the article in post #3. However:

1. Boot in single user mode.
2. Identify the GPTID or label for the disk or partition.
# glabel status
3. Mount the other partitions (to be able to run an editor): mount -a.
4. Edit /etc/fstab, replacing drive or partition references with GPTID or label references.
Code:
/dev/ada0p2         /     ufs      rw           1           1
becomes
/dev/gpt/gprootfs   /     ufs      rw           1           1
or
/dev/gptid/978973df-74f9-11e1-8601-f52720ac5086    /     ufs      rw           1           1
 
Top