LinuxQuestions.org
Register a domain and help support LQ
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: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,270
Blog Entries: 3

Rep: Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445
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.
Old 04-11-2012, 10:28 AM   #737
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,495

Rep: Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621
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: CentOS
Posts: 1,495

Rep: Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621Reputation: 621
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 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,674

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: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
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 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,674

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: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
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 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,674

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: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
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 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,674

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: Dehradun, Uttarakhand, India
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,413

Rep: Reputation: 303Reputation: 303Reputation: 303Reputation: 303
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 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,674

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 03:36 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration