Linux – Mount partition by label

List of labels

You can view the list of existing labels in the following path:

/dev/disk/by-label/

 

If this directory does not exist, then there are no labels in the system

 

Adding a label

For different file systems, the label is added differently.

ext2/ext3/ext4:

e2label /dev/sda1 LABEL

reiserfs:

reiserfstune -l LABEL /dev/sda1

jfs:

jfs_tune -L LABEL /dev/sda1

xfs:

xfs_admin -L LABEL /dev/sda1

 

Where, "LABEL" – a unique label, "/dev/sda1" – necessary partition

 

fstab

An example of recording in fstab to mount an xfs section on the "SITE" label

LABEL=SITE	/var/www/html/site	xfs	defaults	0 0

 

Tagged: Tags

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments