Problem in copying data to 2nd Hard Disk

Discussion in 'Site & Server Administration' started by muhabbatain, Dec 6, 2008.

  1. #1
    I want to copy data from main hard disk to 2nd hard disk in CentOS. But whenever i run copy command the whole data actually moved rather than copying. Its about 230GB of data in public_html/folder1 .. can anyone help me in copying folder from SDA1 to SDB1?

    Thanks
     
    muhabbatain, Dec 6, 2008 IP
  2. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #2
    you can use cp command:

    cp -r path/to/copy/ destination/folder

    Or you can use rsync command to copy the data to another drive:

    rsync path/to/copy/ destination/folder

    Kailash
     
    kailash, Dec 6, 2008 IP
  3. milesbparty

    milesbparty Peon

    Messages:
    148
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    My favorite way to copy an entire directory structure in UNIX/Linux is:

    cd [source]
    find . | cpio -dumpv [destination]

    This will recursively copy the directory structure of the current directory, while keeping ownership and permissions in tact.
     
    milesbparty, Dec 6, 2008 IP
  4. jphilipson

    jphilipson Peon

    Messages:
    167
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can also save ownerships and permissions with rsync..

    rsync -vrplogDtH /path/to/copy/ /path/to/copy/to
     
    jphilipson, Dec 7, 2008 IP
  5. Garcia

    Garcia Member

    Messages:
    524
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    33
    #5
    what is Cent OS ?
     
    Garcia, Dec 7, 2008 IP
  6. milesbparty

    milesbparty Peon

    Messages:
    148
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    milesbparty, Dec 7, 2008 IP
  7. muhabbatain

    muhabbatain Active Member

    Messages:
    195
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #7
    Thanks all for the help let me try these ways out ..
     
    muhabbatain, Dec 8, 2008 IP