<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://k2.ixota.com/index.php?action=history&amp;feed=atom&amp;title=Linux%2Fdd</id>
	<title>Linux/dd - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://k2.ixota.com/index.php?action=history&amp;feed=atom&amp;title=Linux%2Fdd"/>
	<link rel="alternate" type="text/html" href="https://k2.ixota.com/index.php?title=Linux/dd&amp;action=history"/>
	<updated>2026-06-26T12:12:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.1</generator>
	<entry>
		<id>https://k2.ixota.com/index.php?title=Linux/dd&amp;diff=4458&amp;oldid=prev</id>
		<title>Kenneth: /* Pad File */</title>
		<link rel="alternate" type="text/html" href="https://k2.ixota.com/index.php?title=Linux/dd&amp;diff=4458&amp;oldid=prev"/>
		<updated>2017-10-09T05:11:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Pad File&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== dd recovery ==&lt;br /&gt;
&lt;br /&gt;
 conv=sync,noerror&lt;br /&gt;
 dd if=/dev/sda of=/dev/sdb bs=1M conv=sync,noerror&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;quot;conv=sync tells dd to pad each block to the left with nulls, so that if, due to error, the full block cannot be read, the full length of the original data is preserved, even though not all of the data itself can be included in the image. that way you at least know how damaged the data is, which might provide you with forensic clues, and if you can&amp;#039;t take an image at all due to bad blocks or whatever, you can&amp;#039;t analyze any of the data. some is better than none. conv=sync,noerror is necessary to prevent dd from stopping on error and make a dump with same location for each blocks, than source. conv=sync is largely meaningless without noerror.&amp;quot;&amp;#039;&amp;#039; [http://superuser.com/questions/622541/what-does-dd-conv-sync-noerror-do]&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
* http://linuxcommand.org/man_pages/dd1.html&lt;br /&gt;
* http://vlinux-freak.blogspot.com/2011/01/how-to-use-dd-command.html&lt;br /&gt;
* https://superuser.com/questions/622541/what-does-dd-conv-sync-noerror-do&lt;br /&gt;
&lt;br /&gt;
== direct io ==&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/zero of=out.img bs=1M count=1000 oflag=direct&lt;br /&gt;
&lt;br /&gt;
== Pad File ==&lt;br /&gt;
&lt;br /&gt;
Error: size of old.img is not a multiple of 512&lt;br /&gt;
&lt;br /&gt;
Pad to multiple of 512&lt;br /&gt;
 dd if=old.img of=new.img obs=512 conv=sync&lt;br /&gt;
&lt;br /&gt;
Add specific amount of bytes:&lt;br /&gt;
 dd if=/dev/zero bs=1 count=20 &amp;gt;&amp;gt; out.img&lt;br /&gt;
&lt;br /&gt;
pad the output file with zeroes until the file size reaches 100 KB:&lt;br /&gt;
 dd if=inputFile.bin ibs=1k count=100 of=paddedFile.bin conv=sync&lt;br /&gt;
&lt;br /&gt;
Pad with 0xFF:&lt;br /&gt;
 dd if=/dev/zero ibs=1k count=100 | tr &amp;quot;\000&amp;quot; &amp;quot;\377&amp;quot; &amp;gt;paddedFile.bin&lt;br /&gt;
 hexdump -C paddedFile.bin&lt;br /&gt;
 dd if=inputFile.bin of=paddedFile.bin conv=notrunc&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
* unix - How to append data in a file by dd? - Super User - https://superuser.com/questions/850267/how-to-append-data-in-a-file-by-dd&lt;br /&gt;
* linux - How to pad a file with &amp;quot;FF&amp;quot; using dd? - Super User - https://superuser.com/questions/274972/how-to-pad-a-file-with-ff-using-dd&lt;br /&gt;
* lofiadm: size of xxx.iso is not a multiple of 512 | Dbhk&amp;#039;s Blog - https://dbhk.wordpress.com/2012/08/24/lofiadm-size-of-xxx-iso-is-not-a-multiple-of-512/&lt;br /&gt;
&lt;br /&gt;
== Append Data ==&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/shm/test bs=1G &amp;gt;&amp;gt;/data/sdb/test&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/shm/test of=/data/sdb/test bs=1G oflag=append conv=notrunc &lt;br /&gt;
&lt;br /&gt;
Ref: unix - How to append data in a file by dd? - Super User - https://superuser.com/questions/850267/how-to-append-data-in-a-file-by-dd&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
		
	</entry>
</feed>