Find the answer to your Linux question:
Results 1 to 5 of 5
difference between $cp -a (archieve, so symlink is saved) and $dd if=.... of=.......
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2011
    Posts
    4

    What is the difference between CP and DD


    difference between

    $cp -a (archieve, so symlink is saved)

    and

    $dd if=.... of=....

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,813
    Looking at the man page for each, cp is a tool that 'copies files and directories' and dd is a tool that will 'convert and copy a file'. If you take a read of the man pages for each, you'll get a feel for what each of them can do.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Jul 2011
    Posts
    4
    sorry i should have explained better.

    I'm trying to copy a complete filesystem.
    are there data that can't be copied with $cp -a -r?
    dd can copy entire drive, with $cp you will need to mount origin/destination drives first

    dd will definitely work, e.g.
    $dd if=/dev/sda1 of=/dev/sdb1 (here i copy the first partition on sd hard drive to first partition on flash drive)
    everything will be copied, I'm wondering what the limit of cp is... ...

    one of the reason i'm trying this out, is because... when you use 'dd' to backup a partition, the .iso/.img is hell huge... it's annoying the **** out of me
    (e.g. $dd if=/dev/sda1 of=/home/user/backup.img)

  4. #4
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Quote Originally Posted by Dezo View Post
    one of the reason i'm trying this out, is because... when you use 'dd' to backup a partition, the .iso/.img is hell huge... it's annoying the **** out of me
    (e.g. $dd if=/dev/sda1 of=/home/user/backup.img)
    Hello and welcome!

    If you've not looked at it yet, you might check out fsarchiver:

    FSArchiver

    I've used it hundreds of times without issue, and it gives a nice compressed archive that should be smaller than those produced by using dd.
    oz

  5. #5
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Just wanted to quickly add that the easiest way to use this is by booting a liveCD, or liveUSB device. I currently run it by booting the Parted Magic LiveCD, but it is available in a liveUSB format, too.
    oz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •