INFORMATICS

The Best

Przełącznik języka

Zaproś mnie na KAWE

Jeżeli podoba Ci się strona i chcesz wspomóc projekt!

Postaw mi kawę na buycoffee.to

This Site

Płatnik

CMS

Hardware

Uncategorised

Emulators

Powershell

Storage Array

DNS

Antivirus program

Licznik

2.png8.png9.png9.png8.png5.png2.png
Today357
Yesterday833
This week1988
This month19977
Total2899852

Visitor Info

  • IP: 3.135.205.146
  • Browser: Unknown
  • Browser Version:
  • Operating System: Unknown

Who Is Online

4
Online

poniedziałek, 29 kwiecień 2024 09:05

How to Make Disk Images in Linux with DD Command

Gwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywnaGwiazdka nieaktywna
 

How to Make Disk Images in Linux with DD Command

Install LSSCSI Utility

Open the command-line terminal.

Make sure to have the “lsscsi” utility installed on your system. If it is not installed, try to install it using the below “apt” command followed by the keyword “install” and “lsscsi”.

sudo apt install lsscsi

After installing the “lsscsi” utility, now it’s time to use it for listing all the storage devices of our Linux system. 

lsscsi

Check Disk Information

sudo fdisk /dev/sda

Create a Clone Disk Image

Now you have almost every piece of information regarding the “/dev/sda” drive.  Press “q” to exit the commanding theme. Now, you are ready to make a disk image using the DD command.

sudo dd if=/dev/sda1 of=/tmp/sda.img bs=1k conv=noerror

Let’s check the destination image file to see if all the data from the source drive has been cloned into it properly or not. Use the below list command along with the path of an image file of the drive as:

ls –lh /tmp/sda1.img

The output shows the rights assigned to this image file, its size, and location. You can say that it has similar rights and size as the original disk drive have.

To see some more information regarding the disk image file, you have to try the below “fdisk” command followed by the flag “-l” as below.

fdisk –l /tmp/sda1.img

Restore the Drive from Clone Image

Now, if you want to restore your original disk drive along with all the data it has, you have to use the DD command again to do so.

sudo dd if=/tmp/sda1.img of=/dev/sda1 bs=1k conv=noerror

Search