The e2label command will display or set the filesystem label. The mount command has the option to mount partition that has the specified label. To see your current label type the following command:
# e2label /dev/sdc1Sample outputs:
seagate_2tb_usb
Syntax: Mount Command With Label
The syntax is as follows:To mount the /dev/sdc1 using the seagate_2tb_usb label at /media/usb, enter:
mount -L label_name_here /path/to/mount/point
# mkdir -p /media/usb
# mount -L seagate_2tb_usb /media/usb
# df -HSample outputs:
Filesystem Size Used Avail Use% Mounted onPlease note that my actual device name is /dev/sdf1. Feel free to replace actual label names and mount point as per your requirements.
/dev/md0 127G 902M 120G 1% /
tmpfs 1.1G 0 1.1G 0% /lib/init/rw
udev 1.1G 267k 1.1G 1% /dev
tmpfs 1.1G 0 1.1G 0% /dev/shm
/dev/md2 1.6T 81G 1.5T 6% /data
/dev/mapper/cryptvg-mybackup
635G 48G 555G 8% /securebackup
/dev/sdf1 2.0T 858G 1.1T 46% /media/usb
Update /etc/fstab File
You can update the /etc/fstab file as follows to mount it automatically using the disk label:LABEL=seagate_2tb_usb /media/usb ext3 defaults 0 0
No comments:
Post a Comment