This is a small post on how we can view list of assigned labels for partitions in Linux OS. We some times assign meaningful labels to partitions so that we can name them in /etc/fstab file for readability. For example most of the time we label boot partition with label as “boot”.
So how can we see available or assigned labels for partitions in Linux? It is possible, we have couple of commands like e2label to see label assigned to that partition.
Through e2label command
root@linuxnix-209:/home/linuxnix# e2label /dev/sda1 boot root@linuxnix-209:/home/taggle#
Through blkid command
/dev/sda1: UUID="26299cdc-ea26-4fcd-a111-9af875d58a81" TYPE="ext4" LABEL="boot"
Through /dev folder mappings
ls -l /dev/disk/by-label/
root@linuxnix-209:/home/linuxnix# ls -l /dev/disk/by-label/ total 0 lrwxrwxrwx 1 root root 10 Nov 18 13:08 boot -> ../../sda1
This /dev/disk/by-label folder and blkid are more useful to list all assigned labels.
Latest posts by Surendra Anne (see all)
- Docker: How to copy files to/from docker container - June 30, 2020
Anisble: ERROR! unexpected parameter type in action:
Fix- June 29, 2020
- FREE: JOIN OUR DEVOPS TELEGRAM GROUPS - August 2, 2019
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
- How to use ohai/chef-shell to get node attributes - July 19, 2018