Author Topic: (Solved) a question about drive identification  (Read 2373 times)

Offline critter

  • Full Member
  • ***
  • Posts: 220
(Solved) a question about drive identification
« on: September 12, 2009, 02:22:18 PM »
The latest and greatest from text and the gang uses the (unintelligible to soft bodied species) uuid as the default drive id in fstab and menu.lst where I have tended to have used the traditional /dev/xdxn or LABEL=name method.
Perhaps somebody could explain to me the advantage of this adoption for a 'Radically Simple', mostly single user/ small lan distro. ???

I don't want to rattle any heads here but I would be interested/ like to be educated. :)

Answers in binary on a digital postcard will be marked 'return to 011100110110010101101110011001000110010101110010" ;)


  
« Last Edit: September 14, 2009, 01:04:45 AM by critter »
Motherboard   Gigabyte Z68X-UD3H-B3
Hard Drives      2 x Maxtor STM350032 500GB SATA
Memory      16GB RAM
Processor      Intel core i5 3.30GHz
Video         nVidia GeForce GT430
Sound      HDA Intel PCH
PCLinuxOS          KDE

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6235
Re: a question about drive identification
« Reply #1 on: September 12, 2009, 02:42:54 PM »

an example of when the "traditional way" doesnt work.

you have two external drives named "A" and "B"

you plug in A and the system gives it "/dev.sda1" and then you plug in B and its given "/dev/sda2"  and you set up fstab using these "/dev/" addresses and all is well

later on, you unplug them both and you connect "B" first and the system will give it address "/dev/sda1" since its not being used and fstab connect it to drive A's mount point because thats what fstab entry says

you connect drive C later one and it will be given "/dev/sda2" address and fstab will mount it to where you expect drive B to be

you connect B and the system will give it address "/dev/sda3" and there is no entry for it  in fstab and mount command complains about it

the above is the problem with the "old" way ..the uuid number is supposed to be unique to every partition( or hard drive???) and the above problem will not show up with uuid

partition usually are renumbered when a new partition is created, an old one is deleted or merged and this will confuse fstab because it will continue to have old partition numbers instead of the new ones and a manual edit will be required
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline critter

  • Full Member
  • ***
  • Posts: 220
Re: a question about drive identification
« Reply #2 on: September 12, 2009, 02:56:53 PM »
I have 2 identical external usb drives. I wrote a number one on the first and 2 on the second.
I gave the drives labels USB1 & USB2
In fstab I have the lines
LABEL=usb1 /media/usb1 ext3 noauto,user 0 0
LABEL=usb2 /media/usb2 ext3 noauto,user 0 0

no confusion by fstab and obvious in commands like df. :)
radically simple!
Motherboard   Gigabyte Z68X-UD3H-B3
Hard Drives      2 x Maxtor STM350032 500GB SATA
Memory      16GB RAM
Processor      Intel core i5 3.30GHz
Video         nVidia GeForce GT430
Sound      HDA Intel PCH
PCLinuxOS          KDE

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6235
Re: a question about drive identification
« Reply #3 on: September 12, 2009, 03:12:01 PM »

in theory, uuids are supposed to be unique ...i believe one of the "u" stands for "unique" ...

what if you have two or more external devices with the same label? with only two devices, even the above example i gave can be "managed" by plugging in the devices in a particular order ..your solution will work only by making sure each device has a unique label and
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: a question about drive identification
« Reply #4 on: September 12, 2009, 03:25:00 PM »
The latest and greatest from text and the gang uses the (unintelligible to soft bodied species) uuid as the default drive id in fstab and menu.lst where I have tended to have used the traditional /dev/xdxn or LABEL=name method.
Perhaps somebody could explain to me the advantage of this adoption for a 'Radically Simple', mostly single user/ small lan distro. ???

I don't want to rattle any heads here but I would be interested/ like to be educated. :)

Answers in binary on a digital postcard will be marked 'return to 011100110110010101101110011001000110010101110010" ;)
 

As explained each partition has a unique identifier.
When partitions are dynamically mounted their device nodes will change with circumstances.

Labels are more distinctive than device nodes but are not unique.

So the only certain method of correctly booting or mounting a specific partition is by its unique identifier.

That is why it has been adopted in Linux.

You can of course make changes to your specific mount points and use device nodes or Labels if you wish.

The UUID comes into play mostly for removable media ...... which can be plugged into any hardware setup and not just a particular one.

Should you ever wish to compare or change any of those settings you can use the command
blkid
to find the UUID (and Label if there is one) for each partition in your system.

Code: [Select]
$ blkid
/dev/sda8: LABEL="Data" UUID="45c87840-1a53-4988-9bbe-38514fbbfb62" TYPE="ext3"
/dev/sda9: LABEL="Data2" UUID="92dfe992-d1b8-47fc-8275-a3ce4232f4cd" TYPE="ext3"
/dev/sda1: UUID="4A35-84C5" TYPE="vfat"
/dev/sda5: TYPE="swap" UUID="4bfd54de-974f-473e-87af-050e9e99a7bb"

Removable media in PCLOS is mounted by Label (default) if one exists.
If none exists then something along the lines of  /media/disk  is used.

regards.

altair4

  • Guest
Re: a question about drive identification
« Reply #5 on: September 12, 2009, 04:25:19 PM »

in theory, uuids are supposed to be unique ...i believe one of the "u" stands for "unique" ...

Here's an example of where UUID's can get you into trouble. This is from my system ( it's a long story ):
Quote
/dev/sda1: UUID="DA9056C19056A3B3" LABEL="WinXP" TYPE="ntfs"
/dev/sda2: UUID="DA9056C19056A3B3" LABEL="WinXP2" TYPE="ntfs"

As you can see, I've become a LABEL= user ;)

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6235
Re: a question about drive identification
« Reply #6 on: September 12, 2009, 05:09:22 PM »

in theory, uuids are supposed to be unique ...i believe one of the "u" stands for "unique" ...


Here's an example of where UUID's can get you into trouble. This is from my system ( it's a long story ):
Quote
/dev/sda1: UUID="DA9056C19056A3B3" LABEL="WinXP" TYPE="ntfs"
/dev/sda2: UUID="DA9056C19056A3B3" LABEL="WinXP2" TYPE="ntfs"


As you can see, I've become a LABEL= user ;)



more info on UUID can be found here: http://en.wikipedia.org/wiki/UUID

your UUIDs dont seem to be standard as the standard says they are in for form "8-4-4-4-12 for a total of 36 characters (32 digits and 4 hyphens). For example:
    550e8400-e29b-41d4-a716-446655440000 "


so, where did you get those "fake" UUID < insert appropriate title>? :D :D

.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline critter

  • Full Member
  • ***
  • Posts: 220
Re: a question about drive identification
« Reply #7 on: September 13, 2009, 02:13:38 AM »
I have never disputed that UUID identification is more likely to be more unique than the other methods.
In some of the more 'in your face' distros like Slackware or even Fedora I would expect it. But in a distribution whose motto is "Radically Simple" (and for the most part it is - Thanks Tex) I wondered if it is really necessary.

 I am sure that anybody in the early stages of getting to grips with Linux would find editing fstab with plain language labels where it is obvious which device they are modifying somewhat less disturbing than having to deal with the Martian UUID. Or is there really something more fundamental that I am missing?

That really was my point :)
Motherboard   Gigabyte Z68X-UD3H-B3
Hard Drives      2 x Maxtor STM350032 500GB SATA
Memory      16GB RAM
Processor      Intel core i5 3.30GHz
Video         nVidia GeForce GT430
Sound      HDA Intel PCH
PCLinuxOS          KDE

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11561
  • ----IOFLU----
Re: a question about drive identification
« Reply #8 on: September 13, 2009, 02:44:26 AM »
I have never disputed that UUID identification is more likely to be more unique than the other methods.
In some of the more 'in your face' distros like Slackware or even Fedora I would expect it. But in a distribution whose motto is "Radically Simple" (and for the most part it is - Thanks Tex) I wondered if it is really necessary.

 I am sure that anybody in the early stages of getting to grips with Linux would find editing fstab with plain language labels where it is obvious which device they are modifying somewhat less disturbing than having to deal with the Martian UUID. Or is there really something more fundamental that I am missing?

That really was my point :)

It's really a function of the kernel development guys. UUID is easy to generate, and assures that the right partition gets mounted in the right place, no matter what drive it may be on, or how that drive may be designated. Labels are equally good, but take judgment on the part of the user to be both unique and meaningful to them, so they are an option than can be used either during installation, or after. It's not a choice for the distribution to make, it's a choice for the user. Most beginners won't even know what you're talking about at the time of installation. They just want the system to work now, and UUID mounting does just that. Experienced users have no problem choosing labels over UUID, if that's their preference.

Once the system is up and running, those users that like to tinker, usually ask about alternatives to UUID, at some time or another, when they are familiar enough with the system to think they're ready to try something different. Switching to labels is easy, once it's been explained, and there is plenty of help to be found, both by means of Google, and through the forum. It is what is, and not worth getting ones knickers in a bind over. ;)
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline critter

  • Full Member
  • ***
  • Posts: 220
Re: a question about drive identification
« Reply #9 on: September 13, 2009, 05:53:49 AM »
Thankyou o-p, for that explanation, that is all I wanted to know.
 once again your knowledge and reasoning have brought order where there was only chaos,
I shall surely sleep soundly now ;)
Motherboard   Gigabyte Z68X-UD3H-B3
Hard Drives      2 x Maxtor STM350032 500GB SATA
Memory      16GB RAM
Processor      Intel core i5 3.30GHz
Video         nVidia GeForce GT430
Sound      HDA Intel PCH
PCLinuxOS          KDE

altair4

  • Guest
Re: a question about drive identification
« Reply #10 on: September 13, 2009, 05:59:38 AM »

more info on UUID can be found here: http://en.wikipedia.org/wiki/UUID

your UUIDs dont seem to be standard as the standard says they are in for form "8-4-4-4-12 for a total of 36 characters (32 digits and 4 hyphens). For example:
    550e8400-e29b-41d4-a716-446655440000 "


so, where did you get those "fake" UUID < insert appropriate title>? :D :D

That depends on who or what set the UUID and why:

NTFS: UUID="DA9056C19056A3B3"
VFAT: UUID="4848-E35A"
EXT3: UUID="076426af-cbc5-4966-8cd4-af0f5c879646"
« Last Edit: September 13, 2009, 06:12:37 AM by altair4 »

Offline critter

  • Full Member
  • ***
  • Posts: 220
Re: a question about drive identification
« Reply #11 on: September 13, 2009, 10:44:34 AM »

That depends on who or what set the UUID and why:

NTFS: UUID="DA9056C19056A3B3"
VFAT: UUID="4848-E35A"
EXT3: UUID="076426af-cbc5-4966-8cd4-af0f5c879646"
I didn't know that either thank you altair4. :)

 I just keep learning from you guys 8) 8)
Motherboard   Gigabyte Z68X-UD3H-B3
Hard Drives      2 x Maxtor STM350032 500GB SATA
Memory      16GB RAM
Processor      Intel core i5 3.30GHz
Video         nVidia GeForce GT430
Sound      HDA Intel PCH
PCLinuxOS          KDE

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11561
  • ----IOFLU----
Re: a question about drive identification
« Reply #12 on: September 13, 2009, 01:49:17 PM »

That depends on who or what set the UUID and why:

NTFS: UUID="DA9056C19056A3B3"
VFAT: UUID="4848-E35A"
EXT3: UUID="076426af-cbc5-4966-8cd4-af0f5c879646"
I didn't know that either thank you altair4. :)

 I just keep learning from you guys 8) 8)

That's the whole point. Glad it's not wasted effort. ;D

Just a FYI, I don't like UUID, only because I have so many partitions it gets annoying to have to keep checking those long numbers when setting up mount points on a new installation. I never liked labels either, until the kernel guys decided to lump all drives under sdx, making all partitions sdxn. With USB drives in the mix, the drive numbers are subject to shifting at any time, so UUID was the fix, rather than code different designations for each type of drive, as we had before. It's one of those things that was not broken, but they decided to fix it anyway, and induced the problem as a direct result. We, having no say so at that level of development, must just live with it, and cope. ;D

Given the choice between UUID and labels, I choose labels. I label the partitions with the name of the mount point directory, wherever possible, so it's real easy to see what goes where. My / partitions are labeled with the name of the OS installed there, with variations, in case I have more than one installation of that OS. It makes things easy for me, because all I need to see is the label, to know exactly what's on that particular partition. ;)
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline critter

  • Full Member
  • ***
  • Posts: 220
Re: a question about drive identification
« Reply #13 on: September 13, 2009, 02:01:14 PM »
I think o-p, that you and I are on the same wavelength here, although I do not presume to be on the same plane, master. ;D
Motherboard   Gigabyte Z68X-UD3H-B3
Hard Drives      2 x Maxtor STM350032 500GB SATA
Memory      16GB RAM
Processor      Intel core i5 3.30GHz
Video         nVidia GeForce GT430
Sound      HDA Intel PCH
PCLinuxOS          KDE

Offline Joble

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6804
  • USA - Mountain Time
Re: a question about drive identification
« Reply #14 on: September 13, 2009, 02:25:30 PM »
I've been looking for a stairway, so I could get there too.  So far, I haven't found one, just a lot of reading stuff, and a failure to comprehend.
Search First.
Forum Rules
Hero means I talk a lot, nothing more, nothing less!
Have an Awesome Day!
Healthy System