LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   mounting partitions by label (http://www.linuxquestions.org/questions/ubuntu-63/mounting-partitions-by-label-567500/)

OldAl 07-07-2007 08:32 PM

mounting partitions by label
 
Hi,
I have several versions of Linux installed in different partitions on my PC, including kubuntu 7.04. With kerrnel 2.6.20-xx the partitions are assigned hash names (UUID). Some of these names do change when another distro is installed and that plays havoc with grub and access to different distros on the same PC.

I hear that it is possible to mount partitions by their label, rather than UUID, or in older kernels /dev/xxxx. I would greatly appreciate your help on two aspects of this:

1. What is the format for mounting partitions by their labels (i.e. a sample of text in fstab)?
2. How can one assign partition label for partitions without labels?

I would greatly appreciate some advice, particularly when using kubuntu/ubuntu.

From shivering Canberra,
OldAl.

OldAl 07-07-2007 09:21 PM

Quote:

Originally Posted by OldAl
Hi, (snip...)
1. What is the format for mounting partitions by their labels (i.e. a sample of text in fstab)?
2. How can one assign partition label for partitions without labels?
OldAl.

As a trial, I assigned a label to partition on the second IDE disk, /dev/hdb3, with the following command
Code:

# tune2fs -L "HDB3" /dev/hdb3
This shows up OK when checked with cfdisk /dev/hdb. However, if I try to mount it as follows, if fails with a message:
Code:

# mount LABEL=HDB3  /hdb3
"mount" responds with:
mount: Special device /dev/disk/by-label/HDB3 does not exist.

So what is missing?

Confused OldAl.

syg00 07-07-2007 09:28 PM

So did you check in /dev/disk/by-label/ ???
Personally I wouldn't use the quotes.

OldAl 07-07-2007 10:47 PM

Quote:

Originally Posted by syg00
So did you check in /dev/disk/by-label/ ???
Personally I wouldn't use the quotes.

Thanks for the answer. No, initially I did not check the /dev/disk/by-label. I rebooted and then the mount command worked and then there was an entry in the /dev/disk/by-label. So it looks like the much hated Windoz reboot is creeping into linux, too.

Actually, it is not often that one would want to label disks and use labels for mounting, so the reboot is not as bad as the reboot after every program installation.

I was not sure about the use of '"'. I will try next partition label creation without it. I expect it will work, but if it does not, I will report to this list. (If I don't report, it means that it does work and the '"' are superfluous and should not be used.)

Thank you for your help. I feel that the question is truly resolved.

mbr 05-11-2010 08:01 AM

Quote:

Originally Posted by OldAl (Post 2814775)
So it looks like the much hated Windoz reboot is creeping into linux, too.

Not quite right.

Check this up: http://www.linuxquestions.org/questi...6/#post3960817

jay73 05-13-2010 01:08 AM

I believe hdparm -z should do the trick. Alternatively, if you use gparted, just make it scan the drives again after making you edits and that should work, too (possibly because it is indirectly calling the hdparm command).

OldAl 05-14-2010 07:49 PM

Quote:

Originally Posted by jay73 (Post 3966636)
I believe hdparm -z should do the trick. Alternatively, if you use gparted, just make it scan the drives again after making you edits and that should work, too (possibly because it is indirectly calling the hdparm command).

Thanks for that. I see that the question was asked in 2007 and that was in the days of "Legacy GRUB". Frankly, I can not remember why mounting by label was important for me at the time...

I have not yet tried the hdparm -z, but thanks jay73 for your kind reply. Will try RSN!

Ubuntu rocks with grub2, anyway!


All times are GMT -5. The time now is 03:14 PM.