Coder Social home page Coder Social logo

doug-gilbert / ddpt Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 5.23 MB

official git-svn mirror for ddpt, yet another dd variant

Home Page: https://sg.danny.cz/sg/ddpt.html

License: Other

Makefile 3.44% Shell 6.59% M4 0.38% C 75.80% C++ 8.93% Roff 4.86%
unix dd-clone scsi copy command-line pass-through storage

ddpt's People

Contributors

doug-gilbert avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

ddpt's Issues

Unexpected writes using sparse + sparing

Here's an example using 0.97 (also exhibited on debian's 0.95) on a BTRFS filesystem.

# ddpt if=/dev/urandom of=test seek=17,3,21,3,63,1
Assume logical block size of 512 bytes for both input and output
7+0 records in
7+0 records out
time to transfer data: 0.000213 secs at 16.83 MB/sec
# cp --reflink=always -a test{,.ssp}; ddpt if=test of=test.ssp bpt=512,1 bs=512 conv=sparse oflag=sparing
64+0 records in
7+0 records out
57 bypassed records out
time to transfer data: 0.271519 secs at 120.7 KB/sec
# filefrag -v test
Filesystem type is: 9123683e
File size of test is 32768 (8 blocks of 4096 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        2..       2:    6298878..   6298878:      1:          2:
   1:        7..       7:    7504901..   7504901:      1:    6298883: last,eof
test: 2 extents found
# filefrag -v test.ssp
Filesystem type is: 9123683e
File size of test.ssp is 32768 (8 blocks of 4096 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        2..       2:    7504902..   7504902:      1:          2:
   1:        7..       7:    7504903..   7504903:      1:             last,eof
test.ssp: 1 extent found

Here it can be seen that test.ssp contains differing extents from test, meaning that the extents that had been reflinked were written to. The files contents are identical so sparing appears to not be adhered to. If conv=sparse is removed, no writes are done.

Only on the website there is this documentation with respect to using sparse and sparing together:

It seems unlikely that it would be useful to have both sparse writes and write sparing active on the same OFILE. If they are both given (i.e. 'oflag=sparing,sparse') then sparse writes are checked first and if zeros are found, the check for write sparing is bypassed on that segment.

However, this only applies to when the input block is all zeroes. This implies that when a block not of all zeroes is found that the check for sparing is not skipped. What appears to be happening in this case is that the sparse check is failing, but the sparing check is not being done. Because if the sparing check had been done, no writes should occur.

add nvme support please

Hi,

Add nvme support please.

# ddpt --version
0.95 20141226 [svn: r307]

#ddpt oflag=pt,trim bs=64K if=a.img of=/dev/nvme0n1
INQUIRY failed on /dev/nvme0n1

nvme scsi command translation is droped.
so we need some native nvme support.

Best Regards

Use SEEK_DATA/SEEK_HOLE to skip reading holes

For files that have large holes in them, it makes little sense to read those holes knowing they will be zero-filled. For instance, when using sparse mode, ddpt could seek to the end of a hole in the input with SEEK_DATA. Of course, the user could figure out the data blocks themself and use a scatter-gather list to only read the data. But it would be nice to have it be transparent.

It looks like similar functionality could be implemented for SCSI devices via the SCSI GET LBA STATUS command to see what blocks are mapped.

v0.96 source should not be in subdirectory "release-0.96"

The subdirectory "release-0.96" was added in commit 477d402. I'm guessing this was an accident and the intention, according to the commit message was to create a tag. Although it looks to come from an SVN commit, so maybe this was intentional.

Since it doesn't appear as though this repo is heavily used, I think it reasonable to remove the commit and do a force push (rewrite history).

Add information in README on contributing to the project

The README mentions that "improvement/bug feedback are encouraged", but no information is given as to how this should be done. Grepping the source, there are various places where the email "dgilbert at interlog.com" is given for bug reports, though it is not mentioned in the README. This repo is mentioned at https://sg.danny.cz/sg as a mirror for ddpt, but it is not explained whether issues or pull requests are acceptable forms of communicating bugs/fixes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.