How do I mount the filesystem (disk partition) using the filesystem label on the ext3/ext4 file system located on USB disk or hard disk under Linux operating systems?
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/sdc1
Sample outputs:
seagate_2tb_usb
Syntax: Mount Command With Label
The syntax is as follows:
mount -L label_name_here /path/to/mount/point
To mount the /dev/sdc1 using the seagate_2tb_usb label at /media/usb, enter:
# mkdir -p /media/usb
# mount -L seagate_2tb_usb /media/usb
# df -H
Sample outputs:
Filesystem Size Used Avail Use% Mounted on
/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
Please note that my actual device name is /dev/sdf1. Feel free to replace actual label names and mount point as per your requirements.
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
See also:
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 1 comment… read it below or add one }
mount /dev/disk/by-label/SOMEDISKNAME /mnt/foobar
or put this in fstab
LABEL=SOMEDISKNAME /mnt/foobar vfat users,uid=1000,gid=users,umask=0002,utf8=true 0 0