Linked Questions

0 votes
2 answers
168 views

Compute checksum of a partition inside an image file

An external USB flash drive containing 2 partitions is connected to my Raspberry Pi. I want to dd an image file to this external flash drive if the first partition on the flash drive is not the same ...
fdamien12's user avatar
8 votes
2 answers
2k views

Check dd's progress without USR1?

I'm on a Linux busybox 1.27 only system so no output=progress available, no busybox's own implementation of pv which is pipe_progress nor pv itself. I have two questions. The first is based on https://...
abacox's user avatar
  • 143
5 votes
2 answers
4k views

Using dd to create an image up to an specific sector

I have a 32GB SD Card that contains an Armbian installation for some pi gadget. I want to clone the content into a 16GB card. Using GParted, I shrank the partitions to be less than 16GB and here is ...
DEKKER's user avatar
  • 948
-1 votes
2 answers
2k views

Why is .img file so much larger than the actual disk?

I'm trying to figure out why my disk image is so much larger. Here is the source server's disks: root # df -h Filesystem Size Used Avail Use% Mounted on udev 1.9G 0 1.9G 0% /...
Andrew Newby's user avatar
20 votes
4 answers
9k views

Got "No space left on device" when cloning 1TB disk to 1.2TB disk using dd

I am trying to using the following dd command to clone remote xfs disk to another location. ssh root@source_ip "dd if=/dev/vda2 bs=16M conv=noerror,sync status=progress " | sudo dd of=/dev/nvme1n1 ...
Tim's user avatar
  • 317
10 votes
2 answers
2k views

Why use dd instead of cp to create bootable disk?

Is there any difference between doing i.e. dd bs=4M if=archlinux.iso of=/dev/sdx status=progress oflag=sync or doing cp archlinux.iso /dev/sdx && sync, and reason to use one over the other? (...
CcVHKakalLLOOPPOkKkkKk's user avatar
0 votes
1 answer
113 views

Duplicating an image to another machine?

I'm trying to duplicate the entire environment on one machine to another. Will simply copying all files from the source machine to the destination one work? My main concern is that typically, when ...
Thundercleez's user avatar
5 votes
2 answers
1k views

How do I make an image of my entire USB flash drive?

The message below comes from another post and I tried it the way that they stated to. First, I mounted the USB drive: sudo mount -o ro,noexec /dev/sdb1 /media I mounted it as read-only to prevent ...
hddfsck777's user avatar
3 votes
1 answer
4k views

How to dd a local disk into a remote disk?

I have a local machine that needs be migrated to remote disk. How can I do it with dd? I know local format for command dd if=/dev/sdx of=/dev/sdx count=x bs=x But how to do it via ssh direct from ...
Sollosa's user avatar
  • 1,929
13 votes
5 answers
32k views

How can I clone/backup/restore Windows 10 from Linux?

Case scenario: $ sudo fdisk -l Disk /dev/sda: 223,6 GiB, 240057409536 bytes, 468862128 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (...
Sopalajo de Arrierez's user avatar
5 votes
1 answer
10k views

How to speed up dd on macOS High Sierra?

I was trying to create bootable USB of Ubuntu 17.04. First, I erased everything from the pen drive and then started to copy using sudo dd if=path_to_ubuntu_image of=/dev/rdisk2 but it is taking around ...
A Q's user avatar
  • 85
12 votes
4 answers
5k views

How to prevent dd's progress from being meaningless on Linux?

When running dd command to copy an ISO on Linux, I get a single progress print that stays open for a long time (many minutes). Then another at the end. The problem seems to be that a very large cache ...
ideasman42's user avatar
  • 1,211
33 votes
12 answers
21k views

Erasing a Linux laptop

I have a laptop with Debian on it, and I am going to sell this laptop. Would it suffice to erase the Debian installation before selling it to completely clean up my laptop from my personal data, and ...
user avatar
22 votes
5 answers
16k views

Does dd do any kind of verification?

I'm using dd to copy data from an old hard drive to a new one. I want to be sure that the data's integrity is secure. On this answer, Gilles says If [dd] terminated successfully, then the backup ...
Sparhawk's user avatar
  • 19.9k
0 votes
2 answers
3k views

Backup data of a live USB

I have a USB (8.0 GB, kingston) and inside it a Kali Linux image. I often used it in live mode w/ persistence, and I have some data there (plus config of the whole system) that I obviously don't want ...
Deltab's user avatar
  • 111
12 votes
1 answer
25k views

What is the difference between `dd`, `cp` and `rsync`? [closed]

Besides the explanations from the man pages and --help information, in which way do the commands dd, cp and rsync differ when used to copy files? In which context is each of these superior to the ...
XavierStuvw's user avatar
  • 1,119
1 vote
2 answers
487 views

optimum value for bs in 'dd' for chrooted linux?

I am trying to install chrooted debian (arm64) on my android phone(snapdragon650 & 3GB RAM). I found many tutorials for it. Almost all the guides mentioned this cmd for creating img for chrooted ...
jonny789's user avatar
  • 499
32 votes
4 answers
57k views

Why dd takes too long?

I need to copy one disk to another. I tried with the command below and it takes nearly a day to copy 1 TB of disk in federo. dd if=/dev/sda of=/dev/sdb I have tried the same on a Unix(HP-UX) system ...
KKD's user avatar
  • 620
3 votes
2 answers
161 views

Which command produces more data per second?

Which command produces more data per second? This could be useful to quickly fill a file with garbage data or to test data transfer rates. So far, I found that "/dev/zero" is the quickest one. $ cat /...
mountrix's user avatar
  • 141
5 votes
1 answer
2k views

How can I find the last sector used by an ext4 filesystem?

I need to identify the last sector used by an ext4 filesystem so that I can move it to another device. The filesystem has been shrunk (with resize2fs) and is smaller than the partition that contains ...
starfry's user avatar
  • 7,422
0 votes
1 answer
2k views

After dd completion, should records In = records out

I am using the following cmd where sda(500GB) is my laptop hd (unmounted) and sdc(500GB) is my external usb hd dd if=/dev/sda of=/dev/sdc bs=4096 When complete this returns 122096647+0 records in ...
Jimbo'sGun's's user avatar
1 vote
2 answers
1k views

Can't clone hard disk with dd no space left

I am trying to move elementary OS from primary HDD to external HDD. So, I can boot elementary OS from external HDD and install Windows 10 on primary HDD. Hewbot on super user stackexchange suggested ...
abhimanyuaryan's user avatar
6 votes
2 answers
2k views

Why is dd reading from and writing to the same disk?

I've been using dd in Linux to overwrite an external USB hard drive. When I use the default block size of 512 bytes, with this command: # dd if=/dev/zero of=/dev/sdb throughout the whole operation, ...
EmmaV's user avatar
  • 4,057
9 votes
1 answer
3k views

How does cat 'know' the optimum block size to use?

From reading this, it seems that when copying data to a different hard drive, cat automatically uses the optimum block size (or very near it). I wonder how it determines the optimum block size, and ...
EmmaV's user avatar
  • 4,057
0 votes
2 answers
1k views

Pretty print output of "kill -USR1"-ing dd

When dd is done it prints a three line summary about the number of read and written segments, the total size and average writing speed. While it does its work, dd is awfully quiet. Not too long ago (...
Bananguin's user avatar
  • 7,984
7 votes
3 answers
4k views

How do I DD over the network to an external HD?

I'm trying to clone a hard drive on my raspberry pi which is on the same network to an external harddrive of the computer I'm currently on. However I'm having issues piping the command correctly. I've ...
SHiLLySiT's user avatar
32 votes
3 answers
32k views

How to unzip and dd a disk image to an SD Card with a single command?

I am under the following restrictions: I have a 1.0 GB .zip file on my computer which contains one file, a disk image of raspbian. When uncompressed, this file is 3.2 GB large and named 2015-11-21-...
IQAndreas's user avatar
  • 10.3k
62 votes
3 answers
59k views

Is it better to use cat, dd, pv or another procedure to copy a CD/DVD?

Background I'm copying some data CDs/DVDs to ISO files to use them later without the need of them in the drive. I'm looking on the Net for procedures and I found a lot: Use of cat to copy a medium: ...
user avatar
8 votes
3 answers
10k views

Does dd copy everything, including all metadata and all "empty" blocks

Suddenly something was messed up with my partitions, or just one partition. I have a default Ubuntu installation, on a Kingston SSD, with the root file system encrypted with LUKS, (using AES I think). ...
Mads Skjern's user avatar
4 votes
4 answers
8k views

How can I copy three partitions of my disk with a specific beginning and ending using dd?

Using the fdisk -l command I got the following answer: Device Boot Start End Blocks Id System /dev/sda1 * 2048 28266495 14132224 27 Hidden NTFS WinRE /dev/...
Rafael Muynarsk's user avatar
1 vote
0 answers
46 views

osx - dd command behaving weirdly [duplicate]

I've been using dd for a couple of years now, most of the time successfully. I usually use it to dd Linux images to USB drives. My workflow doing so is as such: convert .iso image to a .img format ...
Nick Rutten's user avatar
10 votes
1 answer
2k views

stat file system sizes

With stat 8.13 on a Debian based Linux - among many others - the following FORMAT directives (--format=) are offered: In combination with --file-system (-f): %s Block size (for faster transfers) %S ...
erch's user avatar
  • 5,030
0 votes
3 answers
2k views

rsync partial LVM volume to Remote Directory

Can I rsync a full hdd partition (which is inaccessible) to a remote directory? Inaccessible means it cannot be mounted, it was part of LV volume merged with other HDD which is faulty and removed ...
Zaher's user avatar
  • 129
2 votes
2 answers
156 views

Clone partitions from devices

I have two devices & mdash; the first one has 20 partitions and the second has one big partition. I would like to clone specific partition (content + data) from device one to device two. How can I ...
Ella Kustanovich's user avatar
10 votes
1 answer
21k views

Why is dd so slow with a bs of 100M [closed]

I just tried to overwrite a fast ssd using dd. Using the ubuntu boot image I typed in: dd if=/dev/zero of=/dev/sda bs=100M error writing '/dev/sda': No space left on device blah blah 256 GB copied, ...
Nils's user avatar
  • 233
15 votes
5 answers
14k views

Resuming a DD of an entire disk

I'm overwriting my hard drive with random data using the good old dd: dd if=/dev/urandom of=/dev/disk/by-uuid/etc bs=512 It's a 2TB array and my MacBook (running Linux, ok?) can only write data at ...
Naftuli Kay's user avatar
  • 39.6k
24 votes
6 answers
62k views

can 'dd' be used to clone to a smaller HDD, knowing that partitions will need editing?

I've used dd to clone disks like this: dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror,sync And it's always worked fine. Any and all docs on 'dd' take pains to remind you that the target ...
Ray Andrews's user avatar
  • 2,327
3 votes
1 answer
363 views

Artificially prime buffer cache?

Is it beneficial to artificially prime the buffer cache when dealing with larger files? Here's a scenario: A large file needs to be processed, line by line. Conceptually, it is easy to parallelize ...
miku's user avatar
  • 673
45 votes
5 answers
154k views

Full DD copy from hdd to hdd

ORIGINAL QUESTION: If I have 2 identical hard drives with the following characteristics: SATA 6.0 Gb/s 5400 rpm 3TB How long should a full dd copy take to complete? So far it's been running for 5 ...
oshirowanen's user avatar
  • 2,621
5 votes
3 answers
2k views

Can I overwrite LUKS partition with it's decrypted content?

I have HDD with my data (partial backup of most important data available on other HDD), currently it's formatted as Ext4 over LVM over LUKS. I want to remove LUKS layer, but reformatting and data ...
avi9526's user avatar
  • 339
6 votes
4 answers
3k views

how do I do this: dd if=coolstuff.iso of=(ssh kev@mypi )

the card reader on my laptop doesn't want to work. can I use dd (or some other tool) to write an image to a networked disk. I am trying to replace one raspberry pi distro with another. The SD card ...
kevcoder's user avatar
  • 485
21 votes
4 answers
18k views

Read the middle of a large file

I have a 1 TB file. I would like to read from byte 12345678901 to byte 19876543212 and put that on standard output on a machine with 100 MB RAM. I can easily write a perl script that does this. ...
Ole Tange's user avatar
  • 35.5k
1 vote
2 answers
2k views

How to write an alias function to make dd show progress bar?

According to this article, by replacing: $ dd if=/dev/sda of=/dev/sdb [additional options] with: $ pv -tpreb /dev/sda | dd of=/dev/sdb [additional options] one can augment the default dd behaviour ...
James Fu's user avatar
  • 119
2 votes
1 answer
2k views

What is the easiest way to clone an embedded Linux SD card?

I have a 8 GB SD card (card 1) installed with embedded Linux for PowerPC, libraries and some applications. I want to prepare another 8 GB SD card (card 2) exactly like card 1. What is the ...
Jay's user avatar
  • 311
1 vote
1 answer
1k views

SSH remote backup script

I am trying to backup a remote server to my machine. I am trying something like ssh user@ip "dd if=/dev/sda" | dd of=~/backup.img But that obviously doesn't work. Other variants that don't work. ...
Christopher King's user avatar
2 votes
1 answer
863 views

Cubian: NAND and Partitions

I have installed Cubian on Cubieboard using SD. After that I moved it to NAND. NAND have 4 Gb memory and I want to leave there only boot, another partitions move to the SD. Maybe leave on NAND ...
McBodik's user avatar
  • 177
13 votes
3 answers
25k views

How to check integrity of a dd backup?

I just made a backup of an entire hard drive (50GB) over ssh via: dd if=/dev/hda | buffer -s 64k -S 10m | ssh myuser@myhost "cat > ~/image.img" What's now the best way to check the integrity of ...
student's user avatar
  • 18.3k
6 votes
4 answers
6k views

Is there a difference between these two commands?

cat a > b and cp a b If they are functionally the same for all intents and purposes, which one is faster?
Steven Lu's user avatar
  • 2,272
4 votes
4 answers
16k views

Backup of LVM2 logical volume

I'd like to make backup on external drive of LVM2 logical volume in dd manner. Approach I consider is to make lv on external drive with identical size copy with dd (Please let me know if you see ...
Grzegorz Wierzowiecki's user avatar
10 votes
3 answers
30k views

gzip - redirection or piping?

I will be backing up a large (750GB) disk to an external USB disk using dd. Should I be using redirection or piping? Which is more efficient? Or is there a difference? Also, what is the best block ...
mcu's user avatar
  • 215

15 30 50 per page