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

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

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

How to Make Website WCAG Compliant?

Next Post

Link download Kali Linux 2020.1 (ISO + Torrent)

Related Posts