Red Hat Enterprise Linux how do I add a new hard disk for backup?

by on December 16, 2006 · 1 comment· LAST UPDATED December 15, 2006

in , ,

Q. For backup I have added a new hard disk to my remote Linux server. How do I use 250GB SATA hard disk for backup? When I run fdisk -l it shows me one partition. I am using RHEL v4.0

A. You need to use following commands
mke2fs command is used to create an ext2/ext3 filesystem (usually in a disk partition). General syntax is as follows:
mkfs.ext3 /dev/hdX or mkfs.ext3 /dev/sdX : For ext3 file system
mkfs.ext2 /dev/hdX or mkfs.ext3 /dev/sdX : For ext2 file system
mke2fs -j /dev/hdX or mke2fs -j /dev/sdx : Create the filesystem with an ext3 journal.

e2label command will display or change the filesystem label on the ext2/3 filesystem located on device. General syntax is as follows:
e2label /dev/hdX /directory-name
e2label /dev/sdX /directory-name

/etc/fstab - Add your partition here so that it can be automouted after reboot.

For example if your hard disk partition name is /dev/sdb1 type the following commands:
Format a file system
# mke2fs -j /dev/sdb1
Create a mount point
# mkdir /databackup
Make sure only root is allowed to use backup
# chown 0:0 /databackup
# chmod 0700 /databackup

Setup a lable:
# e2label /dev/sdb1 /databackup
Updated /etc/fstab file
# echo "LABEL=/databackup /databackup ext3 defaults 1 2" >>/etc/fstab
Mount newly created file system
# mount -a
OR
# mount /databackup
Verify that everything is working
# df -H
# mount

Next write down backup script to backup data or mysql database. See all our backup related articles for more information.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 1 comment… read it below or add one }

1 rafi July 27, 2009 at 9:29 am

thanks
I am newly to Linux but it is clear
thanks again

Reply

Leave a Comment

Tagged as:

Previous Faq:

Next Faq: