Why use e2label
Creating a small partition on each disk just to be able to label this partition as suggested by Stephane Chazelas is also an option, but I think that would be too confusing for somebody else who might have to maintain the system at a later time.
Create a udev rule using the disk's guaranteed unique WWN if it has one , otherwise using the combined vendor and serial IDs:. You will definitely see a PCI path for each drive bay. You just need to use 1 known disk to ensure you get the labels right. The disk is already labeled as sda , sdb , sdc The partitions are then labeled for example on sda : sda1 , sda Sign up to join this community.
The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Can I label a disk device rather than a partition?
Ask Question. Asked 8 years, 1 month ago. Active 1 year, 10 months ago. Viewed 14k times. I know about the e2label and friends program for attaching a label to a disk partition e. Is that possible and if yes, how?
Improve this question. This is a great question as you are one of the fitst, who got the concept right. The labels' main purpose is to uniquely identify a partition even when the drives are enumerated differently after the next reboot. But while drives might get reordered, partitions stay fixed on their drive. There is nothing wrong in adding a label to the partition, but the default case should be to use a UUID per drive and not per partition. Thanks, but I doubt that I am really one of the first.
This problem has irked my for a long time already. That's also what I want to do. I think the OP is referring to the "name" of the entire physical disk. For some reason I formatted it and created only one single partition. I didn't give name to the partition nor the file system. And I know I can do both easily in Disk. How does Disk get that name? And is it possible for me to change it? Add a comment.
Active Oldest Votes. Improve this answer. I think this is the best solution to my actual problem, but I can't accept this as answer because it does not answer the question. Unless I modify the question which is probably not a good idea. Distro Ubuntu Re: Is it safe to change HDD labels?
At least both e2label and tune2fs should be fine, and can be used for this purpose even if the drive is mounted. I'd advice against having a space in the label not sure if that's even allowed or not , and keep in mind the max length is 16 characters.
Otherwise small changes like this should not cause any issues I've used tune2fs for much more complicated tweaks even with mounted filesystems without any problems , but if your drive is mounted using fstab, you might want to make sure it's done using UUID instead of device name or label before making the chance. July 22nd, 3. Beans 5, I use e2label. You don't need to unmount the partition to use it. See existing label if any Code:. July 22nd, 4. Distro Ubuntu. I try to remember to include label when I create partition with gparted.
So I often use Disks or Disk Utility to add label later. Once or twice I have used command line, so any of the methods should be fine. It mounts by the label assigned to it, instead of the device name. What's that? How do we manage the label? I am so glad you asked! The answer is simple, but yet it's not. Basically it depends on what file system you formatted the disk with.
For the purposes of this article, I will stick with the two most popular from my travels anyway , and that is ext2 and reiser. For ext2 file systems, you use the command e2label to view and set the file system label. Notice above that the file system is actually ext3, and not ext2. For anyone who doesn't know, ext3 is really ext2 with journaling turned on, so the e2label command applies to it as well. Journaling simply means that the file system logs all changes to a journal before actually committing the changes to the disk.
This means that you are much less likely to suffer from disk corruption in the event of a hard stop, power off, etc. The journal can simply be replayed when it comes back up, therefore catching up on any changes that did not get committed. It's a very cool and highly recommended feature, plus who wants to sit through those lengthy fsck sessions? Back to labels, if you want to set the label, you use the e2label command still, you simply specify the desired disk label after the path.
If I were setting the label on the device in question, it would look like this:. Nifty, huh? Parted User's Manual - 2. Re- How to change a partition's label. Vol 25, No. A : Vol 25, No. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
Grammar and spelling errors should be expected.
0コメント