Linux storage management, LVM, rsync and backup/restore.
Full backup/recovery:
- LVM
- rsync incremental backups
- Mount restore points
- File deletion and recovery
- Create and manage loopback storage with dd and losetup
- Provision LVM
- Format and mount volumes
- Perform safe backups and restores with rsync
- Troubleshoot access issues and restore deleted data
| Component | Version / Tool |
|---|---|
| OS | Fedora |
| Shell | Bash |
| Key CLI | losetup, lvm, rsync, mount, dd, df, lsblk |
- Create a 1 GB “disk” file
sudo dd if=/dev/zero of=/opt/backup-disk.img bs=1M count=1024
- Attach it as /dev/loopX
sudo losetup -fP /opt/backup-disk.img
- Create the Physical Volume (replace X with actual loop number)
sudo pvcreate /dev/loopX
- Create VG & LV
sudo vgcreate backup_vg /dev/loopX
sudo lvcreate -L 900M -n backup_lv backup_vg
- Format & mount
sudo mkfs.ext4 /dev/backup_vg/backup_lv
sudo mkdir -p /mnt/backup
sudo mount /dev/backup_vg/backup_lv /mnt/backup
- sudo mkdir -p /opt/projects
echo "Alpha Project" | sudo tee /opt/projects/alpha.txt
echo "Beta Project" | sudo tee /opt/projects/beta.txt
sudo rsync -avh /opt/projects/ /mnt/backup/
sudo find /opt/projects -type f -exec rm -f {} +
sudo rsync -avh /mnt/backup/ /opt/projects/ | sudo tee outputs/restore-log.txt
| File | Description |
|---|---|
outputs/restore-log.txt |
Log captured from the rsync restore process |
Output of the rsync command during the restore process captured using tee.









