Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/delan/guardbuffer
buffers and outputs input in regular blocks
https://github.com/delan/guardbuffer
Last synced: about 1 month ago
JSON representation
buffers and outputs input in regular blocks
- Host: GitHub
- URL: https://github.com/delan/guardbuffer
- Owner: delan
- License: isc
- Created: 2013-06-01T10:55:16.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-23T17:46:54.000Z (almost 9 years ago)
- Last Synced: 2024-10-14T15:52:59.703Z (3 months ago)
- Language: C
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
GuardBuffer
===========Buffers and outputs input in regular blocks.
Windows: copying raw partitions over a network
----------------------------------------------To copy a partition on one computer to a file on another is simple. Let's assume
that 64 KiB is a 'sweet spot' block size where performance is maximised.dd bs=65536 if=\\?\Device\HarddiskX\PartitionY of=\\dest\path\file
Great, but copying directly from partition to partition is trickier. Very few
programs, `dd` included, support interacting with block device files and they
cannot be accessed over a network via sharing.A potential solution, with the first command run on the source, and the other
on the destination:dd bs=65536 if=\\?\Device\HarddiskVolumeA | ncat -l 65432 --send-only
ncat source 65432 --recv-only | dd bs=65536 of=\\?\Device\Hard...BStrangely, the second `dd` isn't patient enough to wait for a full 64 KiB block,
and ends up attempting to write partial blocks. On Windows, writes to block
devices that are not a multiple of the sector size fail. This causes `dd` to
retry writing the partial blocks, padded with zeros, resulting in corruption.The solution is simple, a buffer is needed to ensure that `dd` only ever
receives data in chunks of the block size, regardless of how they arrive from
the network.dd bs=65536 if=\\?\Device\HarddiskVolumeA | ncat -l 65432 --send-only
ncat source 65432 --recv-only | gb | dd bs=65536 of=\\?\Device\Hard...BIn addition to this, `gb` also provides indications of time, progress and speed.