Results 1 to 11 of 11
-
02-06-2011, 04:22 AM #1Web Hosting Master
- Join Date
- Apr 2009
- Posts
- 1,321
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?
-
02-06-2011, 05:03 AM #2Web Hosting Master
- 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 -
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.
-
02-06-2011, 05:52 AM #3Web Hosting Master
- 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.
-
02-06-2011, 06:37 AM #4Disabled
- 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/
-
02-06-2011, 08:33 AM #5WHT Addict
- Join Date
- Jan 2007
- Posts
- 158
rsync is best as you can stop/resume if needed.
rsync -azv /home3/folder1/ /home/folder1/
rsync -azv /home3/folder2/ /home/folder2/
-
02-06-2011, 11:30 AM #6Disabled
- Join Date
- Jul 2009
- Posts
- 2,195
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.
-
02-06-2011, 07:26 PM #7Web Hosting Master
- 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?
-
02-07-2011, 03:13 AM #8Disabled
- Join Date
- Jul 2009
- Posts
- 2,195
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.
-
02-07-2011, 05:11 AM #9server automation specialist
- Join Date
- Apr 2009
- Location
- Nevada
- Posts
- 662
James B
►WWW.EZEELOGIN.COM |Setup your Secure Linux SSH Gateway►MEET PCI DSS & ISO 27001 Compliance|Manage & Administer Multiple Linux Servers Quickly & Securely.
-
02-07-2011, 03:10 PM #10Web Hosting Master
- Join Date
- Apr 2009
- Posts
- 1,321
-
02-07-2011, 05:14 PM #11Junior Guru Wannabe
- Join Date
- Mar 2007
- Location
- East Lansing, Michigan
- Posts
- 86
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.-Russell
http://corenetworks.net
Similar Threads
-
$129/mo - Quad Core CPU + 8GB Ram + 1TB Hard Drive + Free reboots + Server hardened
By 314Hosting in forum Dedicated Hosting OffersReplies: 0Last Post: 09-16-2009, 08:11 AM -
How to transfer data from hard drive to hard drive in Linux?
By wifiguru in forum Dedicated ServerReplies: 8Last Post: 03-26-2007, 04:02 PM -
Use 2nd hard drive for database instead of having 1 drive do it all,smart move?
By Roy@ENHOST in forum Hosting Security and TechnologyReplies: 5Last Post: 08-13-2005, 07:12 PM -
Would you buy a 1tb hard drive?
By Criminal#58369 in forum Web Hosting LoungeReplies: 27Last Post: 06-12-2005, 04:15 AM -
How do I move data from one hard drive to another for cpanel/OS reinstall?
By jonmck1234 in forum Hosting Security and TechnologyReplies: 6Last Post: 08-07-2003, 12:44 PM