Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 858
  • Last Modified:

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
0
MichaelPro
Asked:
MichaelPro
  • 4
  • 2
1 Solution
 
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
 
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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now