You are not logged in.

#1 2008-05-28 10:33:16

11010010110
Member
Registered: 2008-01-14
Posts: 284

UUID in /etc/fstab ?

The Arch 2008.04 RC install from core cd defines partitions in fstab and lilo.conf with UUID - kind of a serial number

fstab looks something like this

UUID=7121593266874362152765378921 / ext3 defaults
UUID=8218758326527681265768176473 swap defaults
UUID=9347769643873221980940305666 /home defaults

I dont understand files written this way (which UUID is which partition) and i manually changed them to the /dev/sda1 way

I won't name it KISS

Why is it done and why is there no option to make it the /dev/sda1 way in the install itself ? (a yes no question in the ncurses wizard)

Last edited by 11010010110 (2008-05-28 10:50:39)

Offline

#2 2008-05-28 10:38:17

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,937
Website

Re: UUID in /etc/fstab ?

take a look at  /dev/disk/by-uuid/ . you cat edit /etc/fstab and put the right /dev/sdXY if you don't like UUID


Give what you have. To someone, it may be better than you dare to think.
Blog

Offline

#3 2008-05-28 10:56:10

11010010110
Member
Registered: 2008-01-14
Posts: 284

Re: UUID in /etc/fstab ?

I edited now the original post




I know the UUIDs represent the same partitions

But

Why should I fight my Arch system to turn it to that way ?

Why does this take place in a system which is meant to be KISS ? (imo this is not kiss cause it is not human readable)

What are the practical benefis of this way ?

Why aren't there at the very least comments in fstab that give the name of the partition next to each UUID line ?

Offline

#4 2008-05-28 10:59:07

Diaz
Member
From: Lisbon, Portugal
Registered: 2008-04-16
Posts: 361
Website

Re: UUID in /etc/fstab ?

or better, if you have all the needed partitions with labels defined it will look even "prettier" tongue

to aswer your question, it is simple, if you atach a new hard drive to the pc it could happen that the partition now named sda1 would change to sdb1, and i'll say that it happens to me because of my external hd connected with eSata. This way the UUID is unique to each partition, so you will always boot to your pc without having to worry about that little problem cool

Last edited by Diaz (2008-05-28 11:02:46)


Owner of Asus 1215B :: User of Xfce :: Vasco Dias @blog

Offline

#5 2008-05-28 11:00:26

_Marco_
Member
Registered: 2008-04-21
Posts: 242

Re: UUID in /etc/fstab ?

I was thinking almost the same questions
http://bbs.archlinux.org/viewtopic.php? … 57#p369057
as mikko777 said everything is explained in the wiki..
http://wiki.archlinux.org/index.php/Per … ice_naming

Offline

#6 2008-05-28 11:07:04

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 9,939
Website

Re: UUID in /etc/fstab ?

The main advantage I see is in a RAID setup.  You can shut down, swap the drives around and reboot and everything will work fine.  Or if you have two drives, you can chage the mbr from drive 1 to drive 2 without a problem.   It would have been good during the whole /dev/hda -> /dev/sda switch too.

I agree they look far more ugly though...

Offline

#7 2008-05-28 11:24:14

peart
Member
From: Kanuckistan
Registered: 2003-07-28
Posts: 510

Re: UUID in /etc/fstab ?

The UUIDs are definitely ugly, but KISS is a software engineering principle, not an ease of use thing.  The 2 shouldn't be confused.  The devs chose a solution which was simple to implement and didn't add to the overall complexity of the distro.

There was a time (version 0.6?) when /dev/sda1 was /dev/discs/disc0/partitions/part1, so this UUID thing isn't so bad smile

Offline

#8 2008-05-28 11:38:21

11010010110
Member
Registered: 2008-01-14
Posts: 284

Re: UUID in /etc/fstab ?

KISS is about the software as whole. This means KISS from the user's side too

Otherwise we could call Ubuntu KISS and imo its not true

Offline

#9 2008-05-28 11:47:20

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: UUID in /etc/fstab ?

Will the UUID syntax work in /etc/crypttab, too?

Offline

#10 2008-05-28 11:58:56

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: UUID in /etc/fstab ?

UUID's are UNIQUE. AFAIk thats the most important advantage.


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#11 2008-05-28 12:24:55

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,167
Website

Re: UUID in /etc/fstab ?

From the Beginner's Guide:

"As of 2008-04rc, Arch is now utilizing the UUID, or Universally Unique Identifier naming convention, for consistent device mapping. This is due to active developments in the kernel and also udev, which may randomly change the ordering in which drivers for storage controllers are loaded, yielding an unbootable system/kernel panic. Nearly every motherboard has several controllers (onboard SATA, onboard IDE), and due to the aforementioned development updates, /dev/sda may become /dev/sdb on the next reboot- hence the persistent device naming convention of UUID has been adopted for reliability."

ls -lF /dev/disk/by-uuid/

Will list all partitions by uuid.

Also:
"Simple' is defined from a technical standpoint, not a usability standpoint. It is better to be technically elegant with a higher learning curve, than to be easy to use, and technically crap." -Aaron Griffin
Note that you may use whatever naming convention you wish in your fstab! You may use /dev/disk/by-label, /dev/sdax, or UUID. If you feel uncomfortable with UUID, change it to sdx, or better still, label your partitions and use /dev/disk/by-label. wink

See here: http://wiki.archlinux.org/index.php/Per … ice_naming

Offline

#12 2008-05-28 12:28:15

11010010110
Member
Registered: 2008-01-14
Posts: 284

Re: UUID in /etc/fstab ?

Do the UUIDs make the system more simple than /dev/sda1 ?




Imo an option to choose the mode should still be provided in the install

Offline

#13 2008-05-28 12:29:47

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,167
Website

Re: UUID in /etc/fstab ?

11010010110 wrote:

Do the UUIDs make the system more simple than /dev/sda1 ?




Imo an option to choose the mode should still be provided in the install

As I said, you may change it. The installer cd is a live environment. Change to another VC, run

ls -lF /dev/disk/by-uuid/

and change it.
You can change your fstab at any time. smile

Offline

#14 2008-05-28 13:56:06

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 3,528

Re: UUID in /etc/fstab ?

11010010110 wrote:

Do the UUIDs make the system more simple than /dev/sda1 ?

Imo an option to choose the mode should still be provided in the install

You are asked to edit /etc/fstab and /boot/menu.lst | /etc/lilo.conf during the installer. Just edit it to whatever you want, label, uuid or dev node.


Evil #archlinux@freenode channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#15 2008-05-28 14:03:50

droog
Member
Registered: 2004-11-18
Posts: 877

Re: UUID in /etc/fstab ?

for an example to keep us sane
could it do-

#/dev/sda
UUID=7121593266874362152765378921 / ext3 defaults
#dev/sda1
UUID=8218758326527681265768176473 swap defaults

Offline

#16 2008-05-28 14:20:28

peart
Member
From: Kanuckistan
Registered: 2003-07-28
Posts: 510

Re: UUID in /etc/fstab ?

droog wrote:

for an example to keep us sane
could it do-

#/dev/sda
UUID=7121593266874362152765378921 / ext3 defaults
#dev/sda1
UUID=8218758326527681265768176473 swap defaults

For most people, that would be a valid suggestion.  But the device name in the comment would often be wrong for the people who have the "disk switching" problem.  Just something to keep in mind.

Offline

#17 2008-05-30 06:34:55

torin_dan
Member
Registered: 2008-04-10
Posts: 8

Re: UUID in /etc/fstab ?

I have an older instalation of Arch, so recently i started experiencing this problem with sda/sbd swiching on every boot, so i replaced everything i could in /boot/grub/menu.lst and /etc/fstab with /dev/disk/by-uuid/ stuff

However then I ls -la /dev/disk/by-uuid/* I don't see my /dev/sda2 (swap partition) so i didn't know what to put in fstab, and kept /dev/sda2

So sometimes on boot everything works, sometimes it can't mount swap and can't boot.

Right now I'm running with no swap at all, but is not an option for long term.

How to retrieve uuid from a partition that doesn't have a link in  /dev/disk/by-uuid/ and how to specify it in /etc/fstab ?

Offline

#18 2008-05-30 09:04:46

neotuli
Lazy Developer
From: San Francisco, CA
Registered: 2004-07-06
Posts: 1,201
Website

Re: UUID in /etc/fstab ?

torin_dan wrote:

I have an older instalation of Arch, so recently i started experiencing this problem with sda/sbd swiching on every boot, so i replaced everything i could in /boot/grub/menu.lst and /etc/fstab with /dev/disk/by-uuid/ stuff

However then I ls -la /dev/disk/by-uuid/* I don't see my /dev/sda2 (swap partition) so i didn't know what to put in fstab, and kept /dev/sda2

So sometimes on boot everything works, sometimes it can't mount swap and can't boot.

Right now I'm running with no swap at all, but is not an option for long term.

How to retrieve uuid from a partition that doesn't have a link in  /dev/disk/by-uuid/ and how to specify it in /etc/fstab ?

Try turning off your swap partition (if it was turned on), then run mkswap on the partition, it will generate and output a new UUID in the process. Please be aware that some hibernation scripts might run mkswap and change the UUID, in which case /dev/disks/by-id or filesystem labels might be able to help you.


The suggestion box only accepts patches.

Offline

#19 2008-05-31 12:36:33

jacko
Member
Registered: 2007-11-23
Posts: 838

Re: UUID in /etc/fstab ?

11010010110 wrote:

Do the UUIDs make the system more simple than /dev/sda1 ?




Imo an option to choose the mode should still be provided in the install

My computer is completely and utterly rendered useless if I use /dev/sdxX thanks to libata. So no matter how simple it is, the way the code is changing is forcing me to use this new approach and its simple enough.

Offline

#20 2008-06-09 12:43:18

pwt
Member
Registered: 2007-07-20
Posts: 20

Re: UUID in /etc/fstab ?

dolby wrote:

UUID's are UNIQUE. AFAIk thats the most important advantage.

Wrong. If you copy a partiion (say for backup purposes, with dd), then the two partitions have the same UUID.

so, in this situation, you have to change the UUID of the copied partition. But if you copied it it was for it to be IDENTICAL and useable for a quick recovery. Whant would you do then ?

This is not a criticism, this is a call for HELP.

Offline

#21 2008-06-09 14:15:34

JeremyTheWicked
Member
From: Poland
Registered: 2008-05-23
Posts: 193

Re: UUID in /etc/fstab ?

pwt wrote:
dolby wrote:

UUID's are UNIQUE. AFAIk thats the most important advantage.

Wrong. If you copy a partiion (say for backup purposes, with dd), then the two partitions have the same UUID.

so, in this situation, you have to change the UUID of the copied partition. But if you copied it it was for it to be IDENTICAL and useable for a quick recovery. Whant would you do then ?

This is not a criticism, this is a call for HELP.

I believe that /dev/disk/by-id would be a way to distinguish them. I have no way to check that though (no free disks to play around with here wink )


arch(3) adj amused because you think you understand something better than other people ;P

Offline

#22 2008-06-09 15:08:26

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,167
Website

Re: UUID in /etc/fstab ?

You could re-label the copied partition and use /dev/disk/by-label.

Offline

Board footer

Powered by FluxBB