dd

Create FAT-formatted disk image that can fit 1G file

Create FAT-formatted disk image that can fit 1G file I’m struggling to create a FAT-formatted a disk image that can store a file of known size. In this case, a 1 GiB file. For example: # Create a file that’s 1 GiB in size. dd if=/dev/zero iflag=count_bytes of=./large-file bs=1M count=1G # Measure file size in …

Total answers: 2

Mounting a Disk Image

Mounting a Disk Image I’m trying to create a disk image and mount the partition for further work, but I’m encountering a frustrating error message: "wrong fs type, bad option, bad superblock." Here’s the steps I took and the output I received: $ dd if=/dev/zero of=test.img status=progress bs=200M count=1 1+0 records in 1+0 records out …

Total answers: 3

Using dd to back up only contents an image on an SD card

Using dd to back up only contents an image on an SD card I have a Raspberry Pi (RPi) with a 128 GB SD card. This SD card contains the full OS and settings for the RPi and I would like to back it up. The total size of all files on the SD card …

Total answers: 2

dd command not filling device

dd command not filling device I have a surplus 120GB SSD that I want to completely clear of data. With the drive unmounted, I ran sudo dd if=/dev/urandom of=/dev/sda bs=4M but it stopped after copying 8GB, reporting “dd: error writing ‘/dev/sda’: No space left on device”. lsblk showed the correct device name, and a capacity …

Total answers: 1

Erase external SSD completely, including SWAP

Erase external SSD completely, including SWAP I have an external SSD which I need completely wiped. I had Mint installed on it, with SWAP and some root dir. Those I somehow cannot get rid off. I tried sudo dd but that just wipes sdc and those other two entries seem to be separate from sdc, …

Total answers: 2

What do partclone.dd and partclone.imager do differently?

What do partclone.dd and partclone.imager do differently? I’m writing some backup software that needs functionality like partclone(8), and having some trouble with the man pages. In particular, I don’t see any difference between the pages for partclone.dd and partclone.imager, and the two binaries, while different, are the exact same size. Moreover, I found a question …

Total answers: 1

Handle Partition Changes Embedded System

Handle Partition Changes Embedded System I have to update some outdated embedded systems. But the RAUC Update contains four partitions, while the old systems have only three partitions. The additional Partition is at the start of the disk and I cannot flash the devices with an external Adapter. What I have, is SSH access to …

Total answers: 1

Write image to current root-partition

Write image to current root-partition I’m currently playing with building disk images (based on Debian) for a raspberry-like computer. My current workflow looks like: create disk image (about 16GB uncompressed; or 3GB compressed) power-down the target system eject the SDcard on the target system insert the SDcard into the build computer dd the image onto …

Total answers: 3

using a cron job to automatically backup the same drive using dd

using a cron job to automatically backup the same drive using dd so I want to backup my system drive (full drive not just partition) every month using dd, in an external hard drive. So I have something like this in my crontab 0 9 1 * * dd if=/dev/sda | gzip -c > /mnt/5E13119070E2D202/Backups/system_drive.backup.img.gz …

Total answers: 1

Create image from unallocated hdd

Create image from unallocated hdd I want to create file.img from unallocated hdd to another hdd ( backup the hdd ) to rescue my partitions and files in it . When I dd if=/dev/sda of=dev/sdb/file.img It shows dd: failed to open ‘/dev/sda’: permission is denied Please help Can i create image from used space only …

Total answers: 1

How to edit grub file after restoring data on a new drive via dd?

How to edit grub file after restoring data on a new drive via dd? I have a dual boot system with ubuntu 20.04 and windows 10. Because of being low on space I am upgrading my ssd to 512 gigs. I have booted into live ubuntu drive, and backed up each partition ubuntu, windows, efi …

Total answers: 1

Is it safe to use /dev/disk/by-id/ instead of /dev/sda?

Is it safe to use /dev/disk/by-id/ instead of /dev/sda? I am currently using a simple way to back up the drive dd if=/dev/sda of=/dev/sdb. However, before each operation, I have to check fdisk -l to see if sda and sdb have been swapped during boot. This is quite inconvenient and error prone. Is using symbolic …

Total answers: 1

dd – No space left on device with microSD cards

dd – No space left on device with microSD cards I’m working on Raspberry Pi OS on a Pi3B. I’m working with a script that does a few things for partitioning and there are times I want to wipe the drive, so I use (as root): dd if=/dev/zero of=/dev/mmblk0 status=progress bs=1M And I always get …

Total answers: 1

How to increase the size of a LUKS file-container

How to increase the size of a LUKS file-container There are many tips on how to resize (increase) a LUKS2 encrypted device / partition / LVM volume. But how to increase the size of the LUKS container created in the file? I once created: dd if=/dev/random of=/some file bs=1M count=100 cryptsetup luksFormat /some-file cryptsetup luksOpen …

Total answers: 1

Why is this dd command with a count and bs param running past its count?

Why is this dd command with a count and bs param running past its count? I have a dd command with bs=1M and count=40960M (40GB) and it’s consistently running past its count every time I try to run it. This is the exact command, and the output captured before I stop it: dd if=/dev/zero of=/swap/swapfile …

Total answers: 2

Disk size is variable

Disk size is variable I was flashing a new operating system to a device, but after the process was complete, I couldn’t boot into it. I then checked the disk, and I noticed something strange. Different tools report different sizes for the disk, even though it should be approximately 120GB in size. So, I decided …

Total answers: 1

Is the dd command enough to delete all data from a hard disk?

Is the dd command enough to delete all data from a hard disk? I need to remove all data from an hard disk where lubuntu 22.04 is installed. I was thinking to boot from an Ubuntu liveUSB image and, from a terminal, use the command: # the Hard Disk is the device file /dev/sda > …

Total answers: 3

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

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, fdisk -l /dev/xxxx Disk /dev/xxxx: 7876 MB, 7876902912 bytes 4 heads, …

Total answers: 1

Faster wipe hdd with random data

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 only like 100MB-1000MB of random data store it in the RAM and write it multiple …

Total answers: 2