LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 03-16-2008, 09:51 PM   #1
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Rep: Reputation: 30
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?
 
Old 03-16-2008, 10:11 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
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.
 
Old 03-16-2008, 10:25 PM   #3
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Original Poster
Rep: Reputation: 30
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.
 
Old 03-16-2008, 11:00 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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-16-2008 at 11:09 PM.
 
Old 03-16-2008, 11:01 PM   #5
armanox
Member
 
Registered: Sep 2005
Location: Baltimore, MD, USA
Distribution: Fedora, Gentoo, Debian, Slackware, IRIX, OS X
Posts: 192

Rep: Reputation: 32
Quote:
Originally Posted by concoran View Post
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.
 
Old 04-06-2009, 10:11 AM   #6
rmadla
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Rep: Reputation: 0
Smile 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!
 
Old 04-06-2009, 11:39 AM   #7
saagar
Member
 
Registered: Jul 2008
Location: Chennai, India
Distribution: RHEL5, Ubuntu
Posts: 191

Rep: Reputation: 37
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
 
Old 01-03-2017, 04:15 AM   #8
Hubbitus
LQ Newbie
 
Registered: Jan 2017
Distribution: Fedora
Posts: 4

Rep: Reputation: Disabled
Thumbs up

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.
 
Old 01-03-2017, 11:28 AM   #9
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,673

Rep: Reputation: 487Reputation: 487Reputation: 487Reputation: 487Reputation: 487
Another resurrected post. This one died about eight years ago, bringing it back to the surface serves no purpose.



However... Everybody's done it. Please check the posting date before adding to a thread.

Play Bonny!


Last edited by Soadyheid; 01-03-2017 at 11:43 AM.
 
Old 03-19-2017, 12:52 PM   #10
Hubbitus
LQ Newbie
 
Registered: Jan 2017
Distribution: Fedora
Posts: 4

Rep: Reputation: Disabled
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?
 
Old 03-19-2017, 01:38 PM   #11
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by Hubbitus View Post
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.
 
Old 03-19-2017, 02:16 PM   #12
Hubbitus
LQ Newbie
 
Registered: Jan 2017
Distribution: Fedora
Posts: 4

Rep: Reputation: Disabled
Problem was in complayn of @Soadyheid what answer is useless.

Parted is universal tool which may deal with much different filesystems also.
 
Old 03-19-2017, 02:31 PM   #13
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Just to explain, Hubbitus:

Quote:
Originally Posted by Hubbitus View Post
You may use parted to name partition: http://www.gnu.org/software/parted/m...node/name.html
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 View Post
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 03:03 PM. Reason: Oops
 
Old 03-19-2017, 08:15 PM   #14
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
@#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'
 
  


Reply

Tags
ext3, fdisk, label, partition



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding original parition label of a partition the_gripmaster Fedora 5 05-01-2007 07:54 AM
How to LABEL Swap partition badrat Linux - Certification 4 10-19-2006 10:33 PM
fdisk -l output with partition label appended - Bash script available Emmanuel_uk Programming 7 06-10-2006 05:08 AM
How can I rename the LABEL on my partition xkape Linux - General 3 01-18-2006 02:49 PM
change partition label w/o format gjo Linux - General 5 06-28-2005 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration