Results 1 to 11 of 11
  1. #1
    Join Date
    Apr 2009
    Posts
    1,321

    Question Need to move 1TB data to another hard drive on same server

    I need to move these folders from old hard drive to new hard drive while keeping same file permission and ownerships.

    /home3/folder1 --> /home/folder1
    /home3/folder2 --> /home/folder1

    What is the correct command to do this?

  2. #2
    Join Date
    Mar 2009
    Location
    Austin, TX
    Posts
    935
    Code:
    cd /home; tar cBplfz - -C /home3 folder1 |tar xBplfz -
    Code:
    cd /home/folder1; tar cBplfz - -C /home3/folder2 . |tar xBplfz -
    Above is one way. Just checking and make sure you are not making typos... you want both old folder to be copied into the same folder /home/folder1 right?
    SysAdmin.xyz
    Having severs with customer data on it without proper monitoring is like having one night stand without using protections - eventually, there will be an 'oh s**t!' moment.

  3. #3
    Join Date
    Apr 2009
    Posts
    1,321
    Actually is a typo should be folder2 --> folder2

    I don't think can tar this since there is 1TB of data.

  4. #4
    Join Date
    Jan 2011
    Location
    India
    Posts
    13
    If you need to copy use the following
    -------------------------------------
    cp -pr /home3/folder1/ /home/
    cp -pr /home3/folder1/ /home/

    If you need to move use the following
    -------------------------------------
    mv /home3/folder1/ /home/
    mv /home3/folder1/ /home/

  5. #5
    rsync is best as you can stop/resume if needed.

    rsync -azv /home3/folder1/ /home/folder1/
    rsync -azv /home3/folder2/ /home/folder2/

  6. #6
    If you do use rsync, you may or may not want to use the -z flag for compression. Compression is mostly useful when moving data across a network, but it may not be worth it if you're copying within the same machine, since it does take some cpu to compress the data.

  7. #7
    Join Date
    Apr 2009
    Posts
    1,321
    I already started using the cp command, the folder has 800GB of data, I should've used rsync instead. But I don't see the need to stop/resume, even if I get disconnected to the server in SSH, the files are still being copied right?

  8. #8
    If you get disconnected the command will stop, unless you run it with nohup.

    You can always start using rsync now, it will pick up after what you've already copied with cp.

    If you want to run it in the background -

    nohup rsync -av sourcefolder destinationfolder &

    Don't forget the & at the end.

  9. #9
    Join Date
    Apr 2009
    Location
    Nevada
    Posts
    662
    You should have executed the cp command in screen so that the copy would have continued even if you had got disconnected.

    Quote Originally Posted by chasebug View Post
    I already started using the cp command, the folder has 800GB of data, I should've used rsync instead. But I don't see the need to stop/resume, even if I get disconnected to the server in SSH, the files are still being copied right?
    James B
    WWW.EZEELOGIN.COM |Setup your Secure Linux SSH GatewayMEET PCI DSS & ISO 27001 Compliance|Manage & Administer Multiple Linux Servers Quickly & Securely.

  10. #10
    Join Date
    Apr 2009
    Posts
    1,321
    Quote Originally Posted by BarackObama View Post
    You should have executed the cp command in screen so that the copy would have continued even if you had got disconnected.
    Can you explain what is running the command in screen?

    I have already finished moving everything but would like to know that for future reference.

    Thanks!

  11. #11
    Join Date
    Mar 2007
    Location
    East Lansing, Michigan
    Posts
    86
    Quote Originally Posted by chasebug View Post
    Can you explain what is running the command in screen?
    http://en.wikipedia.org/wiki/GNU_Screen

    Very handy if you're doing something on a remote system that you think you might get disconnected from, and want to get right back to where you left off. Also good for multitasking from a single session.

Similar Threads

  1. Replies: 0
    Last Post: 09-16-2009, 08:11 AM
  2. How to transfer data from hard drive to hard drive in Linux?
    By wifiguru in forum Dedicated Server
    Replies: 8
    Last Post: 03-26-2007, 04:02 PM
  3. Use 2nd hard drive for database instead of having 1 drive do it all,smart move?
    By Roy@ENHOST in forum Hosting Security and Technology
    Replies: 5
    Last Post: 08-13-2005, 07:12 PM
  4. Would you buy a 1tb hard drive?
    By Criminal#58369 in forum Web Hosting Lounge
    Replies: 27
    Last Post: 06-12-2005, 04:15 AM
  5. How do I move data from one hard drive to another for cpanel/OS reinstall?
    By jonmck1234 in forum Hosting Security and Technology
    Replies: 6
    Last Post: 08-07-2003, 12:44 PM

Posting Permissions

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