LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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: 468

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: 12,224

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
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: 468

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
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: 36
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
 
  


Reply

Tags
ext3, fdisk, label, partition


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 08:45 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration