New Harddrive added, how do i format and label it? Very Simple

Hello,
I have a very simple question. i added a new harddrive in CentOS. I want to format it and name it as /backup . How do i do that? Can you please provide the command. i have access to SSH shell and graphical console but i prefer to do this through SSH. Also, the drive might have already been formated (it's brand new drive, maybe formated with FAT32 or something).

thanks,
Michael
LVL 4
MichaelProAsked:
Who is Participating?
 
wesly_chenCommented:
# fdisk /dev/hdb
n
Enter
Enter
(Maybe another Enter)
w
# /sbin/mke2fs -j /dev/hdb1
# e2label /dev/hdb1  /backup
# mkdir /backup
# echo "LABEL=/backup           /backup               ext3      defaults    1 2" >> /etc/fstab
# mount /backup

For more details, please check the following URL
http://kbase.redhat.com/faq/FAQ_43_381.shtm
0
 
wesly_chenCommented:
Say your new partition is /dev/hdb1, then as root
# e2label /dev/hdb1  /backup
# mkdir /backup
# echo "LABEL=/backup           /backup               ext3      defaults    1 2" >> /etc/fstab
0
 
wesly_chenCommented:
> maybe formated with FAT32 or something).
Please post the result of the following command here:
# fdisk -l
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
MichaelProAuthor Commented:
Here it is:
------------------------------------------------------------
[root@cpanel ~]# fdisk -l

Disk /dev/hda: 64.4 GB, 64423526400 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        7832    62806117+  8e  Linux LVM

Disk /dev/hdb: 64.4 GB, 64423526400 bytes
16 heads, 63 sectors/track, 124828 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Disk /dev/hdb doesn't contain a valid partition table
[root@cpanel ~]#
------------------------------------------------------------

Thanks!
0
 
MichaelProAuthor Commented:
Thanks,
it worked with slight modification

# fdisk /dev/hdb
n
Enter
p
Enter
enter partition number (1-4):    <-- for one partition press 1
Enter   (for default maximum available size)
Enter   (for default maximum available size)
(Maybe another Enter)
w
# /sbin/mke2fs -j /dev/hdb1
# e2label /dev/hdb1  /backup
# mkdir /backup
# echo "LABEL=/backup           /backup               ext3      defaults    1 2" >> /etc/fstab
# mount /backup


thanks,!
0
 
wesly_chenCommented:
Thanks for post the correct solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.