Questions tagged [dd]

dd is a traditional utility for binary data copies

Filter by
Sorted by
Tagged with
1 vote
1 answer
16 views

what does dd's metadata mean in the context of a non-file write?

So apparently fdatasync is like fsync but doesn't sync the metadata, I can understand what the metadata refers to in case of like copying a file, but what if you are just zeroing a drive or writing ...
  • 133
1 vote
0 answers
46 views

ZFS On Linux - recover lacked MBR after physical problem

We had a physical problem in our backup server (we suppose an electrical shock due to the thunderstorm). The system is Linux Debian on a disk and the storage in on a two 4 TB disks RAID-1 ZFS (ZFS On ...
1 vote
2 answers
50 views

how to duplicate rootfs to another partition (dd cause problems)

I've been using dd in order to duplicate my rootfs into another partition and boot the system using the new rootfs copy. sudo dd if=/dev/disk/by-partuuid/342853ea-cab9-4a4f-b935-1a704c1cc17f conv=sync,...
  • 129
1 vote
1 answer
24 views

Does not putting conv=fsync mean that if you shut down your computer the copy might not be complete?

So from what I know conv=fsync means that the cache is fully written before dd quits. But does that mean otherwise the writing is not complete when dd quits? Like if I shut down the computer (after dd ...
  • 133
4 votes
3 answers
1k views

Auto detect RAM and create double the swap memory

I'm able to auto detect RAM in GB as below and round off to the nearest integer: printf "%.f\n" $(grep MemTotal /proc/meminfo | awk '$3=="kB"{$2=$2/1024^2;$3="GB";} 1' | ...
  • 407
1 vote
1 answer
26 views

SSD performance different results in dd and gnome-disk

I wanted to measure my SSD read/write performance and found some recommendations for using dd and gnome-disks. (from my understanding, hdpart is not relevant since it's not using the disk itself but ...
  • 129
1 vote
0 answers
119 views

cp and dd stuck when writing ISO image to USB flash drive

I have a hybrid ISO image (Debian netinst, size is around 473MB) which I tried to write to a USB flash drive on my Debian system. When I tried to do this with any of the following commands (sdX is the ...
  • 11
1 vote
1 answer
57 views

Why not always use 'oflag=direct' in 'dd'?

Using oflag=direct in dd seems always to make operations much faster than either not using it, or using pv etc. to do the operation instead. Under what circumstances might I not want to use oflag=...
  • 3,763
16 votes
3 answers
4k views

How can I verify that my hard disk has been zeroed / wiped?

I used shred to wipe my external hard disk: sudo shred -vz /dev/sdb I should also add that the disk had 5 bad sectors. I want to verify the disk has been zeroed, per https://superuser.com/questions/...
  • 437
23 votes
1 answer
2k views

Why does `dd` use `=` in its parameters?

Why does dd use parameters with a = (if=/dev/zero) and not the more common approach of something like -i /dev/zero? I'm just curious if someone knows the historical reason or what the pros and cons ...
1 vote
1 answer
57 views

Copying image with dd results in ext4 filesystem as unknown

I've been trying to make a backup of this raspberry pi SD card and I keep failing. I just needed it a little bit smaller so it would fit on another 32GB SD card that I have. After a lot of failures ...
  • 113
0 votes
1 answer
41 views

Accidently dd to /dev/sda

I used Kali Linux, and I accidently used dd to /dev/sda while I'm trying to backup my files. It completes after a few seconds with a total size about 10 - 20 mb. After my computer was rebooted, it ...
  • 9
0 votes
1 answer
41 views

Why does dd create a 34MB file with bs=1G? [duplicate]

When typing the command: dd if=/dev/urandom of=outputfile bs=1G count=1 I should receive a file at the size of 1GB if I understand correctly. Yet, I receive a file of the following values: 33554431 ...
1 vote
0 answers
18 views

Differences in performance of HDD secure wipe commands

I am trying to secure wipe a USB connected HDD(not SSD) on macOS by overwriting it with random data. For some reason, only diskutil is very fast among these commands. Why is this? diskutil diskutil ...
0 votes
1 answer
26 views

Restore from Full Disk Image to Single Partition

For major version upgrades, Tails recommends this convoluted upgrade path where you write an image on a fresh USB drive, then clone the OS partition onto your original USB drive. I'm trying to figure ...
  • 103
1 vote
2 answers
50 views

DD copy of DVD stops with read error at a fixed position

First of all: I know, that you need to unlock the access to a DVD and the drive by first performing a handshake, for example with VLC. Otherwise the ISO will be roughly 3.7 MB in this case and fail ...
0 votes
0 answers
122 views

iostat returns disk utilization greater than 100% while profiling a Beaglebone Black board

I need to profile the performance of software running on a BeagleBone Black (BBB). The BBB has an ARM Cortex-A8 up to 1GHz frequency, 512MB RAM, and 4GB eMMC onboard flash storage. You can find more ...
  • 1
0 votes
0 answers
46 views

backup of ubuntu

I have Ubuntu installed on a single 1TB drive. What I want to do is a full backup of the system. I know I can use tar/gzip or rsync for most of the data, but I'm not sure what exactly do I need to do ...
  • 101
0 votes
1 answer
41 views

Why does cat randomFile.txt mess up with my terminal? [duplicate]

I am simply generating a pseudo-random content file with. dd if=/dev/urandom bs=1M count=1 of=./filetone.txt To then cat it cat ./fileone.txt The issue is that upon completing with this command it ...
0 votes
0 answers
33 views

Why tr redirected to dd unexpectedly cuts data stream? [duplicate]

I'm able to fill 1MB file with specific character like this: > tr '\0' '#' </dev/zero | dd of=1MB.bin bs=1k count=1024 1024+0 records in 1024+0 records out 1048576 bytes (1.0 MB, 1.0 MiB) copied,...
  • 149
-4 votes
2 answers
99 views

I Used dd to Backup All My Files, now It (Kali Linux) Won't Boot

I used this command to copy my files into an external hdd sudo dd if=/dev/sda of=/dev/sdb/Backup.img Now my laptop wont boot, it just shows Boot menu and Application Menu. I deleted the .img file ...
  • 1
0 votes
0 answers
35 views

Not able to mount disk partitions simultaniously after cloning by cat/dd command

In my Ubuntu 20.04.4 LTS virtual machine(in azure), I had 2 data disks (/dev/sdc & /dev/sdd) connected. I attached 2 disks to VM as per: https://docs.microsoft.com/en-us/azure/virtual-machines/...
5 votes
1 answer
212 views

I observe using `dd if=filein of=fileout` lead to filesystem fragmentation, what do I have to change?

There was a nice question that sadly got deleted while I was writing a rather extensive answer :( Not wanting to let that effort go to waste, let me paraphrase that question from the question text and ...
1 vote
0 answers
101 views

Overwrite file without truncating it

I'm basically looking for a dd if=inputfile of=outputfile conv=notrunc,nocreat alternative. I need it because simply overwriting files may severely increase fragmentation, so replacing them in place ...
-1 votes
1 answer
33 views

Can any one explain what the purpose of this "dd" command that writes to /dev/null is?

dd if=/dev/sda7 of=/dev/null bs=1024 skip=276892816 count=420 iflag=direct We are having some issues backing up a Linux server. Anyone, please explain to me what this command does in that case. ...
0 votes
1 answer
94 views

Problem creating a disk image of an SD card

I have built a custom image of Armbian with a partition size of 3.1 GB, and I am now finished working with it. It is currently written to a bootable 64 GB SD card which is using a GUID partition table ...
1 vote
3 answers
183 views

Can't write SD card partition table

I can't write the partition table on an SD card. IOCTL error. I can't delete it, either, neither in Linux using parted, cfdisk, or fdisk, nor in Windows, which just says format didn't work. The ...
1 vote
1 answer
84 views

How to avoid hardware damage with dd

I wanted to create an encrypted USB-stick. In the tutorial I used it said something like 'to avoid pattern based attacks dump random input to the drive'. So I did by dding /dev/urandom to the drive. ...
0 votes
0 answers
269 views

Fast method to transfer multiple large files to a USB disk with progress update in command-line

I need to transfer a number of large files of specific types from an internal disk to an USB SSD drive. The files I need to transfer are in the range of 5-200GB. I would like to monitor the overall ...
0 votes
1 answer
49 views

Perform backup (and restore) from my current LFS (Linux From Scratch) progress with dd command

I have my LFS proyek, currently I'm in chapter 10 so far according this book https://www.linuxfromscratch.org/lfs/view/stable/chapter10/grub.html . I want to perform backup of my LFS progress so if ...
0 votes
1 answer
78 views

Write a bootable image of system into an internal disk, without removing a data partition

I have an internal HDD like partitioned like this: [---- 100 GB unused ----|----------- 800 GB data ------------] 100 GB of unused or "to be deleted" old partitions /dev/sdb1, /dev/sdb2, /...
  • 2,179
1 vote
1 answer
59 views

Will dd copy half blocks?

I am using this command to overwrite the data of a hdd: sudo dd if=/dev/zero of=/dev/sdc bs=10M status=progress conv=fsync If the size of my hdd is not divisible by 10M, will dd abort or will it ...
  • 393
1 vote
0 answers
30 views

Reading from stdin `dd` copies more data than reading the same thing from file [duplicate]

I encountered weird behaviour of the dd tool: I downloaded compressed "newsystem.iso.xz". I ran xz -d --stdout newsystem.iso.xz | dd of=/dev/sdb bs=1M conv=sync. The decompressed "*....
  • 21
1 vote
0 answers
67 views

Calculating the block offset

I need to overwrite certain files in a raw disk image without modifying the disk image too much. Ideally, only certain strings should be overwritten, but this will probably not be possible. That is ...
0 votes
2 answers
454 views

What kind of content/data does "fallocate" command generate?

When is executed the sudo fallocate -l 2G /swapfile command, then 2 GB is created, but with that kind of content or data? Can be it customized? If yes How?. I did do some research but there are no ...
0 votes
0 answers
22 views

swap file: dd or fallocate? [duplicate]

About swap file in many tutorials within their procedures user either dd or fallocate dd as: sudo dd if=/dev/zero of=/swapfile bs=1024 count=N # N represents a high number to get X giga fallocate as:...
0 votes
1 answer
157 views

dd: when is mandatory use bs and count together?

I am reading many tutorials about the dd command. There are some examples including the bs and count parameters. Some of them where each one is isolated over the other and other where both are used ...
0 votes
1 answer
17 views

turnkey linux (LAMP stack edition) 16.1 - how to dd entire partition to USB via terminal?

I have it set up so I can access the shell directly from a computer on this local area network just by typing in its local IP. Is there a way to back up the entire disk (while using the operating ...
1 vote
1 answer
72 views

Referencing disk image on OpenBSD rather than disk partition

I am unable to find any online help for the following problem. I am trying to make a disk image copy on OpenBSD from one disk to another. On Linux, this is how I would do it: dd if=/dev/sda of=/dev/...
  • 11
0 votes
0 answers
43 views

How to access xfs partition encrypted with LUKS backed up with dd

How to access xfs partition encrypted with LUKS backed up with dd? Some time ago I've backup up two disks from old laptop. One of them was encrypted with LUKS and inside it there was xfs partition. ...
  • 1
0 votes
1 answer
66 views

Why do we need to set loop devices when mounting ddrescue images?

In various tutorials I see the following command: mount -o ro,loop,offset=123 harddrive.img /mnt/loop but from reading the documentation I can't understand what are loop devices. Why would harddrive....
  • 113
1 vote
1 answer
95 views

How to write "Magic Number" boot block to the first sector of my flash drive

I want to try and see how the BIOS detects boot device using the magic number (0xaa55) by writing e9 fd ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 00 ...
0 votes
1 answer
91 views

Why dd seems to provide corrupt copies?

Tried this with different machines running Centos and Ubuntu, with different USB flash drives but dd keeps producing unbootable flash drives. $ sudo dd if=foo.iso of=/dev/sdb bs=1M status=progress &...
0 votes
1 answer
277 views

Using dd to restore multiple partitions from multiple image files to same destination drive

I want to use dd command to create image file(s) from a source machine then extract it using dd to a destination machine. But the catch is that mount points / and /home are on separate partitions on ...
  • 247
0 votes
1 answer
107 views

dd faster than it should be

When I run the command dd if=/dev/zero of=tmp.dat bs=1M count=1024 status=progress on a 500G HDD I get 833617920 bytes (834 MB, 795 MiB) copied, 1 s, 829 MB/s 1024+0 records in 1024+0 records out ...
0 votes
0 answers
32 views

How to copy all contents of a smaller drive onto a larger one?

Is there some way with the command line that I can copy everything on a 256GB drive with Ntfs onto a 1TB one also with Ntfs and everything else intact? I am thinking of a command relating to dd but I ...
  • 135
0 votes
0 answers
25 views

Linux no longer booting from onboard memory

I'm having issues with a linux device. We have four of these devices where one of them had an error and I tried to restore it using a dd command which might have resulted in breaking the device. I don'...
0 votes
0 answers
39 views

Zeroing bytes to linux dos not working with LVM(XFS) volume

I'm running a CenOS7 on VirtualBox and need to reduce the VDI file. Firstble I need clean the free space using zerofree,trim, dd, etc... I tried to use both (DD and FSTRIM) to clean IT but after a ...
  • 1
0 votes
0 answers
55 views

dd is writing indefinitely until disk is full

I want to dd my microSD card, 32 GB, on which I installed RasberryPiOS. I plugged my 2TB SSD with 150GB space left, and send the following command: sudo dd if=/dev/sda1 of=/media/pi/Samsung_T5/raspi2....
  • 101
0 votes
0 answers
158 views

Mounting a bad raw disk image without fixing it?

Is it possible to mount a bad disk image without fixing it? Here's the story why. I was playing around with dd, and I accidentally wrote back a 20GB virtual disk image onto the disk itself. The old ...
  • 133

1
2 3 4 5
17