Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Linux modifies file system volume labels

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you the "Linux how to modify the file system volume label", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Linux how to modify the file system volume label" this article.

File volume labels in Linux systems make it easier for you to navigate to your disk partition, which is indispensable for Linux systems to run.

Looking at the Linux file system volume label first let's see which file systems already have a volume label and which don't. You can use the blkid command to view your file system information. You need to run this command as root to see all the information about the file system.

Sudo blkid-c / dev/null

The information output in my netbook is like this.

/ dev/sda1: LABEL= "WINRE" UUID= "80AE-9D55" TYPE= "vfat" / dev/sda2: LABEL= "OS_Install" UUID= "E468676968673A06" TYPE= "ntfs" / dev/sda3: UUID= "012ff341-f854-4c4f-8bbd-bbc810121fe6" TYPE= "ext4" / dev/sda5: UUID= "ec0fe4d1-e21c-407d-8374-aa4b470519da" TYPE= "ext3" / dev/sda6: UUID= "ee275431-64b2-4f55-b958-4055147cdf4e" TYPE= "swap" / dev/sda7: UUID= "99feb5c5-99feb5c5-25a6" -6d466c0094ab "TYPE=" ext4 now I can also list a file system mounted on my current system with the lsblk command.

Lsblk

The output on my Linux Mint system is like this.

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 149.1G 0 disk |-sda1 8:1 03.9G 0 part |-sda2 8:2 039.1G 0 part |-sda3 8:3 09.3G 0 part / |-sda4 8:4 01K 0 part |-sda5 8:5 086G 0 part / home |-sda6 8:6 01.4G 0 part [SWAP] |-sda7 8:7 0 9.3G 0 part as you can see On the output information of blkid and lsblk commands Only my Windows partition has a volume subject, and browsing the file manager can see that each partition has a common name.

Need to edit linux file system label

Partition without volume label

Using e2label to edit the Linux file system volume label to view the output of the lsblk command, I can see that my Linux Mint is installed on the / dev/sda3 partition, my / home partition is on the / dev/sda5 partition, and my Xubuntu is installed on the / dev/sda7 partition. I run the e2label command as root to assign volume labels to these partitions.

Sudo e2label / dev/sda3 Mint

Sudo e2label / dev/sda5 Home

Sudo e2label / dev/sda7 Xubuntu

Now look at the output of the blkid command

Sudo blkid-c / dev/null / dev/sda1: LABEL= "WINRE" UUID= "80AE-9D55" TYPE= "vfat" / dev/sda2: LABEL= "OS_Install" UUID= "E468676968673A06" TYPE= "ntfs" / dev/sda3: UUID= "012ff341-f854-4c4f-8bbd-bbc810121fe6" TYPE= "ext4" LABEL= "Mint" / dev/sda5: UUID= "ec0fe4d1-e21c-407d-8374-aa4b470519da" TYPE= "ext3" LABEL= "Home" / dev/sda6: UUID= "ee275431-64b2-4f55-b958-4f55-b958" Swap "/ dev/sda7: UUID=" 99feb5c5-25a6-47a3-aa2c-6d466c0094ab "TYPE=" ext4 "LABEL=" Xubuntu "can see that the volume label has been added. Looking at the file manager, I can also see that my 10.0GB partition now shows the Xubuntu volume label.

After editing Linux file system label

File system with volume label

Note that you can also use the e2label command to view individual partition volume labels, such as partition 5.

Sudo e2label / dev/sda5

Delete the volume label for partition 5

Sudo e2label / dev/sda5 ""

The above is all the contents of the article "how to modify the file system volume label by Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report