[Bug 290252] [Feature Request] Make bsdinstall write /etc/fstab using stable UUID-like GPT identifiers (gptid) instead of device names

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 15 Oct 2025 11:48:47 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290252

            Bug ID: 290252
           Summary: [Feature Request] Make bsdinstall write /etc/fstab
                    using stable UUID-like GPT identifiers (gptid) instead
                    of device names
           Product: Base System
           Version: 15.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: yklaxds@gmail.com

During a default FreeBSD installation performed by bsdinstall, the installer
writes /etc/fstab entries using device paths such as /dev/ada0p2 or
/dev/nvd0p2.
On modern systems — especially servers and virtualized environments — device
enumeration can change after hardware reconfiguration, leading to fragile or
incorrect mounts.

FreeBSD already provides stable per-partition identifiers (/dev/gptid/<GUID>).
Using these identifiers by default would significantly improve system
reliability.

Proposal:

When the target disk uses GPT, make bsdinstall write /etc/fstab using
/dev/gptid/<GUID> instead of device names.

Add an installer option to choose the naming style:

Default: gptid

Optional: gpt (labels) or legacy device paths.

Apply this scheme not only to UFS but also to ZFS installations, including
EFI/ESP and swap partitions, which likewise benefit from stable identifiers in
/etc/fstab.

Benefits:

Prevents fstab breakage caused by device renumbering.

Aligns with best practices used by other operating systems.

Very low implementation risk — GPTID support already exists in the system.


---------
root@ykla:/home/ykla # gpart list  | grep -E 'Name|rawuuid'
1. Name: nda0p1
   rawuuid: 230c9c2b-d274-11ef-8580-000c29cd28ab
2. Name: nda0p2
   rawuuid: 230f7831-d274-11ef-8580-000c29cd28ab
3. Name: nda0p3
   rawuuid: 23142058-d274-11ef-8580-000c29cd28ab
4. Name: nda0p4
   rawuuid: 2317f449-d274-11ef-8580-000c29cd28ab
1. Name: nda0

----------------------------
root@ykla:/home/ykla # cat /etc/fstab 
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/gpt/efiboot0               /boot/efi       msdosfs rw              2      
2
/dev/nda0p3             none    swap    sw              0       0

-----------------------------
References:
https://lists.freebsd.org/pipermail/freebsd-questions/2013-August/252906.html

https://forums.freebsd.org/threads/how-to-use-uuid-to-identify-partitions-on-freebsd.89163/

https://github.com/FreeBSD-Ask/FreeBSD-Ask/issues/1287

Rationale: This feature is important for modern large servers and virtualized
environments where disk order and naming may vary. It ensures consistent,
robust mounts without manual intervention.

-- 
You are receiving this mail because:
You are the assignee for the bug.