Known issues

#1 · open · 3 comments

View on GitHub ↗

msuhanov

1. Data becomes misaligned when a faulty sector is encountered on a source drive. [NIST report](https://www.dhs.gov/sites/default/files/publications/DCFLDD%201%203%204-1%20Test%20Report_updated.pdf), [upstream patch](http://lists.gnu.org/archive/html/bug-coreutils/2003-10/msg00071.html). 2. An infinite loop when a faulty sector is encountered on a source drive (data is written to an output file until there is no space left). I observed this bug in dcfldd long ago (2014), I can't identify the buggy piece of code (it's hard to reproduce). Possibly related to the previous bug.

Comments

adulau

Thank you for the feedback. I remember the old dd bug. I'll review the code and check what's diverged from the original dd code. For the DA-09 test, I need to find a disk or a way to inject faulty sector in a raw image.

msuhanov

Here is a bash script to reproduce the first issue using _device-mapper_. ``` #!/bin/bash src_file='src.raw' dst_file_1='dst-dcfl.raw' dst_file_2='dst-dd.raw' dd if=/dev/urandom of="$src_file" bs=512 count=20480 loop1=$(losetup -f) losetup "$loop1" "$src_file" loop2=$(losetup -f) losetup "$loop2" "$src_file" table=$(echo -e "0 10232 linear $loop1 0\n10232 1 error\n10233 10240 linear $loop2 10240\n") echo "$table" | dmsetup create dcfldd bdev_size=$(blockdev --getsize64 /dev/mapper/dcfldd) echo "Block device created, size:" echo $bdev_size dcfldd if=/dev/mapper/dcfldd of="$dst_file_1" conv=sync,noerror dd if=/dev/mapper/dcfldd of="$dst_file_2" conv=sync,noerror dmsetup remove dcfldd losetup -d "$loop1" losetup -d "$loop2" rm -f "$src_file" ``` The output files are: ``` $ ls -l dst-d* -rw-r--r-- 1 root root 10518528 окт 25 01:47 dst-dcfl.raw -rw-r--r-- 1 root root 10482176 окт 25 01:47 dst-dd.raw ``` The misaligned data block is shown on the screenshot: ![Misaligned block](https://user-images.githubusercontent.com/7497142/47466135-96671780-d7f8-11e8-9ad2-b2441f63476d.png)

msuhanov

The second issue (or something similar to the second issue) can be reproduced with this line: `table=$(echo -e "0 10232 linear $loop1 0\n10232 1 error\n")` (A faulty sector is the last one.)