Serverspace Black Friday
WB
William Bell
May 18, 2020
Updated August 4, 2023

DD utility for Windows backup

Backup VPS Windows

We will describe process of creation backups on a Windows Server by exploited Unix—like DD utility.

Introduction

The backup system is an important component of data security. The choice of backup methods and forwarding methods depends on your needs and conditions of use. When setting up a backup, you should take into account the level of data criticality, available storage space, access speed, as well as the level of protection that is required for your data.

The DD utility is primarily designed for Linux—based operating systems, and it offers various commands with specific operands to facilitate file copying. Being one of the oldest utilities, DD creates backups that are compatible with numerous software applications. However, its functionality in the Windows operating system is comparatively limited compared to its Linux counterpart. Notably, the Windows version lacks support for file conversion and block device usage.

Download utility

First of all, we need to download utility then check them for malicious software, unfortunately that step is sufficiently for your security. You need to choose archive in the downloaded files and attach to the service, wait for results. If you will see report like this, then everything is OK:

Report of scanning
Screenshot №1 — Report of scanning

Warning! We do not take responsibility for the program available on the site due to the lack of control over the file, download the utility at your own risk.

By opening archive you will see three files, we need to open with .exe format:

List of files
Screenshot №2 — List of files

Create backup

For start using utility you need to type that command below, but before go to the executable folder:

cd C:\Users\Administrator.WIN22\Desktop && dd.exe --list
list of programm
Screenshot №3 — List of program

You can see various of options that you can use with that command, let's solve the problem and task of creation file of folder C disk. For that type the command:

dd if=\\.\c:\tt\1.zip of=c:\tt\disk1.img bs=1440k
Create ISO
Screenshot №4 — Create ISO

Let's break down the command step by step:

  • dd: This is the command itself, indicating that you want to use the dd utility.
  • if=\\.\c:\tt\1.zip: The if parameter stands for "input file," and \\.\c:\tt\1.zip is the input source. In Windows, \\.\ is used to access a physical device directly, and c:\tt\1.zip represents the path to the source file. It indicates that the data will be read from the file 1.zip located at c:\tt\ on drive C:.
  • of=c:\tt\disk1.img: The of parameter stands for "output file," and c:\tt\disk1.img is the output destination. It specifies that the copied data will be written to the file named disk1.img in the c:\tt\ directory on drive C:.
  • bs=1440k: The bs parameter stands for "block size." This parameter determines the size of the data blocks that dd reads and writes at a time. In this case, the block size is set to 1440 kilobytes (1440k), which means dd will read and write data in 1440 KB chunks.

Please note: before creating backups, you need to make sure that there is enough unallocated space on the desired disk.

Let's restore information from disk1.img by the command below:

dd if=c:\tt\disk1.img of=\\.\c:\tt\new  bs=1440k
Unpack ISO
Screenshot №5 — Unpack ISO

Let's break down the command step by step:

  • dd: This is the command itself, indicating that you want to use the dd utility.
  • if=c:\tt\disk1.img: The if parameter stands for "input file," and c:\tt\disk1.img specifies the input source. This path indicates that data will be read from the file named disk1.img located at c:\tt\.
  • of=\\.\c:\tt\new: The of parameter stands for "output file," and \\.\c:\tt\new specifies the output destination. In Windows, \\.\ is used to access a physical device directly. Here, it's followed by the path c:\tt\new, which suggests that the data will be written to a file named new at c:\tt\.
  • bs=1440k: The bs parameter stands for "block size." This parameter determines the size of the data blocks that dd reads and writes at a time. In this case, the block size is set to 1440 kilobytes (1440k), meaning that dd will process data in 1440 KB chunks.

Create scheduler

Search in windows bar application Task Scheduler  and open it:

task scheduler
Screenshot №6 — Open task scheduler

After that you will see pop—up window with main field and tab for next configuration, create task:

Task scheduler
Screenshot №7 — Task scheduler

Give a Name to a task for recognize process that you start, also you can add description to filed and check the box Run with highest privileges. Set triggers for starting script that we will write after that:

Triggers
Screenshot №8 — Triggers

Create new text file and enter the lines of code:

# Set the source and destination paths
$sourcePath = "c:\tt\1.zip"
$destinationPath = "c:\tt\disk1.img"
# Read the data from the source file and save it to the image file $sourceContent = Get-Content -LiteralPath $sourcePath -Encoding Byte Set-Content -LiteralPath $destinationPath -Value $sourceContent -Encoding Byte
# Set the source and destination paths for writing back to the floppy disk $sourcePath = "c:\tt\disk1.img" $destinationPath = "c:\new"
# Read the data from the image file and write it back to the floppy disk $sourceContent = Get-Content -LiteralPath $sourcePath -Encoding Byte Set-Content -LiteralPath $destinationPath -Value $sourceContent -Encoding Byte
Script
Screenshot №9 — Script

Save as .bat file, just rename it and replace .txt to .bat, after this copy path to file and enter in the tab Actions in the Scheduler:

Actions
Screenshot №10 — Actions

Enter path to the field Program/script or Browse and search script. Go to the next tab Settings:

Settings
Screenshot №11 — Settings

And press OK, now we have scheduler task that will run by timer!

Conclusion

The process of creating backups on a Windows Server using the Unix—like dd utility involves a series of steps designed to ensure data security and availability. The backup system holds paramount importance in safeguarding critical data against loss or corruption. Choosing appropriate backup methods and forwarding techniques depends on factors such as data criticality, storage capacity, access speed, and required security levels.

Although the dd utility is primarily intended for Linux—based systems, it can be employed on Windows Servers to achieve data copying. While dd provides various commands and operands for efficient file copying, it's important to note that its functionality on Windows may be less extensive compared to its capabilities on Linux. For instance, certain features, like file conversion and block device usage, might be limited or absent in the Windows version.

Vote:
3 out of 5
Аverage rating : 3.8
Rated by: 12
1101 CT Amsterdam The Netherlands, Herikerbergweg 292
+31 20 262-58-98
700 300
ITGLOBAL.COM NL
700 300
We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.