Questions tagged [dd]

dd is a traditional utility for binary data copies

Filter by
Sorted by
Tagged with
0 votes
1 answer
598 views

How to properly erase entire block device /dev/xxxx?

I have a block device that I'm trying to erase using dd. Seems like all my portion has been deleted. However, dd command is returning No space left on device. Block device information is as follows, ...
randomUser's user avatar
3 votes
1 answer
868 views

Use dd to copy partitiions of sda to a file on sdb

How do I use dd to copy the first 2 partitiions of /dev/sda (windows reserved, window7) to a file on /Dev/sdb? I think I can cd to /media/sam/1TB-NTFS/{ a folder I create } and run dd from there: dd ...
user256282's user avatar
3 votes
2 answers
1k views

Faster wipe hdd with random data

I know that with dd if=/dev/urandom of=/dev/sdX bs=1M count=hdd_size_in_MB you can wipe a whole disk with random data. But urandom is very slow. So I wonder if it would be possible to just create ...
user3776738's user avatar
0 votes
1 answer
100 views

Shrink part of disk to a new virtual disk

I have a Linux system (Debian 11) on a disk. Partition is 100GB, system only needs 10GB of data. If I get all the disk (dd) and use it for as a disk of a virutual system (qemu, kvm) all is fine. How ...
chris01's user avatar
  • 585
2 votes
1 answer
719 views

Recovery of a broken Hard Disk's filesystem using ddrescue and testdisk

After working on a partially rescued partition, I was told to use ddrescue to save a failing external hard drive and then apply testdisk over it to complete the rescue operation. Although the drive ...
Ulderico's user avatar
9 votes
3 answers
3k views

How can I copy arbitrary part of binary file with reasonable speed?

How can I copy arbitrary part of a binary file with reasonable speed? Apparently, dd with bs=1 is very slow, while setting bs to another value makes it impossible to copy arbitrary parts. Is it wrong? ...
Dims's user avatar
  • 3,255
-1 votes
1 answer
612 views

what is "dd if=/dev/zero of=/storage2/test4.img bs=1M count=256" usage?

I would be thankful if someone can explain me what does following command exactly doing: dd if=/dev/zero of=/storage2/test4.img bs=1M count=256
user565896's user avatar
1 vote
1 answer
145 views

Can't boot from SSD after it was moved into an external case

I used a SSD in an ASMT 2105 harddrive docking station connected to my Pi4 for installation (Raspbian Pi OS). After moving the SSD into a smaller external SSD case, the Pi won't boot anymore (no ssh ...
Vindolin's user avatar
  • 256
2 votes
1 answer
234 views

How to read constant size buffers from a named pipe, and run a command for each buffer

There is a function in terminal: redis-cli -x PUBLISH myChannel. It reads data from stdin and does its job. FIFO itself doesn't give chunked data. So I need to create chunks from the stream, and run ...
james hofer's user avatar
0 votes
1 answer
94 views

How to Tranfser huge amount of Files to slow USB Drive (dd, cp, rsync, 7z, tar)

I have like 5GB of data and a very slow USB-Drive. Should I use dd, cp or rsync? Should I compress them first into for example 7z / tar or not? In short: What is the best way and the best practices ...
Bog's user avatar
  • 999
0 votes
1 answer
265 views

What makes sfill so slow?

sfill -Illv makes a file with data from /dev/urandom until it fills the partition. Making a large file like this takes a lot of time. iotop tells me it is writing about 1 MB/s. Though dd if=/dev/...
xkehz's user avatar
  • 3
0 votes
0 answers
115 views

How to move a partition to the beginning of a drive

Say you have some drive /dev/sda that is 1TB in size. There is a partition /dev/sda2 of size 750GB at the end of the drive, and there is 250GB of unallocated space at the beginning of the drive. How ...
Kalcifer's user avatar
  • 141
1 vote
1 answer
782 views

dd: invalid argument 'progress' to 'status'

In my Buildroot Linux image I try do dd if=/mnt/disk.img of=/dev/sda bs=4M conv=fsync status=progress But I get error dd: invalid argument 'progress' to 'status' Why?
Андрей Тернити's user avatar
0 votes
1 answer
246 views

Extract first n bytes from .tar.gz and output as a .tar.gz in a single command

I have a .tar.gz as input and want to extract the first 128 MiB of it and output as a .tar.gz in a single command. I tried: sudo tar xzOf input.tar.gz | sudo dd of=output bs=1M count=128 iflag=...
JohnnyFromBF's user avatar
  • 3,496
1 vote
0 answers
302 views

How can I quickly perform a whole-drive dd backup over ssh?

I am trying to periodically back up a machine I am hosting remotely with dd. This is the method that I have found works in the past for machines with small drives. But my new machine has a 75 GiB luks-...
T. Zack Crawford's user avatar
0 votes
1 answer
75 views

What does it mean if the dd clock is ticking very slowly (every 12s only)?

I have an Intenso external 1TB 2,5" HDD here. It is somehow faulty (disconnects randomly on Windows) so I decided to run this command to check it: dd if=/dev/sdb of=/dev/null bs=4M status=...
zomega's user avatar
  • 972
1 vote
0 answers
457 views

Is it possible to copy a disk image to a smaller disk?

Let me explain, for a greater detail (although this casuistry will serve for many more cases): I have a cloned image of a 512GB mSATA disk, which in practice, really dlos comanoes not reach 10GB used ...
Fco Javier Balón's user avatar
4 votes
1 answer
275 views

Disk ran out of space when cloning with dd, but dd continues to copy

I am using the dd tool to make back-ups of Raspberry Pi SD card images to my local machine. When cloning one of these cards, the system drive ran out of free space. My machine had 112 GB of free space ...
Tyler Darby's user avatar
1 vote
1 answer
153 views

Unable to access or safely remove encrypted device

Details: I have a bootable encrypted HDD (running Linux mint). I have cryptsetup (2:2.4.3-1ubuntu1.1) installed on my main machine. I can access the unencrypted partition of the 1TB HDD. The system ...
Spock366373's user avatar
0 votes
1 answer
601 views

Mount compressed disk image or clone with dd respecting free space

I intend to mount locally an image obtained as a clone through dd. The image is corresponds to a mSATA disk of 512GB of storage, with a minimum version of Ubuntu barely configured. So usefully, really ...
Fco Javier Balón's user avatar
1 vote
1 answer
218 views

Extra space issue while creating a hard disk image using dd command

I have a Ubuntu OS installed on 1 Tb hard disk. Currently, around 200 GB hard disk is used while around 800 GB is free. Now, I have to take a complete (iso) image of hard disk for backup so that I can ...
Hafiz Muhammad Shafiq's user avatar
1 vote
2 answers
847 views

Accidentally used dd command

I have been following a tutorial online to teach myself some basic command line stuff and accidentally I used the dd command (which I haven't gotten to and don't understand), but it seems to have done ...
Boolaide's user avatar
0 votes
1 answer
233 views

Make a bootable, preinstalled and persistent USB bootable linux system

I have a debian 10 VM / Physical server, that I want to clone completely into a USB (DOK) Drive, and make it bootable. Additionally - I need this DOK to be Read/Write and not only ROM like CDFS. I ...
Matan Dobrushin's user avatar
0 votes
1 answer
191 views

How to calculate the checksum while writing random data to a disk?

I have a disk which is perhaps broken. I want to write random data to the disk and later verify the md5 checksum. I write to the disk like this: dd if=/dev/urandom of=/dev/sda bs=4M status=progress ...
zomega's user avatar
  • 972
1 vote
1 answer
157 views

md5sum of image and sd-card partition differ

I am creating an image of an sd-card partition (dd) and eventually the checksum (md5sum) of the image and the partition are not the same. What am i doing wrong? My sd card is inserted into an external ...
Ben's user avatar
  • 13
4 votes
1 answer
227 views

Mounting a drive from an embedded device with bytes swapped

I have a device from about twenty years ago that uses an IDE hard drive as storage. I would like to keep using it, but it has a USB 1 interface that is extremely slow. I can take out the hard drive ...
edbgon's user avatar
  • 81
0 votes
1 answer
134 views

Is there a way to be sure a file is not truncated compared to the file size stored in the inode table? (Does a dd command do?)

I work on an ext4 filesystem. I have doubts about the accuracy of a directory entry regarding the description of a file that I have copied from an NTFS filesystem and that might have spanned some bad ...
The Quark's user avatar
  • 270
0 votes
2 answers
55 views

dc3dd, why tab completion doesn't work?

On Slackware 15. Using dd I do dd if=/home/myuser/my..TAB and complete dir path after pressing tab using dc3dd I did dc3dd if=/home/myuser/my..TAB and nothing happen. Why? I have tried with rlwrap but ...
elbarna's user avatar
  • 12.7k
0 votes
1 answer
89 views

Performance test went wrong and the dd command created 13TB of data on /dev/mapper/device. Why system didn't crash? HDD-250GB

So I wanted to do some performance test with encrypted and normal data storage on my embedded device. That is not what I was expected to see at all! Can you please explain it to me what just happend. ...
What_is_my_name's user avatar
1 vote
0 answers
453 views

Is ddrescue/dd cloning compatible with GPT/UEFI boot?

I used ddrescue many times for failing HDDs with MBR partition tables. It always worked perfectly and if the failing HDD was bootable, the clone booted, too. Now I have a possibly failing SSD, but ...
Glorifyday's user avatar
2 votes
1 answer
233 views

mkfs fails if called after a 'dd' operation

I want to delete all files on one my eMMC blocks (e.g. /dev/mmcblk0p1) and re-create the filesystem afterward (with ext4). So I unmount and erase: umount /dev/mmcblk0p1 dd if=/dev/zero of=/dev/...
DEKKER's user avatar
  • 948
0 votes
1 answer
544 views

New on Linux, I m afraid I detroyed an SSD, did I? What can I do, please?

I'm new on the Linux field. I have a real big problem. I have installed several times Linux Mint 21 on an old - but very nice computer - without any issues. I'm not at all a beginner in the field of ...
gottogetout's user avatar
0 votes
1 answer
217 views

Using dd to do a bare-metal restoration w/ stored individual partitions

I have a disk that I make regular backups of. The disk is made of a few different partitions. Previously I've been using the dd command to back up /dev/sdX all at once and it's all gone very well. I ...
Mike Battaglia's user avatar
1 vote
1 answer
159 views

dd stops copying mid-way through a CD

I got a couple of old disks I'm trying to copy over to a HDD. Some of the disks worked fine and I was able to copy them using just mount and rsync, however as is it with old disks, some of the disks ...
DentFuse's user avatar
1 vote
1 answer
300 views

dd: `iflag=nocache` ineffective for the first usage

The flag iflag=nocache of dd seems to take effect only at the second time onwards. I don't understand why. I was thinking maybe it is related to readahead cache, but it doesn't explain the results in ...
Dor's user avatar
  • 2,535
1 vote
1 answer
51 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 ...
Hormoz's user avatar
  • 143
1 vote
0 answers
161 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 ...
Le Nain Jaune's user avatar
1 vote
2 answers
969 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,...
hutcruchi's user avatar
  • 339
1 vote
1 answer
277 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 ...
Hormoz's user avatar
  • 143
4 votes
3 answers
2k 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' | ...
Ashar's user avatar
  • 491
2 votes
1 answer
328 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 ...
hutcruchi's user avatar
  • 339
1 vote
0 answers
1k 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 ...
tomac's user avatar
  • 11
1 vote
1 answer
758 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=...
EmmaV's user avatar
  • 4,067
16 votes
3 answers
8k 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/...
NoExpert's user avatar
  • 489
26 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 ...
Jan Wiesemann's user avatar
1 vote
1 answer
629 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 ...
confused's user avatar
  • 113
0 votes
1 answer
161 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 ...
MauryZ's user avatar
  • 9
0 votes
1 answer
232 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 ...
Bob Ross's user avatar
1 vote
0 answers
25 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 ...
yakitori-ja's user avatar
0 votes
1 answer
539 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 ...
Jared's user avatar
  • 103

1
2
3 4 5
18