Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
04-04-2010, 12:05 AM
|
#616
|
|
Senior Member
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian Testing; OpenSuSE 12.1; Fedora 17
Posts: 1,541
Original Poster
Rep: 
|
Strings will omit quite a large number of sectors.
Last edited by AwesomeMachine; 04-04-2010 at 12:21 AM.
Reason: forgot something
|
|
|
|
04-05-2010, 09:28 PM
|
#617
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
Quote:
Originally Posted by AwesomeMachine
Strings will omit quite a large number of sectors.
|
'strings' has no idea what a sector is or does; it outputs sequences
of printable characters in its input stream. It suppresses characters
w/o a sensible printable representation, and prints candidates for
actual words.
'hexdump' will faithfully let you output any garbage in a presentable
view, e.g.: a column of hex-data and a column of ASCII data in your
incantation; whether or not that is what one wants to see is a totally
different story. As far as recognisable (human readable) strings goes,
'strings' would be my preferred weapon of choice because I wouldn't need
to worry whether a string has been broken over to the next line.
Cheers,
Tink
|
|
|
|
04-13-2010, 02:57 AM
|
#618
|
|
Senior Member
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian Testing; OpenSuSE 12.1; Fedora 17
Posts: 1,541
Original Poster
Rep: 
|
Nevertheless, if one wants 5000 sectors, they won't get 2560000 of data using strings. That may, or may not be problematic. I haven't as yet found a solution to the hexdump newline problem.
|
|
|
|
04-16-2010, 02:47 AM
|
#619
|
|
LQ Newbie
Registered: Apr 2010
Posts: 2
Rep:
|
very usefull and great examples! Thanks
|
|
|
|
04-16-2010, 01:52 PM
|
#620
|
|
Senior Member
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian Testing; OpenSuSE 12.1; Fedora 17
Posts: 1,541
Original Poster
Rep: 
|
Your Welcome
Quote:
Originally Posted by dtdeg
very usefull and great examples! Thanks
|
Dteg,
Thanks for saying it!!
-Awesome
|
|
|
|
05-12-2010, 04:27 PM
|
#621
|
|
LQ Newbie
Registered: May 2010
Posts: 1
Rep:
|
This is one the most awesome posts I've ever seen! It's like being confronted with the compositions of a manic; overwhelming and disturbing at the same time. I sat there gaping as I just go flushed away. I guess, reading this is just like 'dd'ing your own brain with /dev/random  .
Above all, it was entertaining and most educating. Many thanks!!
Last edited by zorpox; 05-12-2010 at 04:31 PM.
|
|
|
|
05-12-2010, 10:49 PM
|
#622
|
|
Member
Registered: Apr 2010
Posts: 54
Rep:
|
It's a great post. Helped me a lot. Keep it up!!!
|
|
|
|
05-13-2010, 12:07 AM
|
#623
|
|
Member
Registered: May 2010
Location: India
Distribution: Ubuntu 7.04/8.04/8.10/10.04, RHEL 6, OpenSUSE,Mandriva,Fedora, CentOS, XandrOS, Slackware, OpenSolar
Posts: 155
Rep:
|
I think moderator should award this post as " the Lengthiest thread ever occured"
what you guys say?
|
|
|
|
05-13-2010, 08:07 AM
|
#624
|
|
Moderator
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 10,346
|
Hi,
Welcome to LQ!
Quote:
Originally Posted by ajeetsinghraina
I think moderator should award this post as " the Lengthiest thread ever occured"
what you guys say?
|
Not even close to the replies for 'T he All New Linux vs Windows MegaSuperThread'.
The views for the 'DD' thread are much higher but not the reply. As for utility, assistance and overall usefulness my vote goes to this 'DD' thread.

|
|
|
|
06-05-2010, 10:22 PM
|
#625
|
|
Senior Member
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian Testing; OpenSuSE 12.1; Fedora 17
Posts: 1,541
Original Poster
Rep: 
|
Learn The DD Command has reached a landmark: 500,000 views. I didn't notice right away. As of this reply there are 505,000 views. When I first conceived of a dd post, all I wanted was a place to gather examples of practical dd usage. There was no central repository at that time, and the existing information was haphazardly strew across cyberspace.
I wanted to put the power of dd in the hands of common computer users, not just computer professionals. I'm a computer professional, and I saw the potential for dd in the hands of beginners. When my classmates in grade school were reading childrens' novels, I was reading how to program a mainframe computer. I never liked kids books, not even as a kid. I knew I'd make a living doing something with computers.
Since I became aware of its existence, I always liked linuxquestions.org. It's a great site. I can't think a better place to have the Learn The DD Command thread than a linuxquestions.org. If you happen to run across this reply, and you're not already a member, take the time to join. When I joined I didn't really need help learning Linux. It's just a great community.
There are more deeply technical Linux forums out there, but the idea of Linux is to have fun. If Linux wasn't fun, I'd find some other OS that was fun, and use that. But anyway, this dd thread has had the benefit of Jeremy's SEO skills. It's not just because it's a great thread that got it to over 500,000 views. Jeremy had a lot to do with it. Google lists threads from this site early in the hit list, because the site has an excellent reputation for useful and quality content; and because the site uses good SEO.
I thank Jeremy for helping this thread become popular. I really have no control other than trying to make the thread useful to people the world over. After that my job is done. And nothing is forever. This thread is not immortal. Nine billion years from now it may very well be space dust. A highly advanced race of multidimensional beings may reassemble linuxquestions.org from random debris drifting through space. They'll say to each other, "The kernel has advanced quite a bit during the last nine billion years."
|
|
|
|
06-05-2010, 11:39 PM
|
#626
|
|
LQ Newbie
Registered: Mar 2007
Posts: 15
Rep:
|
AwesomeMachine,
Congratulations for the mark set. During the time I have been member of this forum, I learned a lot thanks to the help of all those great people which make this forum.
Thanks!
|
|
|
|
06-17-2010, 01:29 PM
|
#627
|
|
LQ Newbie
Registered: Jun 2010
Posts: 6
Rep:
|
Amazing post! Congrats on your latest benchmark!
Quick question: If I do
Code:
dd if=/dev/zero of=/dev/target
Then I can write all 0s to a drive.
But what if I then want to flip every bit on the same drive to a 1?
I'm testing solid state drives and I'm interested in their endurance.
Thanks for your help.
|
|
|
|
06-17-2010, 04:02 PM
|
#628
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
Something like
Code:
while true; do echo -n 1;done | dd of=/dev/target
should do the trick. You may want to experiment with blocksize
to speed things up, e.g.
Code:
dd of=/dev/target bs=2048
Cheers,
Tink
|
|
|
1 members found this post helpful.
|
06-18-2010, 01:20 AM
|
#629
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,517
Rep: 
|
Good morning Tinkster. As I understand it you propose to write "1"s bit-wise. Lots of bits to be produced by "echo". Would be better to ... here is an earlier attempt to come to grips with this  : http://www.linuxquestions.org/questi...v-zero-619626/
HTH the OP.
|
|
|
1 members found this post helpful.
|
06-21-2010, 11:43 PM
|
#630
|
|
Senior Member
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian Testing; OpenSuSE 12.1; Fedora 17
Posts: 1,541
Original Poster
Rep: 
|
Quote:
Originally Posted by jpantano88
Amazing post! Congrats on your latest benchmark!
Quick question: If I do
Code:
dd if=/dev/zero of=/dev/target
Then I can write all 0s to a drive.
But what if I then want to flip every bit on the same drive to a 1?
I'm testing solid state drives and I'm interested in their endurance.
Thanks for your help.
|
Hi jpan,
Welcome to LinuxQuestions.org. This should work for you:
dd if=/dev/zero bs=32k | sed 's/\x00/\xff/g' | dd of=/dev/target
0x100h = 1 0000 0000b - 1b = 0xffh = 1111 1111b = 255d. So, 0xffh is hex notation for bitwise 1111 1111. In the example above, dd reads 32k of zeroes ( 0x00h) from /dev/zero. Sed replaces every 32k of hex zeroes with 32k of hex ff.
This would not work without the \x symbols in the sed perl expression, because without them sed would replace ascii 00 (0x3030h) with ascii ff (0x6666h). Sed would not find ascii 00 in the dd bit stream, so dd would pipe through sed unchanged.
-Awesome
Last edited by AwesomeMachine; 06-21-2010 at 11:46 PM.
|
|
|
|
|
Tags
|
backup, best, clonezilla, cloning, command, data, dd, disk, drive, duplicate, erase, explanation, formatting, ghost, hard, image, iso, memory, ping, popular, recover, recovery, rescue, search, security, stick, upgrade, usb, wipe  |
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:29 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|