New answers tagged

1

dd will read from the if (input file) and dump it to the of (output file), it will be a binary copy of the "if". These files can be filesystem files, filesystems themselves, raw devices, etc. This command will not make anything from the data structures that reside in the "if", if it is a filesystem it willl copy it, regardless if the ...


2

dd doesn't know anything about mounts or folders or unix file structure in filesystems. dd only knows about raw data and a few trivial transformations of raw data and data blocks. It was originally designed to read and write data from or to block devices (including disks and tapes) and could handle changing the structure of that data back and forth between ...


1

When a drive (or partition, or other block device, or a disk image file, etc) is formatted, the top-level directory of the filesystem is owned by the user running the mkfs command. Usually, that is root unless you're formatting a disk image file (or a block device you happen to have RW perms on) as a non-root uid. If you want to change the ownership, mount ...


2

Something like this might work: parallel -j0 --dryrun dd if=/dev/zero of=/dev/{} ::: "${!wipe[@]}" Remove --dryrun when the output looks correct. (Also consider overwriting the harddrives with random data. You can use https://gitlab.com/ole.tange/tangetools/-/tree/master/rand to generate massive amounts of cryptographically secure pseudo-random ...


2

The script as given shouldn't run at all, because you are missing the done on the for loop. This must be an excerpt, and you've left out important parts. Assuming the missing done is after this snippet, the wait is inside the for loop, so you start the dd in the background and then wait for it to finish before going to the next iteration. Basically, your ...


4

With an uncompressed (and probably sparse itself) source file, simply using (GNU) cp --sparse=always sourcefile /dev/sdX would be enough: --sparse=WHEN control creation of sparse files. See below By default, sparse SOURCE files are detected by a crude heuristic and the corresponding DEST file is made sparse as well. That is the behavior selected by --sparse=...


0

You can actually use a dd pipe to accomplish this, without the performance penalty, without truncation or rounding errors, and with byte-level accuracy: dd iflag=skip_bytes,count_bytes skip=1234 count=42 | dd oflag=seek_bytes conv=notrunc seek=12340 of=test.bin On the left side, dd will read exactly 1234+42=1276 bytes and nothing more. It will do so ...


0

Yes - have a look at Clonezilla. It won't copy unused unused portions of your filesystem to the backup image (or unallocated portions of your disk either). However if you have a sparse file which the filesystem sees as one big allocation, then it will be treated as such, regardless of content. Clonezilla also passes the selected output through a compression ...


1

With -o loop mount creates a loop device and tries to mount it, but the device doesn't contain an ext4 filesystem, it contains a partition table which is not mountable. You need to mount the partition on the image and mount can't do that, you need to create the loop device manually first with --partscan to tell kernel to probe the partition table and the ...


Top 50 recent answers are included