Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

fstab choices

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
decuser
n00b
n00b
User avatar
Posts: 60
Joined: Thu Jan 23, 2003 9:24 pm
Location: Godley, Texas

fstab choices

  • Quote

Post by decuser » Sat Jan 13, 2024 10:50 pm

So, my fstab has:

Code: Select all

/dev/sda1   /efi        vfat    defaults    0 2
/dev/sda2   none         swap    sw                   0 0
/dev/vg0/lv0       /       ext4    defaults,noatime
The problem is, sometimes, it's /dev/sdb1 and /dev/sdb2... I've been using unixy systems for years and occasionally this rears its head. I tend to ignore it or just edit the file to suit the new configuration. Primarily, because UUIDs seem overly complex. Now, I'm a little savvier that I used to be and I think, what's the right way to do this? I like the lvm way, I can totally understand why I need to mount /dev/vg0/lv0 as root and how that will always be appropriate (I created the volume group and added the logical volume, so it could be root). I don't think linux will get confused about it down the road. The same would be true if I were to create a zpool and zfs dataset, but the efi partition and swap partitions are old-school. Is the UUID stuff, the correct, best practice for ensuring that fstab does it's thing correctly with these older schemes? Or, is there a simpler, label the drive thusly when you partition it and refer to the label way that's easier and "just about" as good. Obviously UUIDs become a heck of a lot more interesting with vast numbers of drives, but about the most I can have, even on my desktop is 8 and I don't need 128 bit numbers to hold eight, last I did the math.

Help and thanks!

Will[/code]
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56075
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sat Jan 13, 2024 11:01 pm

decuser,

Use PARTUUID or UUID. Both will be unique unless you use dd, then you get to keep the pieces.
A LVM snapshot preserves the filesystem UUID so that can bite you in the bum too.

PARTUUID has one advantage for some users.
The kernel understands root=PARTUUID= without an initrd.
Filesystem UUID, requires the userspace mount command, which compels the use of an initrd.
Once root is mounted, both work equally well.

LABELS ore like UUIDS, except its your problem to make them unique.

Hmm maybe 12 LVs on my Pi5 is a bit excessive :)

Code: Select all

UUID=9e14507f-8e1a-4938-8b8b-3d5afc23c9b3	/	ext4    noatime         0 1
UUID=b79fc1ee-8329-42d2-9f7d-74909685619f	/usr	ext4    noatime         0 0
UUID=8d8c0306-07d1-442e-93f4-64eef426b8aa	/home	ext4    noatime         0 0
UUID=630e1ef3-8a9b-4fa1-80b2-b1622f314b76	/var	ext4    noatime         0 0
UUID=9a6e39d1-5f83-4c56-9389-717912c8e264	/opt    ext4    noatime         0 0
UUID=9C91-DBF7					/boot	vfat	noauto,noatime	0 0
UUID=a8afebbf-7551-4c0f-b862-f670bb05a011	/var/cache/binpkgs	ext4    noatime         0 0
UUID=abcbe072-5ab6-4314-846e-cad2f0f5e26e	/var/cache/distfiles	ext4    noatime         0 0
UUID=6ec5dd99-ab11-4a2a-8ad4-0b79a986b5a7	/var/tmp/portage	ext4    noatime		0 0
UUID=bdd5a502-534d-4f50-81dd-5a8960f98254	/var/db/repos		ext4    noatime         0 0
UUID=00b96473-0f60-47c8-972d-3d2d8627ca18	/usr/src		ext4    noatime         0 0

UUID=54ee040b-9e5a-4ae8-a4f9-6dc3669e7e8d	none			swap    sw              0 0
I need to sprinke some nodev,noexec,nosuid optinos there too, which is why there are so many filesystems.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Hu
Administrator
Administrator
Posts: 24380
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Jan 13, 2024 11:08 pm

As an alternative to PARTUUID, you may be able to use PARTLABEL, if you labeled your partitions properly. These are human-chosen and generally short, unlike UUIDs.

There is also LABEL (for a filesystem label), but not all filesystems can be labeled. Swap can be labeled at creation time with --label. I don't know about vfat.

The output of blkid should give you UUIDs and, if present, LABELs, so you can determine what options are available without the need to make further changes.
Top
decuser
n00b
n00b
User avatar
Posts: 60
Joined: Thu Jan 23, 2003 9:24 pm
Location: Godley, Texas

  • Quote

Post by decuser » Sat Jan 13, 2024 11:32 pm

Well, that was easy. I guess once you get what's what, it just isn't a big deal. Go figure:

Code: Select all

PARTUUID=95907e97-9f28-4a48-b21a-8e67ec3b2929	/efi vfat defaults 0 2
PARTUUID=c2a6217c-f15d-c84c-8ff1-7fcb80e0728f	none swap sw 0 0
/dev/vg0/lv0       /       ext4    defaults,noatime
sheesh, what was I thinking?
Top
decuser
n00b
n00b
User avatar
Posts: 60
Joined: Thu Jan 23, 2003 9:24 pm
Location: Godley, Texas

  • Quote

Post by decuser » Sat Jan 13, 2024 11:36 pm

NeddySeagoon wrote:decuser,

Use PARTUUID or UUID. Both will be unique unless you use dd, then you get to keep the pieces.
A LVM snapshot preserves the filesystem UUID so that can bite you in the bum too.

PARTUUID has one advantage for some users.
The kernel understands root=PARTUUID= without an initrd.
Filesystem UUID, requires the userspace mount command, which compels the use of an initrd.
Once root is mounted, both work equally well.
I'm using LVM until I feel like I'm not gonna hose the system with stoopid changes, so I have to have initrd for that. Once I get the hang of gentoo and settle down, I'll prolly switch back to basic partitions and this info'll come in handy. Thanks!
Top
decuser
n00b
n00b
User avatar
Posts: 60
Joined: Thu Jan 23, 2003 9:24 pm
Location: Godley, Texas

  • Quote

Post by decuser » Sat Jan 13, 2024 11:38 pm

Hu wrote:As an alternative to PARTUUID, you may be able to use PARTLABEL, if you labeled your partitions properly. These are human-chosen and generally short, unlike UUIDs.

There is also LABEL (for a filesystem label), but not all filesystems can be labeled. Swap can be labeled at creation time with --label. I don't know about vfat.

The output of blkid should give you UUIDs and, if present, LABELs, so you can determine what options are available without the need to make further changes.
blkid is the ticket. Thanks for that. Saved me having to google it. Is it weird that it prints with quotes, but fstab doesn't do quotes, or am I nit picking?
Top
jb1277976_
n00b
n00b
User avatar
Posts: 35
Joined: Mon Oct 30, 2023 3:50 am

  • Quote

Post by jb1277976_ » Sun Jan 14, 2024 6:58 am

decuser wrote:
Hu wrote:As an alternative to PARTUUID, you may be able to use PARTLABEL, if you labeled your partitions properly. These are human-chosen and generally short, unlike UUIDs.

There is also LABEL (for a filesystem label), but not all filesystems can be labeled. Swap can be labeled at creation time with --label. I don't know about vfat.

The output of blkid should give you UUIDs and, if present, LABELs, so you can determine what options are available without the need to make further changes.
blkid is the ticket. Thanks for that. Saved me having to google it. Is it weird that it prints with quotes, but fstab doesn't do quotes, or am I nit picking?
Gentoo has a tool that is borrowed from archlinux. its called genfstab it basically puts all the mount points in fstab for you without you doing it by hand.

Code: Select all

genfstab -U / >> /etc/fstab
Look at fstab after that and you see everything is perfect.

~ Joe B
Top
decuser
n00b
n00b
User avatar
Posts: 60
Joined: Thu Jan 23, 2003 9:24 pm
Location: Godley, Texas

  • Quote

Post by decuser » Sun Jan 14, 2024 4:19 pm

jb1277976_ wrote:Gentoo has a tool that is borrowed from archlinux. its called genfstab it basically puts all the mount points in fstab for you without you doing it by hand.

Code: Select all

genfstab -U / >> /etc/fstab
Look at fstab after that and you see everything is perfect.

~ Joe B
I've added it to the handful of packages I install in my chroot. With LVM hosting root and EFI, it doesn't seem to matter much about the /EFI and swap partitions when things go wrong, but using a sys-gen'd fstab seems like a good idea to me.
Top
Post Reply

8 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy