docs_in_draft:backup-next

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
docs_in_draft:backup-next [2023/04/23 13:55] – Add advanced variables clexanisdocs_in_draft:backup-next [2023/05/05 13:39] (current) – Add restore instruction for dd clexanis
Line 48: Line 48:
 Place Holder\\ Place Holder\\
 \\ \\
 +
 +===== Restore =====
 +
 +
 +==== ddfull (GUI) ====
 +
 +For `ddfull` image, you can use [[https://bztsrc.gitlab.io/usbimager|USBImager]] (Linux, Mac-OS and Windows) or [[https://sourceforge.net/projects/win32diskimager|Win32 Disk Imager]] to restore with a GUI.
 +
 +==== dd and ddfull (CLI) ====
 +
 +=== Identify your drive or partition ===
 +
 +They are multiples way to identify your drive or partition, I'm going to explain a few one, fell free to use the one you fell the most confident with.
 +
 +> Remember that you can use the tabulation key to autocomplete path, and the control+c combination to blank your current command. Fell free to try using them beforehand.
 +
 +
 +=== By label ===
 +
 +Each disk (and partitions) have a different label which is constituted by is connection type (ata, scsi, ...), model, serial number and partition number. It is probably the easiest way if you know or can read the label on the top of your drive.
 +
 +We are going to store it inside a variable for later usage (you can memorize it if you prefer).
 +
 +<code bash>SOURCE=/dev/disk/by-id/ata-ST2000DL003-9VT166_5YD2W75Z</code>
 +
 +=== For partition (dd) ===
 +
 +If you want to work with partition, and if you know the partition number, you can use the last command and add the partition number directly.
 +
 +<code bash>SOURCE=/dev/disk/by-id/ata-ST2000DL003-9VT166_5YD2W75Z-part1</code>
 +
 +If you don't know it's number, you can list them with `fdisk -l`.
 +
 +<code bash>root@omv-dev:~# fdisk -l $SOURCE
 +Disk /dev/sdb: 50 GiB, 53687091200 bytes, 104857600 sectors
 +Disk model: Virtual Disk
 +Units: sectors of 1 * 512 = 512 bytes
 +Sector size (logical/physical): 512 bytes / 4096 bytes
 +I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 +Disklabel type: gpt
 +Disk identifier: 88992846-D209-4046-84ED-1C4DC53ACDC8
 +
 +Device     Start       End   Sectors Size Type
 +/dev/sdb1   2048 104857566 104855519  50G Linux filesystem</code>
 +
 +=== For the target ===
 +
 +Now you can repeat the previous step but for the target drive.
 +
 +<code bash>TARGET=/dev/disk/by-id/ata-ST2000DL003-9VT166_5YD354DB-part2</code>
 +
 +=== Prepare and locate your backup ===
 +
 +=== Create a directory for mounting the source ===
 +
 +We create a directory to mount our source first.
 +
 +<code bash>mkdir /source</code>
 +
 +=== Mount the source filesystem ===
 +
 +We mount our source
 +
 +<code bash>mount $SOURCE /source</code>
 +
 +=== Locate your backup folder ===
 +
 +> Remember again about the tab key for autocompletion.
 +
 +Move to your folder holding your backup.
 +
 +<code bash>cd /source/backup/omvbackup</code>
 +
 +=== Restore ===
 +
 +> **Double check your command before launching it, after it is launched they're NO WAY TO UNDO IT!**
 +
 +Launch the restore process with the backup of your choice.
 +
 +<code bash>zstdcat ./backup-omv-2023-04-23_11-20-11.dd.zst >$TARGET</code>
 +
 +When the prompt appear again, the copy is complete.
 +
 +If an error is trow, you can try launching the restore again with dd.
 +
 +<code bash>zstdcat /backup-omv-2023-04-23_11-20-11.dd.zst | dd bs=1M iflag=fullblock of=$TARGET status=progress</code>
 +
  
 ===== Advanced settings ===== ===== Advanced settings =====
  • docs_in_draft/backup-next.1682258117.txt.gz
  • Last modified: 2023/04/23 13:55
  • by clexanis