LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-31-2015, 05:54 PM   #1
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Rep: Reputation: Disabled
Any reason to use UUIDs to in fstab?


Coming from CentOS distro that used UUIDs for fstab, I looked into fstab in slackware and noticed no UUIDs and simply /dev/sda , are there any drawbacks to this? I never saw the purpose for UUIDs myself, to me it makes more of a pain as if I swap out the main drive (like recovering from a backup or something, i never do this though) I need to use Livecd or something else to get the UUID first or else the system wont boot...idk if that is true that is just what I see.
 
Old 07-31-2015, 06:03 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
I always use UUIDs as they solve several problems...

They make the fstab mounts and lilo boot references independent of drive ordering which solves most problems that arise from adding or removing drives from the system and booting with USB thumb drives plugged in.

So on a fresh Slackware install a first order of config business for me is to change lilo and fstab to equivalent UUIDs.

The /dev/sdx identifiers are are assigned by the booting kernel and are not always the same across different boots. UUIDs are persistent.

Last edited by astrogeek; 07-31-2015 at 06:04 PM.
 
1 members found this post helpful.
Old 07-31-2015, 06:06 PM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Adding or removing a SCSI disk changes the disk device name but not the filesystem volume label nor its UUID.

So for a removable device like e.g. an USB drive if you use a device name like /dev/sdb1 for / (the root partition) and that next time it is named /dev/sdc1 instead, the root file system won't be mounted so your system will not start.

Naming the root partition by label or by UUID avoids that.

PS astrogeek was faster.
 
2 members found this post helpful.
Old 07-31-2015, 06:58 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
UUIDs solve a lot of problems, but not all - even create some.
If you image a partition for backup and want to mount it to recover some file(s), you can't.
If you dual boot Linux's, you'll often find the latter installer(s) run a mkswap - changes the UUID. I always have swap as device name in fstab, as this is something I see all the time.
 
Old 07-31-2015, 08:16 PM   #5
magicm
Member
 
Registered: May 2003
Distribution: Slackware
Posts: 237

Rep: Reputation: 152Reputation: 152
Or - you could use a combination - I have a couple of laptops & I let the original slackware install create the fstab.

I also have a 3TB Western Digital USB Drive that I pass between them for backup purposes. Then because I got a good deal on them and they fit easily in the laptop cases, each laptop has its own personal 2TB USB Drive (one Western Digital, one Seagate), in case I feel in a Belt & Suspenders mood while travelling. So, both laptops have 6 fstab entries included, in case I want to simply get some files off a USB Drive. (both laptops dual-boot to W7, so I've partitioned each USB Drive to have an ext4 and an ntfs partition. All the USB fstab entries use UUID.
 
Old 07-31-2015, 08:27 PM   #6
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,627

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
harder to break...

I stopped using devices (except md devices, which do their own recognition) and uuid (which solve more issues than they create) in favor of labels.

I come from a DR and data security background, and there are significant advantages to using a label that you set and control. The uuid can change, or you can replicate and replace the device, but if the label is correct and the format matches, it just works.

I believe I have mentioned before, I really like 'just works'. A lot!
 
1 members found this post helpful.
Old 08-01-2015, 01:29 AM   #7
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by Altiris View Post
Coming from CentOS distro that used UUIDs for fstab, I looked into fstab in slackware and noticed no UUIDs and simply /dev/sda , are there any drawbacks to this? I never saw the purpose for UUIDs myself, to me it makes more of a pain as if I swap out the main drive (like recovering from a backup or something, i never do this though) I need to use Livecd or something else to get the UUID first or else the system wont boot...idk if that is true that is just what I see.
There's an in-depth explanation in Brian Ward's excellent book "How Linux Works" (No Starch Press). Check out chapter 4, disks and filesystems.
 
Old 08-01-2015, 06:00 AM   #8
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,493

Rep: Reputation: Disabled
Totally agree with what has been said already.
My main use of UUID (or label) is for external drives if they are to be used regularly.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cloning and VG UUIDs change canopus69 Linux - Server 7 11-28-2013 10:21 AM
Linux UUIDs tinyTux Linux - Server 3 03-23-2011 11:51 AM
UUIDs and the best laid plans... taylorkh Ubuntu 6 04-22-2009 07:31 AM
Problem using UUIDs Aldeb Linux - Hardware 11 10-27-2008 10:27 AM
LXer: What UUIDs can do for you LXer Syndicated Linux News 0 09-11-2008 03:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration