Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-11-2010, 09:28 PM   #1
LQ Newbie
Registered: Dec 2009
Posts: 9

Rep: Reputation: 0
issue with creating new partition and label

Hello. I am a newbie to Linux and I am using CentOs. I am trying to create a new partion on my CentOs VM. I create a new primary partition using fdisk (I use the command fdisk /dev/hda). After I create the partition and use partprobe to write the partition to disk, I try to give the new partition a label. So, I use the command e2label /dev/hda LABEL=test

However, when I enter the command e2label /dev/hda3 , it doesn't display the label for the newly created partition. Am I doing something wrong here? Is the syntax of the e2label command wrong when creating the label for the new partition? Did I miss a step after writing the new partition to disk. Any help would be much appreciated. Thank you.
Old 03-11-2010, 09:31 PM   #2
LQ Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Have you created actual filesystems? e2label simply changes or displays the label of an EXT2/3 filesystem, there needs to be a filesystem in place for it to do anything. When you partition the disk you are simply making empty partitions which you must then actually format to be whatever filesystem you want to use.
Old 03-11-2010, 09:45 PM   #3
LQ Newbie
Registered: Dec 2009
Posts: 9

Original Poster
Rep: Reputation: 0
So after I created the partition, I used the following command mkfs.ext3 /dev/hda3 to format the new partition to ext3. Is this the right command?
Old 03-11-2010, 10:05 PM   #4
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Yes, mkfs.ext3 /dev/hda3 is good. After that you want e2label /dev/hda test (unless you really do want the label "LABEL=test")
Old 03-11-2010, 10:08 PM   #5
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,995

Rep: Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218Reputation: 2218
mkfs will assign a label if desired - no need for e2label in this case.


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
fdisk : how to label a partition? concoran Linux - Newbie 13 03-19-2017 09:15 PM
Get the label of a partition Willy Fog Programming 2 09-17-2009 07:45 AM
Label to partition association jackpal Linux - General 5 10-21-2008 03:41 AM
How to LABEL Swap partition badrat Linux - Certification 4 10-19-2006 11:33 PM
How can I rename the LABEL on my partition xkape Linux - General 3 01-18-2006 03:49 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:00 PM.

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