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 to use Linux LABEL effectively

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article will give you a detailed explanation on how to make effective use of Linux LABEL. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

People who have been using linux for a long time may get tired of device names like sda, especially if they have multiple peripheral storage or multiple hard drives. I don't know what that partition is for. Here's how to make effective use of Linux LABEL. The file system in Linux/Unix (actually Windows's file system) supports LABEL, the alias for the partition, which can be named by a meaningful name. Benefits:

1 for example, if you have many partitions, e2label will know what this partition is for.

Desktop environment such as 2 gnome integrates automount mechanism and inserts removable hard disk. If the partition has label, then the mount name is label, which is very intuitive.

3 when multiple systems coexist, it is more intuitive to use label to distinguish different systems.

Follow me, first of all, in a desktop environment like gnome/kde (which can support automatic mounting), take an empty mobile hard disk, assume that the plugged device is / dev/sdb, and divide 2-3 partitions with cfdisk

Then, use the

Code:

Mkfs-t ext3 / dev/sdbX

To format

When you are done, hot-plug the hard drive and wait for automatic identification and mount

OK, mount it. Look at the mounted folder and display name of the partition. They are all like disk disk-1. If you don't look for them carefully, you really don't know which partition corresponds to which directory.

Unmount the mounted partition and reformat the partition, but the slightly different is the way the formatting command is written:

Code:

Mkfs-t ext3-L TheName / dev/sdbX

Each partition has a different name.

Then, hot-plug and unplug again to see the directory name and display name of the auto-mount.

Just like the partition renaming in windows (the partition name of windows is the same as linux LABEL)

What if the partition has data? It's simple:

Code:

Tune2fs-L TheName / dev/sdbX

This is the general situation, and LABEL and UUID are better mechanisms for fstab, so I won't say any more here. The default fstab hard disk partition should be identified by uuid, and using label is just a rerepresentation of a string of characters.

This is the end of the article on "how to use Linux LABEL effectively". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

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

Servers

Wechat

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

12
Report