Questions tagged [dd]

dd is a traditional utility for binary data copies

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

How to efficiently backup the main mount point

I would like to save a copy of the main mount point (/) and all the sub-folders in a decent time range. I have tried to use rsync -av / /mnt/my_usb_drive/ but the writing speed has been very poor (1-2 ...
0
votes
1answer
25 views

dd: writing to Invalid argument with 4k blocksize on iSCSI LUN

Why can't use oflag=direct on the 4k blocksize iSCSI disk? Could other applications also have a problem with the cause? root@testvm02:~# dd if=/root/speedtest of=/mnt/8k_512/speedtest oflag=direct ...
13
votes
4answers
3k views

Is “dd” a reliable tool to make an SSD image?

I want to back up my SSD using the Linux dd command, but I'm not sure how reliable that method will be. I think I read somewhere that dd does not check for or report errors, so obviously if true then ...
0
votes
0answers
37 views

One particular UID causes very slow performance

One of our accounts on a CentOS 7 machine experienced very slow disk read/write.  I started looking into this because the 1007 user on this machine ran wget much slower than other user/machines. id ...
3
votes
1answer
39 views

How to copy a file into another file at a certain position using the command dd?

I want to copy a file of 256 bytes at a certain position into another file of size 2048 bytes containing random data, with the command dd in Linux. The offset I have is 144. I have assumed that bs=1, ...
0
votes
0answers
16 views

Backup RPI but not wohle disk

I use a Backup-Script which uses dd. I have switched from SD to SSD via USB (120GB) and now the backup is 120GB. Is it possible to back up only sda1 and sda2? root@raspberrypi# lsblk -l NAME MAJ:MIN ...
0
votes
0answers
39 views

PV + PIGZ + DD = Slow performance

I am attempting to write data to a device via dd and also get the progress of this process. Currently, the command I have does the following: pv opens the file and pipes to pigz, which decompresses ...
0
votes
1answer
38 views

How can I obtain the block size of an iso file without booting from it?

I would like to use the dd command to make a bootable flash drive, but for that I need to know what the correct block size is. I know that I can just boot the ISO in a VM and run parted or fdisk to ...
0
votes
1answer
34 views

Slow /dev/zero format using dd with nvme to prepare crypto, is there nvme specific tool?

I try to prepare an nvme for encryption, so i first follow this post on SO. But the speed of dd is really really slow (less than 100 mb/s). I see there is new option to speed up dm-crypt on kernel 5.9 ...
8
votes
3answers
1k views

How do I create binary file with certain value?

I need to create a binary file that is filled only with 11111111. I only know how to create zero-filled binary with dd if=/dev/zero bs=18520 count=1 Could you please say to me what a command in ...
1
vote
1answer
56 views

Best way to clean up huge directory

I have a directory that contains multiple files of really huge size and the total size of the directory is around 285G where if i do ls -ltrh to list files in the directory, it is taking its own time ...
0
votes
0answers
35 views

I trying to partition my disk and i always get less space then i partitioned

So i have [root@archlinux ~]# fdisk -l Disk /dev/sde: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors Device Start End Sectors Size Type /dev/sde1 2048 534527 532480 ...
1
vote
1answer
34 views

Linux dd is stuck writing to md0, does anyone see problem?

I am using Ubuntu 18.04 and have an md0 raid array of 4x500GB drives, ie. 2TB I ran this command dd if=/dev/zero of=./swapfile bs=1MiB count=350KiB Which I expected to create a 350GB file, However the ...
0
votes
0answers
22 views

Can't write anything to USB drive. HTOP says 'disk sleep (uninterruptible)'

I was trying to 'burn' a ISO to my usb flash drive using the good ol' dd if=some-linux-distro.iso of=/dev/sdb bs=4M && sync but the process took a long time. So, I looked at the process in ...
0
votes
1answer
22 views

mdadm 10 far raid uneven read speed

Why sequential read speed from raid 10 growth only with very huge bs(>100MB, dd parameter). Having raid: /dev/md127: Version : 1.2 Raid Level : raid10 Array Size : 46875009024 (44703.49 GiB ...
0
votes
1answer
24 views

how to get split commands output to file

I want to print output of below command to file, can you help me I tried 2>&1 even 2>> also dd if=/dev/random bs=1 count=1000 status=progress |split -b 10 -a 10 I have other dd command ...
1
vote
1answer
25 views

Created bootable drive using dd, now my 1tb hard drive has only 268mb

I'm using a 2020 Macbook Air (M1 version). I've been trying to work out how to install linux to use some programs I need for data analysis, and today tried to follow this guide: https://corellium.com/...
0
votes
1answer
54 views

dd bs=X count=1 reads less than X bytes [duplicate]

I have dd from GNU coreutils 8.32. When I run { echo a; sleep 1; echo b; } | dd bs=4 count=1 then I get a 0+1 records in 0+1 records out 2 bytes copied, 2.0381e-05 s, 98.1 kB/s dd terminates during ...
0
votes
1answer
47 views

bash script to select a disk for dd (lsblk?)

I'm trying to make a script to select into which disk I should dd to. A simple bash script to select options works like this: #!/bin/bash # Bash Menu Script Example PS3='Please enter your choice: ' ...
0
votes
1answer
25 views

Why some tools such as dd don't need a mount point to work with a device?

If I need to use a my USB drive on an Ubuntu machine I need to mount it first. If my USB device is /dev/sdb1 then I mount it with: mount /dev/sdb1 /home/some_folder Then use /home/some_folder to read ...
0
votes
0answers
67 views

I accidentally wrote to a deleted file (loop device)

I accidentally wrote to a delete file through the loop device. OS: Ubuntu 20.04 Here is my scenario: 1 - I created a RAW image file: # qemu-img create -f raw sda.img 10G 2 - I created partiton with ...
0
votes
1answer
29 views

why reading from `/dev/random` put `1;2c` character behind the cursor? [duplicate]

when I run command dd if=/dev/random count=1 bs=32 I get some random junk binary data but after receiving them, there is still some characters (as I see always 1;2c) after termination of dd process. [...
0
votes
0answers
21 views

LUKS error rescue

My disk has some problems, perhaps going to die so I bought a new one and backup the LUKS partition from the error disk with UDisk, but the proccess is stuck at 90% for hours, so I have to click stop ...
0
votes
2answers
13 views

DD Img issue OPFsense nano install help

I am trying to install the OPFSense nano image to a drive I have mounted I have been using the DD command and running the following commands sudo dd if=OPNsense-21.1-OpenSSL-nano-amd64.img of=/media/...
0
votes
0answers
47 views

Filesystem image made with dd sometimes fails--How to Analyze? [duplicate]

I've googled this extensively and can't quite come up with an answer. Overview I created two image files of a filesystem I'm actively using (/) and it sometimes is ok, and othertimes is not. What I do ...
0
votes
0answers
19 views

How to work with a file at mount drive when its size is bigger than root partition?

I am currently working on Google Colab. This is a jupyter notebook running inside a VM with 70 GB available to the user. I have mounted my Google Drive at /content/drive/MyDrive/ and created a folder ...
0
votes
1answer
32 views

How to move my data to end of partition?

To avoid dd alike destroy my personal files, it'd be better to move them to the higher number of sectors that near the rear of partition, and as I don't have separated /home, I also need to move the ...
0
votes
0answers
55 views

“Warning the partition is misaligned by 3072 bytes” Centos 6 10TB non boot drive, how do I fix?

I was very careful installing the and and going through the format guides but in the Disk Analyzer it says the following? how do i fix it? Its not a boot drive so I understand I can commands from ...
0
votes
1answer
57 views

Writing ISO to USB in CentOS

I've written many ISO images to USB in the past. However, for some reason, I'm unable to complete this task on multiple machines running CentOS in my lab. The scenario is fairly simple. I have an ...
0
votes
1answer
24 views

How to uncompress a gzipped partition image and dd it directly to the destination partition without writing to current partition?

I've backed up a partition using sudo dd bs=8M if=/dev/sda2 | gzip > /someFolderOnSDB/sda2.img.gz. The image is stored on a separate disk sdb. When restoring it using gunzip -k /mnt/bkp/sda2.img.gz ...
1
vote
0answers
39 views

Store in a variable monitoring result of dd to use it in c++

I use this to monitor dd when i copy files. sudo dd if=$source of=$pathToUsb bs=4M conv=fdatasync status=progress 2>&1 | stdbuf -o1 tr '\r' '\n' | stdbuf -o1 cut -d' ' -f1 | sed -u 's/[a-z]*//g'...
-1
votes
1answer
33 views

copy files from the folder on one disk to the folder on another disk

how to copy files from the folder on one disk to the folder on another disk use cp command? (from the current directory on sda2 to folder on /dev/sdb3?)
1
vote
0answers
34 views

dd cloning process keeps the partition table but not the logical volumes and their names, why?

So I Am trying to clone a drive using dd via the following command #dd if=/dev/sda of=/dev/sdb bs=64k status=progress the command does what it is supposed to for the most part but the usb which was ...
0
votes
0answers
41 views

Gzipped image file will not boot when flashed to sd card

I have a script that creates a raw .img file: imgPath="/home/me/loopbackfile.img" dd if=/dev/zero of=$imgPath bs=4M count=300 losetup -fP $imgPath Partitions it... loopDevice=$(losetup -a | ...
0
votes
0answers
45 views

dd command on running system makes backup image with older versions of files

I use these commands in a script to create an image backup of an SD card while a Linux OS is running on it -- OpenWrt. The rootfs is 1000MiB so I only dd the first 300 blocks. This way I can restore ...
1
vote
2answers
182 views

What does `dd if=/dev/zero of=/dev/null` actually measure?

I was doing some hard drive speed benchmarking and decided to try the following command to see what would happen: dd if=/dev/zero of=/dev/null After I canceled it, I got: (269 GB, 251 GiB) copied, ...
0
votes
0answers
27 views

dd stops working after writing for couple of seconds [duplicate]

I want to install ubuntu server, so I decided to use dd. After executing following command dd writes some bytes there(I think it wrote every byte) and stops. sudo dd bs=32M if=ubuntu-20.04.1-live-...
3
votes
1answer
170 views

How to create an ISO disk image of an NVMe SSD?

I want to create a disk image of my solid-state drive using the dd (disk dump) command. There are multiple partitions on the SSD. Is it possible to make a complete image of the drive including all ...
3
votes
3answers
512 views

How reliable is a system backup created with the dd command? [duplicate]

I'm using a raspberry pi running 24/7 and created a crontask that backups the complete sd card to my NAS on a regular basis. I checked such a backup by copying it back to an SD card and it worked ...
0
votes
2answers
38 views

How can you move an image of a GPT drive to a smaller device?

I have a 64GB SD card with Linux (Debian) installed on it. I want to move it to a smaller SD Card (16 GB). I used resize2fs and cfdisk to resize the filesystem and partitions, so that now, they look ...
2
votes
2answers
46 views

DD reports success after seconds but nothing actually happens. Can't format USB, either (Debian 10)

DD returns $ sudo dd if=Downloads/ubuntu-20.04.1-live-server-amd64.iso of=/dev/sdb 1871872+0 records in 1871872+0 records out 958398464 bytes (958 MB, 914 MiB) copied, 2.0311 s, 472 MB/s after about ...
0
votes
2answers
83 views

Resume incomplete disk image with dd over ssh

What I did so far I wanted to create a disk image of my server HDD partition and copy it to my desktop (client). I used the following command on the server: dd if=/dev/md3 status=progress bs=500k | ...
0
votes
1answer
18 views

Writing single image to consecutive partitions using dd

Is it possible to write an image larger than the partition using dd? Supposing I had: blah.img: 8GB /dev/sda1: 3GB /dev/sda2: 4GB /dev/sda3: 4GB ... Are consecutive partitions guaranteed to be laid ...
-3
votes
1answer
110 views

Why performance degradation if read/write operations are not performed in multiples of the disk’s block size?

In Love's Linux System Programming, in CHAPTER 3 Buffered I/O Recall from Chapter 1 that the block is an abstraction representing the smallest unit of storage on a filesystem. Inside the kernel, all ...
0
votes
1answer
58 views

How to skip the needed amount of bytes in output file using dd utility?

I want to rewrite a specific area in an output file with an input file using dd utility, I need to skip the first 732618 bytes in the output file and write 708800 bytes starting from there, I found ...
-1
votes
2answers
69 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% /...
1
vote
0answers
31 views

Cloned only a single encrypted HFS+-partition, not the whole disk (ddrescue)

I cloned a single partition type HFS+ encrypted to a file image using ddrescue. The disk is not damaged, I only needed the space on the disk for something. Now I realised that I forgot to clone the ...
0
votes
0answers
12 views

multibooting usb drive using rsync?

would it be possible to copy the partitions of a multiboot(both windows and linux) harddisk including the esp/boot partition to a usb harddrive using the rsync command and get the destination drive to ...
0
votes
2answers
111 views

Clone SSD from .img with DD

I saved a backup from ssd A to .img file with dd command now I want to know to clone ssd A to ssd B can I do it directly from the .img file something like: dd if=/dev/backup.img of=/dev/sdc bs=1 ...
1
vote
2answers
43 views

Unable to create hard disk image

I trying to create a hard 0.5GB hard disk and format this hard disk with the following specification block size - 1024 bytes file system type - XFS I did run this command: sudo dd if=/dev/zero of=...

1
2 3 4 5
15