LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 04-11-2012, 09:01 AM   #736
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member response


Hi,

Quote:
excerpt from 'man dd';
of=FILE
write to FILE instead of stdout
So;
Code:
dd if=/dev/sda5  of=/media/discoduroexterno/imagenes/partitionimage.dd
Plus you can look earlier in this thread for examples. Or look further down and see the suggested threads.
 
1 members found this post helpful.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-11-2012, 10:28 AM   #737
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by JZL240I-U View Post
The standard output shows only printed characters and not the full range of hexadecimal values, ...
Where on Earth did you get an idea like that? In the absence of an "of=" argument, dd writes exactly the same data to stdout as would have gone to the "of=" file. Yes, if that output goes to a terminal you will see garbage, but redirecting to a file should be fine.

@RagonichaFulva: Does that 47GB size of the image file match the size of the original sda5 partition? That "bad geometry" message suggests that the original file system was 285GB. Was the original filesystem type really ext4? What does the file command report as the type of the partitionimage.dd file, i.e., the output from
Code:
file partitionimage.dd
 
2 members found this post helpful.
Old 04-11-2012, 10:33 AM   #738
RagonichaFulva
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Rep: Reputation: Disabled
I can't assure it, but I'd say that the partition was bigger than 47 GBytes.

I'll check the file command and paste the output.

Thanks for your assistance.
 
1 members found this post helpful.
Old 04-11-2012, 12:46 PM   #739
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by RagonichaFulva View Post
I can't assure it, but I'd say that the partition was bigger than 47 GBytes.
That would be most unfortunate. The image file should be exactly the same size as the original partition. If that was really an ext4 file system, it would also be useful to see the output from
Code:
tune2fs -l partitionimage.dd
 
1 members found this post helpful.
Old 04-12-2012, 02:15 AM   #740
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
Where on Earth did you get an idea like that? In the absence of an "of=" argument, dd writes exactly the same data to stdout as would have gone to the "of=" file. Yes, if that output goes to a terminal you will see garbage, but redirecting to a file should be fine...
Simple. When you write it to stdout, the driver for your graphic card will interpret it to display it on your screen. So you lose in due course lots of data / information. That is at least what I reasoned. Do I understand you all right that stdout can circumvent the graphics driver?
 
1 members found this post helpful.
Old 04-12-2012, 05:35 AM   #741
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by JZL240I-U View Post
Simple. When you write it to stdout, the driver for your graphic card will interpret it to display it on your screen. So you lose in due course lots of data / information. That is at least what I reasoned. Do I understand you all right that stdout can circumvent the graphics driver?
There is no circumvention needed. Data written to stdout is, if not redirected, "translated" by the shell into characters and control codes (like color codes, the beep, ...) and then displayed. The graphics card drivers will not interpret characters displayed on screen.
 
2 members found this post helpful.
Old 04-12-2012, 05:39 AM   #742
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
...Data written to stdout is, if not redirected, "translated" by the shell into characters and control codes (like color codes, the beep...
Okay, so it is not the graphics driver but the shell which does the pruning -- or does it? I mean, is there a difference in the files when created via ">" as opposed to "of="?
 
1 members found this post helpful.
Old 04-12-2012, 06:23 AM   #743
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by JZL240I-U View Post
I mean, is there a difference in the files when created via ">" as opposed to "of="?
No, when stdout is redirected the shell does not interpret it.
 
1 members found this post helpful.
Old 04-16-2012, 06:36 AM   #744
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
I confess I doubted you but you stand vindicated : I "dd"ed my 125 MB boot partition with ">" and "of=" and then ran sha256sum on both files: They are identical. Ah, well, it was a nice theory of mine as long as it lasted. Kudos to all participants involved in relieving the darkness of my ignorance and thanks for the ongoing instructions on LQ.
 
2 members found this post helpful.
Old 04-16-2012, 08:25 AM   #745
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Hey, we all are learning. It is good to see that you take a reasonable route to get rid of your doubts. Some members could learn from that.
 
Old 04-17-2012, 09:53 AM   #746
greasedupdeafguy
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
Hi, can someone help me explain this command in detail?

dd if=/dev/hda of=/mnt/diska/cd-001.dd

I am having a hard time explaining the of= part.

Thx
 
Old 04-17-2012, 09:57 AM   #747
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Code:
man dd
. Umm, sorry. "of=" stands for the output file = (is, or rather will be) the following path (/mnt/diska/) and filename (cd-001.dd)...

Last edited by JZL240I-U; 04-17-2012 at 10:05 AM.
 
Old 04-17-2012, 10:18 AM   #748
greasedupdeafguy
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
Quote:
Originally Posted by JZL240I-U View Post
Code:
man dd
. Umm, sorry. "of=" stands for the output file = (is, or rather will be) the following path (/mnt/diska/) and filename (cd-001.dd)...
thx, so if I would say that this command creates a duplicate of the (hda) and then places it at /mnt/diska/ with the filename cd-001.dd I would be right? My first thought was that this created a dd file on the mounted cd-rom but thats totally wrong?
 
Old 04-17-2012, 10:23 AM   #749
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Quote:
of=/mnt/diska/cd-001.dd
cd-001.dd would be the filename you're giving in /mnt/diska directory which you've mounted under /mnt/ where you want to save the data of /dev/hda.
Am I right? Please make me correct if I'm wrong.
 
Old 04-17-2012, 11:23 AM   #750
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by greasedupdeafguy View Post
thx, so if I would say that this command creates a duplicate of the (hda) and then places it at /mnt/diska/ with the filename cd-001.dd I would be right?
Yes it duplicates all, including the internal structures of the disk (master boot record, partition table, all partitions including empty space (if so ordered)).

Quote:
Originally Posted by greasedupdeafguy View Post
My first thought was that this created a dd file on the mounted cd-rom but thats totally wrong?
Yes. It does not burn a CD (but it could write to a CD-RW).

Last edited by JZL240I-U; 04-23-2012 at 08:51 AM.
 
  


Reply

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



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Learn The DD command AwesomeMachine Linux - Newbie 17 08-17-2006 04:22 AM
The best way to learn? iz3r Programming 7 02-06-2005 11:00 PM
Best way to learn Linux from the command line patpawlowski Linux - General 2 03-01-2004 03:37 PM
I want to learn C. KptnKrill Programming 14 12-18-2003 01:03 PM
Best way to learn.... InEeDhElPlInUx Linux - Newbie 5 10-11-2003 01:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration