LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LABLE under fstab and grub.conf (https://www.linuxquestions.org/questions/linux-newbie-8/lable-under-fstab-and-grub-conf-462733/)

blackzone 07-10-2006 04:31 PM

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?

DrOzz 07-10-2006 04:56 PM

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.

theNbomr 07-10-2006 04:57 PM

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.

theNbomr 07-10-2006 05:03 PM

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.

blackzone 07-10-2006 05:20 PM

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?

theNbomr 07-10-2006 06:36 PM

I repeat: 'labels are an ext2 filesystem thing'.

--- rod.

blackzone 07-10-2006 07:10 PM

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.

DrOzz 07-10-2006 09:15 PM

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.


All times are GMT -5. The time now is 11:31 AM.