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

ADVERTISEMENTS

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.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
1 comment… add one
  • rafi Jul 27, 2009 @ 9:29

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

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.