Linux newbie here. In Windows there’s something called Volume Shadow Service (VSS) that allows a clone of the drive to be created while the drive is in use. Is there anything like this for Linux? If yes, which cloning apps can do this?
Can this somehow be done using a VM?
I want to clone my main drive (Fedora 34 on BTRFS) while I’m using it.
There is Timeshift which is very popular for making backups of the system. It is available for pretty much every distro. I know that MXLinux has it’s own ISO tool that allows you to make an ISO of your system. Both Timeshift and MXLinux’s ISO work while the system is running. I can’t say whether they’re technically cloning the system drive though. Timeshift is not suggested for backing up the home folder so it’s certainly not cloning in that aspect. Whether there is a particular app for Fedora or Redhat I can’t say. I don’t have any experience in either.
use BTRFS snapshots Incremental backups with Btrfs snapshots - Fedora Magazine
To make a long story short, I’m giving up on Fedora (what a nightmare!) and will try Ubuntu. So this thread is resolved. Thanks for all your replies! Appreciated.
GitHub - MX-Linux/lum-qt-appimage: appimage package for the live-usb-maker system from antiX and MX, renamed here live-usb-maker-qt Is this the tool you’re referring to?
(And I’m also using Timeshift to take system shapshots.)
No, it’s under MX Tools and along with the Live USB Maker is under the Live section. The application to which I referred is Snapshot. It creates an iso of the OS drive.
I’m sorry but it’s not clear where this MX Tools is. Can you provide a direct link to MX Tools ISO creation tool?
I googled MX Tools ISO creator but didn’t find it.
Hey there! If you want to clone your drive there are a few questions you might want to answer:
- Are you looking to make a mirror copy of your installation bit for bit (this would be like everything in your root folder /, not just the home directory)? If that’s what you’re looking to do, then it sounds like you may want to make an IMG copy of your whole drive (might make an enormous copy, depending on your drive)
- Are you looking for just a backup of your data, with which you could restore manually? You could try to use rsync to accomplish this, but you may need to create a live bootable USB in order to restore the files you backed up.
- Are you looking for a simple backup solution of something for your home directory? If so, I can heartily recommend this backup.sh script that I found on the Solus forum here! Backups - Solus Forum
Here’s the code snippet. I take no credit for this!
BEAR IN MIND THIS IS WRITTEN FOR SOLUS SO EOPKG WON’T APPLY FOR FEDORA.
#!/bin/bash
DATE=`date +%Y-%m-%d_%H-%M-%S`
SOURCEDIR=/home/$USER
TARGETDIR=/run/media/$USER/External\ Backup/rsync\ backups
#Check if TARGETDIR does not exist
if [ ! -d "$TARGETDIR" ]; then
echo "Target directory not found." >&2
exit 1
fi
#Make directories if not exists
mkdir -p "$SOURCEDIR/BackupFiles/package-logs"
mkdir -p "$SOURCEDIR/BackupFiles/gpg-backup"
mkdir -p "$SOURCEDIR/BackupFiles/backup-logs/rsync-logs"
#Installed packages logs
#apt-mark showmanual > "$SOURCEDIR/BackupFiles/package-logs/dpkg.log"
eopkg li > "$SOURCEDIR/BackupFiles/package-logs/eopkg.log"
snap list > "$SOURCEDIR/BackupFiles/package-logs/snap.log"
flatpak list > "$SOURCEDIR/BackupFiles/package-logs/flatpak.log"
#GPG public keys and ownertrust
gpg --export --armor > "$SOURCEDIR/BackupFiles/gpg-backup/public-keys.asc"
gpg --export-ownertrust --armor > "$SOURCEDIR/BackupFiles/gpg-backup/ownertrust.asc"
#rsync command
rsync -avPh --exclude="*.vc" --exclude-from "$SOURCEDIR/BackupFiles/exclude-paths/exclude-paths-rsync.txt" --log-file="$SOURCEDIR/BackupFiles/backup-logs/rsync-logs/rsync-log-$USER-$DATE.log" --link-dest="$TARGETDIR/current/" "$SOURCEDIR/" "$TARGETDIR/$USER-$DATE/"
ERROR1=$?
#rsync command for *.vc files which need checksum option
rsync -avPhm --checksum --include="*/" --include="*.vc" --exclude="*" --log-file="$SOURCEDIR/BackupFiles/backup-logs/rsync-logs/rsync-log-vc-$USER-$DATE.log" --link-dest="$TARGETDIR/current/" "$SOURCEDIR/" "$TARGETDIR/$USER-$DATE/"
ERROR2=$?
#Symlink and failed backup logic
#copy log files to external hdd
if [ "$ERROR1" = 0 ] && [ "$ERROR2" = 0 ]; then
rm -f "$TARGETDIR/current"
ln -s "$TARGETDIR/$USER-$DATE" "$TARGETDIR/current"
cp "$SOURCEDIR/BackupFiles/backup-logs/rsync-logs/rsync-log-$USER-$DATE.log" "$TARGETDIR/$USER-$DATE/BackupFiles/backup-logs/rsync-logs/rsync-log-$USER-$DATE.log"
cp "$SOURCEDIR/BackupFiles/backup-logs/rsync-logs/rsync-log-vc-$USER-$DATE.log" "$TARGETDIR/$USER-$DATE/BackupFiles/backup-logs/rsync-logs/rsync-log-vc-$USER-$DATE.log"
else
mv "$TARGETDIR/$USER-$DATE" "$TARGETDIR/failed-$USER-$DATE"
mv "$SOURCEDIR/BackupFiles/backup-logs/rsync-logs/rsync-log-$USER-$DATE.log" "$SOURCEDIR/BackupFiles/backup-logs/rsync-logs/rsync-log-failed-$USER-$DATE.log"
mv "$SOURCEDIR/BackupFiles/backup-logs/rsync-logs/rsync-log-vc-$USER-$DATE.log" "$SOURCEDIR/BackupFiles/backup-logs/rsync-logs/rsync-log-vc-failed-$USER-$DATE.log"
cp "$SOURCEDIR/BackupFiles/backup-logs/rsync-logs/rsync-log-failed-$USER-$DATE.log" "$TARGETDIR/failed-$USER-$DATE/BackupFiles/backup-logs/rsync-logs/rsync-log-failed-$USER-$DATE.log"
cp "$SOURCEDIR/BackupFiles/backup-logs/rsync-logs/rsync-log-vc-failed-$USER-$DATE.log" "$TARGETDIR/failed-$USER-$DATE/BackupFiles/backup-logs/rsync-logs/rsync-log-vc-failed-$USER-$DATE.log"
fi
Hope this helps!
@bhibb Good questions. Thanks. What I want is an Ubuntu app that can make a bootable clone of my entire main drive to an external drive while my main drive is mounted and running and being used. In addition, I would also like to make a full image of my main drive to an external drive under the same conditions.
It looks like FSArchiver and qt-fsarchiver may be able to do this, I’m now researching and will report back.
I want to make bootable complete clones of my main drive so in case my main drive fails, I can open my laptop, pop in the bootable cloned drive and continue working. And I want the clones made in the background while I’m doing other work on the computer. Casper for Windows does this (and can make images in additions to clones).
I’m now successfully making full clones and images using Clonezilla and Parted Magic, but it requires that I boot from a live USB which means I can’t do any work while Clonezilla is working. It takes Clonezilla about 6 hours to make an image of my main drive (1.1TB of files and data).
I’ve got good systems (multiple apps) to back up my user data (aka, home directory) to external drives and another good system (Timeshift) to take recoverable, restorable snapshots of my system files.
Fascinating stuff. I’m curious what your solution will be.
For my personal needs, I simply rsync my root drive every once in a while, to supplant default data if there are any big data loss. If my drive were to fail, it would take me some time to get back to a working state, but my work isn’t that time sensitive.
Still, I’m intersted in your journey here.
My current backup methods (all to external drives):
- Timeshift (rsync) for my system files for system restores. (This has already saved my butt one time)
- Free File Sync for all my user files.
- Deja Dup for all my user files.
- Restic for all my user files.
- Clonezilla for full drive clones and full drive images.
If FSArchive works the way I hope, I’ll add it to the list.
Thanks for the tip. I posted a question on their reddit forum to get a better understanding of it.
I finally got FSArchiver working to make a clone of a mounted and running drive (Ubuntu 21.04). It’s working good.
Details here [SOLVED] Any way to make a full clone and/or image of mounted running drive? (running 21.04)
Could someone mark this thread as resolved? Thx.