jazzbox35
jazzbox35

Reputation: 3

Trying to back up CentOS using the "dd" command

I'd like to back up a SSD which I'm using for CentOS. Trying to learn dd. My drive is a fairly simple GPT partition of 120GB.

  1. I run "dd" to copy the image of sda to a USB stick sdd1:

[root@localhost ~]# dd if=/dev/sda conv=sync,noerror status=progress bs=64k of=/dev/sdd1 120029118464 bytes (120 GB, 112 GiB) copied, 30810 s, 3.9 MB/s 1831575+1 records in 1831576+0 records out 120034164736 bytes (120 GB, 112 GiB) copied, 30810.8 s, 3.9 MB/s

  1. But then when I examine the USB stick, there is nothing to be seen on it and I see no way to mount it

this is what appears under the Disks command


Question is: How do I access the image?

(As a side note, I read a claim that the dd command is like the IBM JCL statement of the same name. I was a mainframe programmer. The IBM DD command is often still called a "DD Card". It doesn't copy files. It just joins your file declaration in your program to some external file. To copy a file the old skool way is to use IEBGENER)

Upvotes: 0

Views: 404

Answers (1)

Nathan Mitchell
Nathan Mitchell

Reputation: 36

if=/dev/sda Is cloning the entire disk and of=/dev/sdd1 Is writing to a partition. Which doesn't make much sense.

You may want to clone the entire disk onto another disk

dd if=/dev/sda conv=sync,noerror status=progress bs=64k of=/dev/sdd

Or better yet clone to an compressed image

dd if=/dev/sda | gzip  > /sda.img.gz

And restore like so

gzip -d /sda.img.gz | dd of=/dev/sda

Upvotes: 1

Related Questions