Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-16-2008, 10:51 PM
|
#1
|
Member
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473
Rep:
|
fdisk : how to label a partition?
In windows, all these C: and D: drives have a partition label. Is there a way using fdisk to label an ext3 partition?
|
|
|
03-16-2008, 11:11 PM
|
#2
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,336
|
No.
Labels are a feature (???) of the filesystem itself - ext2/3 support it, as does swap. You'd need to check out any others.
cfdisk (not fdisk) will show the labels.
|
|
|
03-16-2008, 11:25 PM
|
#3
|
Member
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473
Original Poster
Rep:
|
I have two linux partitions. When I boot, the NTFS partition on which XP is installed is mounted under 'WindowsXP' in /media. But the other linux is mounted under '/media/1'. I want to be able to give a label to ext3 partitions and be mounted under proper names. Plus, I can't figure out how GNOME decides which partitions to mount since these partitions are not entered in /etc/mtab.
|
|
|
03-17-2008, 12:00 AM
|
#4
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
Downloag PartedMagic - a live distro for partitioning, etc. It lets you label partitions.
http://partedmagic.com/wiki/PartedMagic.php
Edit - it can label existing partitions as well
Last edited by billymayday; 03-17-2008 at 12:09 AM.
|
|
|
03-17-2008, 12:01 AM
|
#5
|
Member
Registered: Sep 2005
Location: Baltimore, MD, USA
Distribution: Fedora, Gentoo, Debian, Slackware, IRIX, OS X
Posts: 192
Rep:
|
Quote:
Originally Posted by concoran
I have two linux partitions. When I boot, the NTFS partition on which XP is installed is mounted under 'WindowsXP' in /media. But the other linux is mounted under '/media/1'. I want to be able to give a label to ext3 partitions and be mounted under proper names. Plus, I can't figure out how GNOME decides which partitions to mount since these partitions are not entered in /etc/mtab.
|
First check fstab instead of mtab. mtab just says what is mounted.
It would seem that you labeled you're windows partition "WindowsXP", which is what the automounter uses that create a mount point in /media, the Label on the filesystem. In Linux filesystems are generally labeled at the time of formating. For example:
Code:
mkfs.ext3 /dev/sda3 -l Gentoo
mkswap /dev/sda4 -L Swap
mkfs.reiser /dev/sda2 -L Slackware
The -[L|l] assigns a label to the partition. In windows, if you install Ext2IFS, after assigning a Windows drive letter to your Linux Partitions, you can rename the Partition just as you would a [FAT16 | FAT32 | NTFS] partition.
|
|
|
04-06-2009, 11:11 AM
|
#6
|
LQ Newbie
Registered: Apr 2009
Posts: 3
Rep:
|
Use e2label.
I know this is in response to a post that is over a year old, but I found this page this morning as I searched for an answer to the same question, and so perhaps it is still worth posting a solution that worked for me.
The first step is to determine which device it is that you want to rename. This is far trickier than it should be, IMHO, but there 'tis.
For volumes that already have a label, there is an elegant method to discover which device is associated with each mounted volume. Open the terminal and type
"ls /dev/disk/by-label -lah" and a list of devices and their labels will result. The problem is, devices which are mounted without labels will not be listed.
For unlabeled volumes, the following clunky method will at least give you the information you need:
Open Nautilus by selecting Places > Computer.
Click on the volume whose name you want to change (unlabeled volumes are listed by their size).
Note the name by which it is identified in /media ... at the top of the window. (e.g., /media/disk-3 or some such).
Open GParted by selecting System > Administration > Partition Editor (You will need to enter your password.)
Scroll through the various disks until you see the one that has the mountpoint of interest (in my example, this would be disk-3).
Make a note of the entry in the "Partition" column. This is the device you want to rename.
The second step is to actually rename the partition. In a terminal window, type "sudo e2label device DesiredName" - for example, "sudo e2label /dev/sdc4 Backup" or some such. The new name will be used the next time you boot the system. (It's unusual to have to reboot in Linux, but this is one of the rare cases in which you must.)
Notes: e2label will only work with ext2 or ext3 formatted partitions, and (and this is a good thing) it will not alter the data in the partition.
For more information type "man e2label" in a terminal window.
Hope this helps someone!
|
|
|
04-06-2009, 12:39 PM
|
#7
|
Member
Registered: Jul 2008
Location: Chennai, India
Distribution: RHEL5, Ubuntu
Posts: 191
Rep:
|
1.how to label a partition?
e2label /dev/hda10 saagar
e2label <partition> <labelname>
2.How to know the label of a partition?
e2label /dev/hda10 <press enter>
<the output will be> -> saagar
hope this helps
|
|
|
01-03-2017, 05:15 AM
|
#8
|
LQ Newbie
Registered: Jan 2017
Distribution: Fedora
Posts: 4
Rep: 
|
You may use parted to name partition: http://www.gnu.org/software/parted/m...node/name.html
It it is not filesystem attribute, so even lvm, swap or partitions without filesystem may use labels.
|
|
|
01-03-2017, 12:28 PM
|
#9
|
Senior Member
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,706
|
Last edited by Soadyheid; 01-03-2017 at 12:43 PM.
|
|
|
03-19-2017, 01:52 PM
|
#10
|
LQ Newbie
Registered: Jan 2017
Distribution: Fedora
Posts: 4
Rep: 
|
Hm, question 8 years without answer. Search engine again and again send users there and they are come to read some thread without solution... Why you think provide answer eventually is useless?
|
|
|
03-19-2017, 02:38 PM
|
#11
|
LQ Guru
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
|
Quote:
Originally Posted by Hubbitus
Hm, question 8 years without answer. Search engine again and again send users there and they are come to read some thread without solution... Why you think provide answer eventually is useless?
|
The problem is, if you don't mind me pointing it out, that your answer isn't correct.
MFT tables don't have a partition label field. A label can only be applied to a filesystem within that partition and is stored in the filesystem, if the filesystem permits it.
GPT will allow you to assign a partition name in addition to the filesystem label.
|
|
|
03-19-2017, 03:16 PM
|
#12
|
LQ Newbie
Registered: Jan 2017
Distribution: Fedora
Posts: 4
Rep: 
|
Problem was in complayn of @Soadyheid what answer is useless.
Parted is universal tool which may deal with much different filesystems also.
|
|
|
03-19-2017, 03:31 PM
|
#13
|
LQ Guru
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
|
Just to explain, Hubbitus:
Quote:
Originally Posted by Hubbitus
|
Incorrect - this only applies to GPT partition tables, not to MBR partition tables. Filesystems within partition tables of both types can however be assigned labels, if they support them, using parted.
Quote:
Originally Posted by Hubbitus
It it is not filesystem attribute, so even lvm, swap or partitions without filesystem may use labels.
|
Incorrect - for GPT partition tables only, this means that partitions without filesystems may use names, not labels. The distinction between these two has to be made due to the historic use of the term "partition label" to refer to the filesystem label.
Soadyheid was correct with his comment. In general, if you don't mind me saying, you should only really resurrect an old thread if you have new accurate information to provide.
In this case, if you had mentioned that your comment was applicable to GPT partitions rather than MBR partitions, and used the word "names" instead of "labels", then your additional info would have been useful. It didn't, so there was the possibility that it would misinform those using MBR partitions.
By the way, welcome to LQ!
Last edited by hydrurga; 03-19-2017 at 04:03 PM.
Reason: Oops
|
|
|
03-19-2017, 09:15 PM
|
#14
|
Member
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
|
@#9: This web-search term might be useful to anyone who hasn't tried it: necropost
#6 actually 'necroposted' 04-06-09, since OriginalPoster ("OP", #1)
didn't respond (to #4/#5) 03-16-08 (nor use ThreadTools at top, to mark as 'Solved').
Here's a couple good intro links on using LQ: a post here, and things here.
@#8: I appreciate your offering Answers  . Here's an idea I had, like ZRT,
to find Threads that are only a couple days old, but may need Answer (ANT  ):
http://linuxquestions.org/questions/blog.php?b=37281
I don't write well, so I'd welcome 'Comments' on improving/etc. that blog!
Anyway, yes, it's probably time to let this Thread 'RestInPeace' 
|
|
|
All times are GMT -5. The time now is 02:41 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|