https://github.com/emanoil/dd_img
Like Clonezilla, takes and restores a partition or hard disk backup. All code easy to see.
https://github.com/emanoil/dd_img
bash clonezilla dd image linux partition script
Last synced: 4 days ago
JSON representation
Like Clonezilla, takes and restores a partition or hard disk backup. All code easy to see.
- Host: GitHub
- URL: https://github.com/emanoil/dd_img
- Owner: Emanoil
- License: apache-2.0
- Created: 2025-01-24T14:14:40.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-16T15:35:25.000Z (3 months ago)
- Last Synced: 2025-02-16T16:31:22.850Z (3 months ago)
- Topics: bash, clonezilla, dd, image, linux, partition, script
- Language: Shell
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# dd_img
Like Clonezilla, takes and restores a partition or hard disk backup. Unlike Clonezilla, can use on any Linux with *root* (e.g. Raspberry Pi). All code easy to see.Important warning
This program can destroy data on your computer, if misused (i.e. wrong commands).
So, please do not use if you don't understand well the commands that it takes. I take no responsibility for any data loss on your computer.Here is the **big picture**: this is a Linux program, so it can only be used in a Linux terminal, with "*root*" privileges. You can save (operation "*read*") an image of a partition (e.g. "*/dev/sda20*") or even a whole hard disk (e.g. "*dev/sdb*"). Will be saved with many checksums. Can be restored (operation "*write*") on same or other computer. Can also be just verified (that checksums are OK; operation "*verify*"). Restoration (operation "*write*") is the dangerous part, so please, carefully check the displayed paramaters, and only type "yes" if you are sure the parameters are OK. (Note: for a test, can use an ordinary file (e.g. "*tests/a_test_file*"), instead of a device (e.g. "*/dev/sdb30*"). This is safe.)
Please use **no spaces** in file names and paths.
Remember to:
a). shrink a bit the target partition, before getting its image, in order to be sure it will fit back when restoring it.
b. If restoring onto a partition of a different type than the backup, then need to use Linux's `fdisk' to set the "partition type" ("t" command).WARNING: When running this Bash script, one should be in a directory on an ext4 partition (ntfs might also work - not sure, but Samba share (== cifs) and FAT32 are known not to work). This is because the filesystem of the partition where we are in, needs to support "named pipes". This should be no problem, as the filenames can be referred with full path. (One more warning: should make sure that the full path used, contains no spaces.)
**Examples**:
*./dd_img.sh* or *./dd_img.sh --help* , for help
*./dd_img.sh --what read --device /dev/sda11.7z --file1 dd_test1/test_bak1 -f2 dd_test2/tst_bak2*
*./dd_img.sh -w verify -f1 dd_test1/test_bak1*
*./dd_img.sh -w write -d /dev/sda20 -f1 dd_test2/tst_bak2*"*--file2*" and "*--file3*", are only used for "*read*" operation
"*verify*" operation uses no "*--device*"For testing (or other purposes, maybe), one can use a file name (even with path) with "--device".