Copy all hard disk

You must do this while booted into the Zorin OS USB stick.

Let's say you want to clone /dev/sda, and you want to clone it to /dev/sdb:

sudo dd if=/dev/sda of=/dev/sdb bs=512 status=progress

If you want to create a .7z file that you can then archive and extract later:
clear; echo "NOTE: THIS SHOULD ONLY BE RUN WHEN BOOTED FROM THE ZORIN OS USB STICK AND WITH ALL SOURCE DRIVE PARTITIONS UNMOUNTED!"; echo "$(read -r -p "Press Enter to continue..." key)"; clear; echo "Are you certain that all partitions on the source drive are unmounted?\nStarting Disks application... please wait..."; sleep 3; gnome-disks; clear; echo "$(read -r -p "Press Enter to continue..." key)"; clear; echo "Backing up. Please wait...\nEnter source drive (for instance: sda)..."; read source; echo "Enter destination path (for instance: /media/zorin/Storage/) ONLY... file is automatically named."; read destination; clear; echo "Backing up. Please wait..."; sudo dd if="/dev/"$source ibs=512 obs=512 iflag=fullblock,nonblock,noatime oflag=direct conv=noerror status=progress | sudo 7z a -mx9 -bd -si -mmt12 "$destination""$source""_""$(date +%Y-%m-%d_%H%M).img.7z"; echo "$(read -r -p "Backup complete. Press Enter to exit..." key)"; exit

I do this with my ZFS drives... zeroing the drive's free space really helps on compression... I can compress a 1 TB .img file down to 2.2 GB. With three mirrored 1 TB drives, two 32 GB SLOG drives and two 24 GB swap drives, that compresses to a grand total of 7.8 GB. I actually compress each drive into its own .img.7z file, then drop all those individual img.7z files into a .7z file so they're all stored together for a single full backup, since the three 1 TB drives are essentially identical, so that's further compression I can get.

After you've extracted the .img file, you can then use the Disks application to write that file to the drive.

2 Likes