LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-10-2006, 04:31 PM   #1
blackzone
Member
 
Registered: Jun 2004
Posts: 256

Rep: Reputation: 30
LABLE under fstab and grub.conf


I saw LABLE used in my grub.conf and fstab. Where can I see a list of all the lable? and any quick summary of what lable do and how to use it?
 
Old 07-10-2006, 04:56 PM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
here is, I guess you can say a rule of thumb for creating a label :
Code:
/sbin/e2label /dev/hdaX /some/mount/point
And then when editing the fstab you put :
Code:
LABEL=/some/mount/point   /some/mount/point   ext3   defaults   1 2
So basically in this scenerio you replace the occurances of /some/mount/point with the mount point you intend to use for, again using this example, hdaX
(where X here and above will be a number specifying the partition.)

As of what does it do, well nothing other than make things look cleaner and robust, rather than using device names, you can use a word so to speak.

Last edited by DrOzz; 07-10-2006 at 04:57 PM.
 
Old 07-10-2006, 04:57 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
labels are an ext2 filesystem thing. Do (as root)

/sbin/fdisk -l
(lowercase ell)

Any partitions that are 'Linux' may have a label.
You can see the label with 'e2label'. Again, as root,

e2label /dev/hda1 (sub your valid ext2/3 partition)

The value of using labels is that as long as they are unique, the physical device name becomes irrelevant for the purpose of mounting partitions at particular mountpoints. If you connected a disk as, say, primary IDE slave (hdb), and then moved it to a secondary master (hdc), the labels would insulate you against having to modify fstab entries for the ext2/3 partitions on that drive.

--- rod.
 
Old 07-10-2006, 05:03 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by DrOzz
here is, I guess you can say a rule of thumb for creating a label :
Code:
/sbin/e2label /dev/hdaX /some/mount/point
And then when editing the fstab you put :
Code:
LABEL=/some/mount/point   /some/mount/point   ext3   defaults   1 2
So basically in this scenerio you replace the occurances of /some/mount/point with the mount point you intend to use for, again using this example, hdaX
(where X here and above will be a number specifying the partition.)

As of what does it do, well nothing other than make things look cleaner and robust, rather than using device names, you can use a word so to speak.
The label applied does not have to be a mountpoint. You can label the partition with arbitrary names. Using the name of the original mountpoint is one convention. There is probably some subset of characters that are allowed, but of course, prudence would dictate the use of 'sane' characters. There is a 16 character length limit.

--- rod.
 
Old 07-10-2006, 05:20 PM   #5
blackzone
Member
 
Registered: Jun 2004
Posts: 256

Original Poster
Rep: Reputation: 30
Is there a way to show all the label the OS have?

I tried man e2label, you can only set label or check label for a specific device.

Is the "label" saved to a file?
 
Old 07-10-2006, 06:36 PM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I repeat: 'labels are an ext2 filesystem thing'.

--- rod.
 
Old 07-10-2006, 07:10 PM   #7
blackzone
Member
 
Registered: Jun 2004
Posts: 256

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by theNbomr
I repeat: 'labels are an ext2 filesystem thing'.

--- rod.
So label isn't stored anywhere on the OS, it's stored directly in the filesystem info. Make sense now. thanx.
 
Old 07-10-2006, 09:15 PM   #8
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
Quote:
Originally Posted by theNbomr
The label applied does not have to be a mountpoint. You can label the partition with arbitrary names. Using the name of the original mountpoint is one convention. There is probably some subset of characters that are allowed, but of course, prudence would dictate the use of 'sane' characters. There is a 16 character length limit.

--- rod.
Quote:
Originally Posted by DrOzz
So basically in this scenerio you replace the occurances of /some/mount/point with the mount point you intend to use for, again using this example, hdaX
(where X here and above will be a number specifying the partition.)

As of what does it do, well nothing other than make things look cleaner and robust, rather than using device names, you can use a word so to speak.
Look at what I said in bold. I didn't say it has to be a mount point, I dummied it down.
 
  


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
Is lilo.conf file format is same for grub.conf? Chundo Linux - Newbie 1 01-30-2006 06:21 PM
If I move hd labels, what changes? fstab, grub.conf... soloist Linux - General 6 03-16-2004 10:31 AM
create lilo.conf or grub.conf through commands newpenguin Linux - Software 1 11-28-2003 08:22 PM
lilo.conf and grub.conf no read access shanenin Linux - Software 1 10-02-2003 03:53 PM
LABELs in /etc/fstab and grub.conf juggler Red Hat 1 09-28-2003 04:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:42 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