Linux Commands Examples

A great documentation place for Linux commands

e2label

Change the label on an ext2/ext3/ext4 filesystem


see also : mke2fs - tune2fs

Synopsis

e2label device [ new-label ]


add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!

examples

0
source
            
USB_LABEL="$(e2label ${RAW_USB_DEVICE}1)"
if [[ "$USB_LABEL" != "REAR-000" ]]; then
LogPrint "Setting filesystem label to REAR-000"
LogPrint "Setting filesystem label to REAR-000"
e2label ${RAW_USB_DEVICE}1 REAR-000
StopIfError "Could not label '${RAW_USB_DEVICE}1' with REAR-000"
0
source
            
case "$ID_FS_TYPE" in
ext*)
USB_LABEL="$(e2label ${RAW_USB_DEVICE}1)"
if [[ "$USB_LABEL" != "REAR-000" ]]; then
if [[ "$USB_LABEL" != "REAR-000" ]]; then
LogPrint "Setting filesystem label to REAR-000"
e2label ${RAW_USB_DEVICE}1 REAR-000
0
source
            
installkernel() {
return 0
}
install() {
dracut_install md5sum sync pv e2label df date mksquashfs pv sync
0
source
            
usr/sbin/tune2fs \
usr/sbin/e2label \
usr/lib/libext2fs.* \
usr/lib/libblkid.* \
usr/lib/libuuid.* \
usr/lib/libss.so* \

description

e2label will display or change the filesystem label on the ext2, ext3, or ext4 filesystem located on device.

If the optional argument new-label is not present, e2label will simply display the current filesystem label.

If the optional argument new-label is present, then e2label will set the filesystem label to be new-label. Ext2 filesystem labels can be at most 16 characters long; if new-label is longer than 16 characters, e2label will truncate it and print a warning message.

It is also possible to set the filesystem label using the -L option of tune2fs(8).

availability

e2label is part of the e2fsprogs package and is available from http://e2fsprogs.sourceforge.net.


see also

mke2fs , tune2fs


author

e2label was written by Theodore Ts’o (tytso[:at:]mit[:dot:]edu).

How can this site be more helpful to YOU ?


give  feedback