Ultimate BackUP script for partitions and disks
Posted: Sun Jul 26, 2026 2:20 pm
With inspiration form diggy’s guide here https://digdeeper.love/articles/backup.xhtml I have created an ultimate backup script.
Currently this script is for Testing only, do not use it to backup critical data.
Updated script 30-07-2026 with bug fixes
Download it here-
https://digdeeper.rodeo/insert-coin/the ... ckup_2.inv
Once downloaded rename the file to ultimate_backup.sh
The script is based on Clonezilla but with a nicer user interface and some extra options.
What it does-
1. Backup – with partclone (clonezilla), with dd, compression= zst, gz, xz, bz2 and it has the option to shrink the unused space at the end of the partition, on ext4 partitions, thanks diggy!
Can backup as=
1) Partition images (all or selected partitions on the disk)
2) Full Disk image (entire block device)
2. Restore - Restore full disk, restore all partitions on disk, restore some or a single partition to a disk in both original position or any blank spot. Also if it is and ext4 partition you can choose to restore them to the original size with blank spaces or restore to the shrunken size without the blank space.
3. Mount – Mount your backed up disks / partitions so you can access files without having to restore them to a new disk.
4. List Partition Info. of your backed up disks / partitions.
To use-
For backing up=
put the script in the location you want your backup saved then run with ./ultimate_backup.sh
For restore=
put the script in the directory of your backup and run with ./ultimate_backup.sh
For mount=
put the script in the directory of your backup and run with ./ultimate_backup.sh
Feel free to test it out, if you find any bugs report them here.
system dependencies for full function-
Debian / Ubuntu
sudo apt install bash coreutils util-linux gawk sed grep findutils sudo \
gdisk parted partclone e2fsprogs dosfstools ntfs-3g xfsprogs btrfs-progs \
exfatprogs f2fs-tools zstd gzip xz-utils bzip2 pv pigz lbzip2
Arch / Archcraft
sudo pacman -S --needed bash coreutils util-linux gawk sed grep findutils sudo \
gptfdisk parted partclone e2fsprogs dosfstools ntfs-3g xfsprogs btrfs-progs \
exfatprogs f2fs-tools zstd gzip xz bzip2 pv pigz pbzip2
Dependencies
Required — the script won't start without these:
| Package (Arch) | Package (Debian/Ubuntu) | Provides |
|---|---|---|
| `bash` ≥ 4.3 | `bash` | namerefs, associative arrays |
| `coreutils` | `coreutils` | dd, stat, sort, head, tail, df, truncate, numfmt |
| `util-linux` | `util-linux` | lsblk, blkid, losetup, mount, umount, findmnt, partx, blockdev, sfdisk |
| `gawk` `sed` `grep` `findutils` | same | text processing |
| `sudo` | `sudo` | privileged operations |
| `gptfdisk` | `gdisk` | **sgdisk** — partition creation |
| `parted` | `parted` | parted, **partprobe** |
| `partclone` | `partclone` | partclone.* engines |
| `e2fsprogs` | `e2fsprogs` | e2fsck, resize2fs, tune2fs, e2label |
Needed per filesystem you actually touch:
- ext2/3/4 — `e2fsprogs` (required above; also what shrink/grow needs)
- FAT/vfat — `dosfstools` (fsck.fat, fatlabel)
- NTFS — `ntfs-3g` (ntfsfix, ntfslabel, ntfsinfo, ntfs-3g)
- XFS — `xfsprogs` · Btrfs — `btrfs-progs` · exFAT — `exfatprogs` · F2FS — `f2fs-tools`
Compression — install whichever you'll use:
`zstd`, `gzip`, `xz` (Debian: `xz-utils`), `bzip2`. Each is checked only when an image actually needs it, so a missing one never blocks unrelated work.
Optional but recommended:
- `pv` — progress bars (without it you get a spinner)
- `pigz`, `pbzip2` or `lbzip2` — parallel decompression in the mount module
- `smartmontools`, `hdparm` — not used, but useful alongside
Currently this script is for Testing only, do not use it to backup critical data.
Updated script 30-07-2026 with bug fixes
Download it here-
https://digdeeper.rodeo/insert-coin/the ... ckup_2.inv
Once downloaded rename the file to ultimate_backup.sh
The script is based on Clonezilla but with a nicer user interface and some extra options.
What it does-
1. Backup – with partclone (clonezilla), with dd, compression= zst, gz, xz, bz2 and it has the option to shrink the unused space at the end of the partition, on ext4 partitions, thanks diggy!
Can backup as=
1) Partition images (all or selected partitions on the disk)
2) Full Disk image (entire block device)
2. Restore - Restore full disk, restore all partitions on disk, restore some or a single partition to a disk in both original position or any blank spot. Also if it is and ext4 partition you can choose to restore them to the original size with blank spaces or restore to the shrunken size without the blank space.
3. Mount – Mount your backed up disks / partitions so you can access files without having to restore them to a new disk.
4. List Partition Info. of your backed up disks / partitions.
To use-
For backing up=
put the script in the location you want your backup saved then run with ./ultimate_backup.sh
For restore=
put the script in the directory of your backup and run with ./ultimate_backup.sh
For mount=
put the script in the directory of your backup and run with ./ultimate_backup.sh
Feel free to test it out, if you find any bugs report them here.
system dependencies for full function-
Debian / Ubuntu
sudo apt install bash coreutils util-linux gawk sed grep findutils sudo \
gdisk parted partclone e2fsprogs dosfstools ntfs-3g xfsprogs btrfs-progs \
exfatprogs f2fs-tools zstd gzip xz-utils bzip2 pv pigz lbzip2
Arch / Archcraft
sudo pacman -S --needed bash coreutils util-linux gawk sed grep findutils sudo \
gptfdisk parted partclone e2fsprogs dosfstools ntfs-3g xfsprogs btrfs-progs \
exfatprogs f2fs-tools zstd gzip xz bzip2 pv pigz pbzip2
Dependencies
Required — the script won't start without these:
| Package (Arch) | Package (Debian/Ubuntu) | Provides |
|---|---|---|
| `bash` ≥ 4.3 | `bash` | namerefs, associative arrays |
| `coreutils` | `coreutils` | dd, stat, sort, head, tail, df, truncate, numfmt |
| `util-linux` | `util-linux` | lsblk, blkid, losetup, mount, umount, findmnt, partx, blockdev, sfdisk |
| `gawk` `sed` `grep` `findutils` | same | text processing |
| `sudo` | `sudo` | privileged operations |
| `gptfdisk` | `gdisk` | **sgdisk** — partition creation |
| `parted` | `parted` | parted, **partprobe** |
| `partclone` | `partclone` | partclone.* engines |
| `e2fsprogs` | `e2fsprogs` | e2fsck, resize2fs, tune2fs, e2label |
Needed per filesystem you actually touch:
- ext2/3/4 — `e2fsprogs` (required above; also what shrink/grow needs)
- FAT/vfat — `dosfstools` (fsck.fat, fatlabel)
- NTFS — `ntfs-3g` (ntfsfix, ntfslabel, ntfsinfo, ntfs-3g)
- XFS — `xfsprogs` · Btrfs — `btrfs-progs` · exFAT — `exfatprogs` · F2FS — `f2fs-tools`
Compression — install whichever you'll use:
`zstd`, `gzip`, `xz` (Debian: `xz-utils`), `bzip2`. Each is checked only when an image actually needs it, so a missing one never blocks unrelated work.
Optional but recommended:
- `pv` — progress bars (without it you get a spinner)
- `pigz`, `pbzip2` or `lbzip2` — parallel decompression in the mount module
- `smartmontools`, `hdparm` — not used, but useful alongside