How do copy certain files and directories from one hard drive to another?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How do copy certain files and directories from one hard drive to another?
# 1  
Old 02-09-2006
How to copy certain files and directories from one hard drive to another?

I have two drives (scsi) mounted on one server and I need to copy certain files and directories from one drive to the other. Any suggestions Smilie

Last edited by shorty; 02-09-2006 at 01:04 PM..
# 2  
Old 02-09-2006
Mounted as in filesystems created and correctly mounted onto mounpoints?

Then man cp.

If you want to copy entire trees you can use cp -R, tar, cpio, etc

Cheers
ZB
# 3  
Old 02-10-2006
Mount the filesystems for all on the old harddrive?

mount /dev/dsk/c2t2d0s0 /mnt
mount /dev/dsk/c2t2d0s1 /mnt ......and so on?

And "mounted onto mounpoints". How do you do that?
# 4  
Old 02-11-2006
It still depends on your exact requirements. Say you have mounted the first slice of the old disk thusly:

mount /dev/dsk/c2t2d0s0 /mnt

And you want to copy everything off it to /foo

then...

cd /mnt
tar cf - ./ | ( cd /foo; tar xf - )

There are further options you can add to tar for preserving ownership and permissions, etc

Cheers
ZB
# 5  
Old 02-11-2006
Quote:
Originally Posted by zazzybob
It still depends on your exact requirements. Say you have mounted the first slice of the old disk thusly:

mount /dev/dsk/c2t2d0s0 /mnt

And you want to copy everything off it to /foo

then...

cd /mnt
tar cf - ./ | ( cd /foo; tar xf - )

There are further options you can add to tar for preserving ownership and permissions, etc

Cheers
ZB
Since this is Solaris I prefer the following to what ZB posted as it does not suffer from the same patch length restrictions are the tar command above:
Code:
cd /mnt
find . -depth | cpio -pmd /foo

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to make an exact image copy of a SCSI hard drive in Solaris 8 OS?

To Solaris 8 Experts, Please let me know what's the best method / procedure as well as the Solaris 8 commands for accomplishing the following tasks on a production Sun Enterprise 250 Server running Sun Solaris 8 Operating System: 1. Make an exact image/copy of the SCSI Hard Drive in the... (3 Replies)
Discussion started by: ssabet
3 Replies

2. Shell Programming and Scripting

I want to copy all files of a said type on my external hard drive

My code is this, what I'm trying to accomplish is to make a list of all pdf documents in my computer and then copy all of those documents to my external hard drive in a directory mkdir /Volumes/Hardrive-1/allpdf echo "File Locations" > /Volumes/Hardrive-1/allpdf/FileLocations.txt mdfind pdf... (2 Replies)
Discussion started by: darpness
2 Replies

3. UNIX for Dummies Questions & Answers

Copy files from one drive to another, keeping most recently modified files

Hi all, I am a bit of a beginner with shell scripting.. What I want to do is merge two drives, for example moving all data from X to Y. If a file in X doesn't exist in Y, it will be moved there. If a file in X also exists in Y, the most recently modified file will be moved to (or kept) in... (5 Replies)
Discussion started by: apocolapse
5 Replies

4. UNIX for Dummies Questions & Answers

Copy everything from remote Linux to external hard drive in windows

Hi, I`m trying to copy an entire directory(with numerous files, folders and subfolders etc, a content size of 500gigs) from a linux machine running Red Hat Enterprise Linux 6 to an external hard drive on my windows. I downloaded and installed psftp on my windows and I can login using psftp... (9 Replies)
Discussion started by: newbie83
9 Replies

5. Solaris

Hard Drive Copy results in differences on boot

I have an old Pentium 4 PC running Solaris 9. The system has two 40gig IDE hard drives. I removed the drives and, using a hard disk duplicating device, "cloned" both drives. I installed the new drives in the PC. The system boots but I get a message that X-Term will not run on the console. If I... (4 Replies)
Discussion started by: ddogarmyman
4 Replies

6. Shell Programming and Scripting

help transferring tar files from cdrom to hard drive

alright guys, this is a pretty noob question but I need a script that will take a tarred folder "Animals" from cd and copy and extract it to replace an existing folder on hard drive called "Animals". (to give us more variations for another program which we don't need to worry about here), take the... (1 Reply)
Discussion started by: hootdocta5
1 Replies

7. UNIX for Dummies Questions & Answers

How to transfer files from UNIX to my own Hard drive storage?

I will leave the University I am working, but I need to backup and transfer my research data from UNIX system in our department to my own 750G Hard Drive Storage. But I am not familiar with UNIX. How to do this? Thank you. (5 Replies)
Discussion started by: fishwater00
5 Replies

8. Filesystems, Disks and Memory

The best partitioning schem for a 250GB Sata hard drive & a 75GB SCSI hard drive

Hi I have 2 75GB SCSI hard drives and 2 250GB SATA hard drives which are using RAID Level 1 respectively. I wana have both FTP and Apache installed on them as services. I'm wondering what's the best partitioning schem? I wana use FC3 as my OS, so, I thought I can use the 75GB hard drive as the /... (0 Replies)
Discussion started by: sirbijan
0 Replies

9. UNIX for Dummies Questions & Answers

Trying to copy old hard drive to new hard drive.

:confused: ........I have a new hard drive and I need to copy ALL info from the old to the new. I would like to use the dd command. I know the command is as follows...... dd if=/dev/rdsk/c1t1d0s0 of=/dev/rdsk/???????? Where I have the question marks is the problem. How do I find out what the... (4 Replies)
Discussion started by: shorty
4 Replies

10. UNIX for Dummies Questions & Answers

listing directories of an external hard drive

How do I do it? I have a mac and a pc and am having a time cd-ing to the external drive. (2 Replies)
Discussion started by: theGooch
2 Replies
Login or Register to Ask a Question