LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-11-2010, 09:28 PM   #1
tightlikethat
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
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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
tightlikethat
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
catkin
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
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,058

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


Reply


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 8 01-03-2017 12:28 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


All times are GMT -5. The time now is 09:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration