•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

sBlock - Backup on RHEL, CentOS, AlmaLinux & Rocky Linux

  • Home
  • Client
  • Knowledgebase
  • Storage
  • sBlock
  • sBlock - Backup on RHEL, CentOS, AlmaLinux & Rocky Linux

Table Of Content

Related Articles

  • sBlock - Backup on Debian, Ubuntu and Related OS
  • sBlock - Snapshot Restore
  • sBlock - Snapshots Create
  • sBlock - Snapshots Intro
  • sBlock - iSCSI Windows Guide
  • sBlock - iSCSI Linux Guide
  • sBlock - Delete
  • sBlock - Intro
  • sBlock - Create
  • Views: (565)
  • Votes: (0)
Was this article helpful?
VOTE

sBlock - Backup on RHEL, CentOS, AlmaLinux & Rocky Linux

Publisher: Psychz Networks,  January 04,2025

This guide will walk you through setting up a backup system on your Red Hat Enterprise Linux (RHEL), CentOS (including CentOS 7 and CentOS Stream), AlmaLinux, or Rocky Linux server using our block storage, which communicates via the iSCSI protocol. The steps are identical across these distributions.

Prerequisites

  • A server running RHEL, CentOS, AlmaLinux, or Rocky Linux with root or sudo privileges.
  • Access to your iSCSI sblock storage target.
  • The iscsi-initiator-utils package installed.

Step 1: Install the iSCSI Initiator

First, install the required package:

sudo dnf install iscsi-initiator-utils -y

For CentOS 7, use yum instead:

sudo yum install iscsi-initiator-utils -y

Enable and start the iSCSI service:

sudo systemctl enable --now iscsid

Step 2: Discover Available iSCSI Targets

Use the following command to discover the iSCSI storage target. Replace [Your_iSCSI_Target_IP] with your actual iSCSI target address.

sudo iscsiadm -m discovery -t sendtargets -p [Your_iSCSI_Target_IP]

Step 3: Log in to the iSCSI Target

Once the target is discovered, log in:

sudo iscsiadm -m node -T [Target_Name] -p [Your_iSCSI_Target_IP] --login

To make the login persistent across reboots:

sudo iscsiadm -m node -T [Target_Name] -p [Your_iSCSI_Target_IP] --op update -n node.startup -v automatic

Step 4: Verify the Attached Disk

Check if the new block storage is available:

lsblk

Step 5: Format and Mount the Block Storage

Format the disk (replace /dev/sdX with your actual device name):

sudo mkfs.xfs /dev/sdX

Create a mount point and mount the disk:

sudo mkdir /mnt/blockstorage
sudo mount /dev/sdX /mnt/blockstorage

To make the mount persistent, add an entry to /etc/fstab:

echo "/dev/sdX /mnt/blockstorage xfs defaults 0 0" | sudo tee -a /etc/fstab

Step 6: Set Up Automated Backups

Option 1: Using rsync for File Backups

To back up files to the mounted block storage:

rsync -av --progress /path/to/source /mnt/blockstorage/backup/

To automate backups, add a cron job:

crontab -e

Add the following line to schedule a daily backup at 2 AM:

0 2 * * * rsync -av --delete /path/to/source /mnt/blockstorage/backup/

Option 2: Using tar for Archival Backups

Create a compressed backup archive:

tar -czvf /mnt/blockstorage/backup_$(date +%F).tar.gz /path/to/source

Option 3: Using BorgBackup for Efficient Backups

Install BorgBackup:

sudo dnf install borgbackup -y

For CentOS 7, first enable EPEL:

sudo yum install epel-release -y
sudo yum install borgbackup -y

Initialize a backup repository:

borg init --encryption=repokey /mnt/blockstorage/borg-repo

Backup data:

borg create --progress --stats /mnt/blockstorage/borg-repo::backup-$(date +%F) /path/to/source

Step 7: Verify and Restore Backups

For rsync Backups

To restore files:

rsync -av /mnt/blockstorage/backup/ /restore/path/

For tar Archives

Extract backup files:

tar -xzvf /mnt/blockstorage/backup_YYYY-MM-DD.tar.gz -C /restore/path/

For BorgBackup Archives

Restore the latest backup:

borg extract /mnt/blockstorage/borg-repo::backup-$(date +%F) --target /restore/path/

Conclusion

You have successfully set up block storage on RHEL, CentOS, AlmaLinux, or Rocky Linux and configured an automated backup solution using iSCSI.

Related Articles

  • sBlock - Backup on Debian, Ubuntu and Related OS
  • sBlock - Snapshot Restore
  • sBlock - Snapshots Create
  • sBlock - Snapshots Intro
  • sBlock - iSCSI Windows Guide
  • sBlock - iSCSI Linux Guide
  • sBlock - Delete
  • sBlock - Intro
  • sBlock - Create
  • Views: (565)
  • Votes: (0)
Was this article helpful?
VOTE
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801