Little Things Doth Crabby Make – Part XII.1 Please, DD, Lose My Data! I Didn’t Need That Other 4K Anyway.

I’ve never done a “dot release”  for any post in my Little Things Doth Crabby Make series but there is a first time for everything. In yesterday’s post (Part I) I blogged about how dd(1) on Linux will happily let you specify arbitrarily huge values for the bs (block size) option yet doing so will cause silent data loss. One reader commented on the blog and several emailed me to point out that the proof I specified is faulty. They are right, but that fact doesn’t change the truth. I discovered this data loss with a simple file-to-file dd operation but thought piping it to wc(1) would make the point easier to understand. The problem is doing so meant I was checking the return from wc(1) not dd(1).  No matter:


# dd if=OH.tar.gz bs=2147483648 of=newfile count=1
0+1 records in
0+1 records out
2147479552 bytes (2.1 GB) copied, 3.57895 seconds, 600 MB/s
# echo $?
0
# bc -l
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
2147483648-2147479552
4096
# ls -l newfile
-rw-r--r-- 1 root root 2147479552 Jun 17 12:06 newfile


0 Responses to “Little Things Doth Crabby Make – Part XII.1 Please, DD, Lose My Data! I Didn’t Need That Other 4K Anyway.”



  1. Leave a Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




DISCLAIMER

I work for Amazon Web Services. The opinions I share in this blog are my own. I'm *not* communicating as a spokesperson for Amazon. In other words, I work at Amazon, but this is my own opinion.

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 2,988 other followers

Oracle ACE Program Status

Click It

website metrics

Fond Memories

Copyright

All content is © Kevin Closson and "Kevin Closson's Blog: Platforms, Databases, and Storage", 2006-2015. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Kevin Closson and Kevin Closson's Blog: Platforms, Databases, and Storage with appropriate and specific direction to the original content.

%d bloggers like this: