LinuxQuestions.org
Visit Jeremy's Blog.
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 11-19-2009, 06:48 AM   #1
jonny1517
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Rep: Reputation: 0
DD command output to file


Hi All,

Just been looking round your site for the answer to this question.

I have win XP installed on 5 PCs on CF cards.
I am trying to clone the cards from a card reader to a file on a usb HD.

I have been able to clone the CFs to the HD as an image but not to a file.

I am runing Linux from a CD and using the following :

dd if=/dev/sda1 of=/dev/sdb1

I have tried

dd if=/dev/sda1 of=~/backup.img to send it to my users directory. But this fails, I presume as the directory is no my CD.

Any help would be great.

Thanks

Jon
 
Old 11-19-2009, 07:18 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Try of=/home/<your logon name./backup.img. The shell does not "see" the ~ in that position because it is not at the beginning of a "word". From the GNU Bash Reference: "If a word begins with an unquoted tilde character (~) ...".
 
Old 11-19-2009, 08:19 AM   #3
jonny1517
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Hi,

Thanks for that, Still a bit lost though.

Any help on the command I need to create a image of a filesystem from device a to a file on device b.

Where device a is a cf card, device b is a usb HD and the file name is backup.img

Thanks again

jon
 
Old 11-19-2009, 08:49 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
To write to a file, you have to have the correct pathname and the device has to be mounted.

Example: to write a file named "myfile" to partition #2 of drive #1:

The device is most likely sda2. Let's mount it in /mnt (but could be anywhere you like):

Code:
mkdir /mnt/abc
mount /dev/sda2 /mnt/abc
Now you can write a file to /mnt/abc
 
Old 11-19-2009, 08:55 AM   #5
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,636

Rep: Reputation: 473Reputation: 473Reputation: 473Reputation: 473Reputation: 473
Quote:
Thanks for that, Still a bit lost though.
Any help on the command I need to create a image of a filesystem from device a to a file on device b.

Okay. This help might be what you need for the purpose: right click and save this pdf instructions in working with windows and linux using "dd" command to back up windows files. Also to get the soul of what and how "dd" does for your work read this.

Quote:
Where device a is a cf card, device b is a usb HD and the file name is backup.img
Thanks again
jon

Yes you can do it, so long as you have properly mounted the devices involved in the process.

Hope this helps.
Good luck.

Last edited by malekmustaq; 11-19-2009 at 08:57 AM.
 
Old 11-20-2009, 04:56 PM   #6
jonny1517
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks all for your help. Ill give it a go.

I have been able to do a clone however with PING 3.0

Jon
 
Old 11-21-2009, 10:10 AM   #7
prik420
LQ Newbie
 
Registered: Jun 2008
Posts: 18

Rep: Reputation: 0
it would be of great help if you specify the error message you're getting so others can give you a more clear answer/workaround
 
  


Reply


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
[SOLVED] append command output to file by giving command in terminal sumeet inani Linux - Newbie 4 07-03-2009 10:36 AM
How to send command output to file?! mr_aliagha Linux - General 2 02-27-2009 01:06 PM
Output the result of a command to a file darkarcon2015 Linux - Newbie 1 09-24-2005 06:29 PM
Command line to get output on a file satimis Programming 4 06-24-2005 06:04 AM
Help: Command Output to File. rvijay Linux - Newbie 3 09-30-2003 09:02 AM


All times are GMT -5. The time now is 03:10 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration