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.
🐧 1 comment so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
thanks
I am newly to Linux but it is clear
thanks again