https://github.com/carlossemeao/linux-storage-backup-lab
LVM, mount points, rsync backups, and restoration lab | Real-world Linux+ project
https://github.com/carlossemeao/linux-storage-backup-lab
backup comptia fedora file linux lvm recovery rsync storage
Last synced: 2 months ago
JSON representation
LVM, mount points, rsync backups, and restoration lab | Real-world Linux+ project
- Host: GitHub
- URL: https://github.com/carlossemeao/linux-storage-backup-lab
- Owner: CarlosSemeao
- Created: 2025-06-04T19:28:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-04T21:34:50.000Z (about 1 year ago)
- Last Synced: 2025-09-02T14:58:33.537Z (11 months ago)
- Topics: backup, comptia, fedora, file, linux, lvm, recovery, rsync, storage
- Homepage:
- Size: 691 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Linux Storage/Backup Lab
Linux storage management, LVM, rsync and backup/restore.
## Objective
Full backup/recovery:
- LVM
- rsync incremental backups
- Mount restore points
- File deletion and recovery
---
## Skills
- 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
---
## Environment
| Component | Version / Tool |
|-----------|-----------------------------|
| OS | Fedora |
| Shell | Bash |
| Key CLI | losetup, lvm, rsync, mount, dd, df, lsblk |
---
## Tasks
1. Create a 1 GB “disk” file
```
sudo dd if=/dev/zero of=/opt/backup-disk.img bs=1M count=1024
```
3. Attach it as /dev/loopX
```
sudo losetup -fP /opt/backup-disk.img
```
4. Create the Physical Volume (replace X with actual loop number)
```
sudo pvcreate /dev/loopX
```
5. Create VG & LV
```
sudo vgcreate backup_vg /dev/loopX
sudo lvcreate -L 900M -n backup_lv backup_vg
```
6. Format & mount
```
sudo mkfs.ext4 /dev/backup_vg/backup_lv
sudo mkdir -p /mnt/backup
sudo mount /dev/backup_vg/backup_lv /mnt/backup
```
7. 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
```
---
## Output
| File | Description |
|---------------------------------|------------------------------------------------|
| `outputs/restore-log.txt` | Log captured from the `rsync` restore process |
---
## Screenshots
### Setup
| Step | Description | Screenshot |
|------|-------------|------------|
| 1 | **Before Loopback Setup** – Disk layout before attaching the backup image |  |
| 2 | **Loop Device Mounted** – Loopback disk appears after mounting with `losetup` |  |
| 3 | **LVM Setup: PV Created** – Physical volume initialized with `pvcreate` |  |
| 4 | **LVM Setup: VG + LV Created** – Volume group and logical volume provisioned |  |
| 5 | **Filesystem & Mount** – Filesystem formatted and volume mounted to `/mnt/backup` |  |
| 6 | **Final Layout** – View of the mounted loopback volume using `lsblk` |  |
---
### Backup
| Phase | Description | Screenshot |
|-------|-------------|------------|
| Backup Complete | Files `alpha.txt` and `beta.txt` successfully backed up using `rsync` |  |
| Simulated Failure | Files deleted from `/opt/projects` to simulate data loss |  |
| Restore Log | Output of the restore process captured using `tee` |  |
| Recovery Verified | Files restored from backup and visible in `/opt/projects` |  |
---
### Rsync Log
Output of the `rsync` command during the restore process captured using `tee`.
