LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-14-2016, 09:10 PM   #1
zvivered
Member
 
Registered: Sep 2007
Posts: 215

Rep: Reputation: 23
copying part of disk with "dd"


Hello,

Is it possible to copy a specified directory in a mounted disk using "dd" ?
According to what I tried the if parameter can only be: /dev/....
so dd can be used to copy a complete disk(or partition).
Am I right ?

Thank you,
Z.V
 
Old 10-14-2016, 09:14 PM   #2
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,317

Rep: Reputation: Disabled
I have cut files into pieces with dd.
 
Old 10-14-2016, 10:14 PM   #3
robertdaleweir
Member
 
Registered: Jul 2006
Location: Canada
Distribution: Fedora
Posts: 93

Rep: Reputation: 11
Quote:
Originally Posted by zvivered View Post
Hello,

Is it possible to copy a specified directory in a mounted disk using "dd" ?
According to what I tried the if parameter can only be: /dev/....
so dd can be used to copy a complete disk(or partition).
Am I right ?

Thank you,
Z.V
Hi zvivered
What you ask is can 'dd' be used to 'copy' a specified directory in a mounted disk? It is not designed for that process unless the directory is the only thing on the Mount Point. If it is the only item then one can use 'dd' to copy the entire partition, hence making a 'bit by bit' copy of that Partition. If you want to make a copy of a specific directory and all of its contents you should use 'rsync' or 'tar'. These are Filesystem functions which work with files and directories. The 'dd' command is a 'bit by bit' Low Level copy routine more geared to making copies of Disks, Partitions and Images of Filesystems, such as ISOs, etc.
Quote:
According to what I tried the if parameter can only be: /dev/....
this is not true. I frequently use 'dd' to copy/burn an ISO to a USB Stick.
Code:
 dd if=/somedir/some.iso of=/dev/sdc
Essentially 'dd' is used to copy one or more Filesystems. The other apps such as 'tar' and 'rsync' are used to move parts of filesystems such as Directories and/or Files.
And in answer to your last question 'yes'.
 
1 members found this post helpful.
Old 10-14-2016, 10:38 PM   #4
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 417

Rep: Reputation: 74
That is quite close to brain surgery in my opinion.

Last edited by c0wb0y; 10-15-2016 at 12:56 AM.
 
Old 10-15-2016, 03:00 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,163

Rep: Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181
dd can be used for a number of things. dd can copy an entire or part of a disk.

There are many web pages dedicated to this powerful command. When I say powerful I also mean somewhat dangerous. It will do exactly what you tell it to do. No "are you sure" "might be bad" warnings.

https://linuxconfig.org/learning-linux-commands-dd

The above link is very useful to keep bookmarked.

Last edited by jefro; 10-15-2016 at 03:03 PM.
 
Old 10-16-2016, 06:15 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,305
Blog Entries: 9

Rep: Reputation: 4391Reputation: 4391Reputation: 4391Reputation: 4391Reputation: 4391Reputation: 4391Reputation: 4391Reputation: 4391Reputation: 4391Reputation: 4391Reputation: 4391
Q: can i use an axe to cut a tomato?
A: yes, you can.

...why not just use cp?
also, read 'man dd', it can do a lot of stuff.
 
Old 10-23-2016, 12:38 PM   #7
prowas
LQ Newbie
 
Registered: Oct 2016
Posts: 25

Rep: Reputation: Disabled
http://www.linuxquestions.org/questi...me-4175591867/ -- help me
 
Old 10-23-2016, 12:44 PM   #8
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,317

Rep: Reputation: Disabled
Quote:
Originally Posted by prowas View Post
Is this a command, Your Majesty?
 
1 members found this post helpful.
Old 10-26-2016, 01:22 PM   #9
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,920
Blog Entries: 13

Rep: Reputation: 4045Reputation: 4045Reputation: 4045Reputation: 4045Reputation: 4045Reputation: 4045Reputation: 4045Reputation: 4045Reputation: 4045Reputation: 4045Reputation: 4045
Firstly, welcome to LQ.
Quote:
Originally Posted by prowas View Post
Please do not post something as minimal as this. You posted a link to another of your question threads with one word citing "help", that is unhelpful and has zero explanation. Recommend you do not open parallel threads, however it appears you did not, they are however related.

A more proper thing to do here might be to post the link to that thread, accompanied with an explanation that you have a secondary question which you'd also like help with.

Meanwhile what is your status here? Solved, or not. If solved, please use Thread Tools and mark this thread as solved.

If not solved, then please tell us where you are stuck. Please note that using dd, if= represents the "input file", therefore you can use "a file" or "a directory" which is also a file. For instance if you have /home/me/my_files where my_files is a directory, you can do "sudo dd if=/home/me/my_files" as your input file, and then you need to specify an output file, using the of= argument.
 
  


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] "SDA must have a GPT disk label" error while installing RHEL6 - "IBM x3650 M3" Server garbagegigo@gmail.com Linux - Server 13 06-21-2017 07:03 PM
A Win8 "slave" disk is using "UEFI secure boot" - How to copy data from it with Linux ghost123uk Linux - Software 8 08-15-2015 06:28 AM
Kali linux froze at "copying data to disk" kalicode10 Linux - Newbie 2 02-12-2015 03:07 PM
Samba "Disk Full" when copying from Windows mihaj Linux - Server 4 10-20-2008 02:08 AM
k3b: To choose "normal" or "clone" copying grautu Linux - Software 1 01-09-2006 06:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:57 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