We help IT Professionals succeed at work.

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

MichaelPro
MichaelPro asked
on
871 Views
Last Modified: 2013-12-16
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
Comment
Watch Question

Top Expert 2011

Commented:
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
Top Expert 2011

Commented:
> maybe formated with FAT32 or something).
Please post the result of the following command here:
# fdisk -l

Author

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!
Top Expert 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

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,!
Top Expert 2011

Commented:
Thanks for post the correct solution.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.