copying files from one external USB hard drive to another
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
copying files from one external USB hard drive to another
I have two USB 2 external hard drives. I want to copy about
30 gigs of data from one to another. What command line command
do I use ? I was thinking of using cp with the -R and -n options,
but I have no idea what devices to refer to. I can't find
any external hard drives in /etc/fstab and I'm not sure what
/dev device each USB external hard drive uses.
I just want to copy the files and the directories that they are
in just as they are. There are no links and I do not want
to do a backup. Any suggestions would be welcome.
Click here to see the post LQ members have rated as the most helpful post in this thread.
My old favourite is rsync, the drives are probably mounted under /media.
Example:
Quote:
rsync -av /media/<disk1>/ /media/<disk2>/
Note that the trailing slash on the source is important, it indicates that you want the content of the last directory in the path, if you leave the slash off you'll get the directory as well
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731
Rep:
rsync is not the fastest from my experience. For first time copy i mostly use cp command, which is much more faster, later for synchronization i use rsync.
copying files from one external USB hard drive to another
When I do the mount command I get:
/dev/sdd1 on /media/Expansion Drive type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sdb1 on /media/Expansion Drive type fuseblk
(rw,nosuid,nodev,allow_other,blksize=4096)
I can't see any reference to these external hard
drives in /etc/fstab
The directory /media has two identical /media/External Drive
I can't see any easy way to identify one of these external drives
from the other under /media
The system is my old basement computer running Fedora 10
kernel 2.6.27 i686 Gnome 2.24.3 /01/16/2009 USB 2
I keep it off the internet and run my important stuff on it.
^ seems weird that it seems to be mounting both drives in the same directory.
not really sure what you are doing but it mite be easier to do this by hand.
Code:
sudo umount /dev/sdb1 /dev/sdd1
mkdir hd1 hd2
sudo mount /dev/sdb1 hd1
sudo mount /dev/sdd1 hd2
then navigate thru those directories to find out which one is which (since they are your drives, only you know what data is in each).
they wouldnt be in /etc/fstab unless you put them in there because you want them mounted every time you start your machine.
did you mean to say one is mounted on /media/Expansion Drive and the other is mounted on /media/External Drive ?; keep in mind that copy-and-paste is the easiest way for us to understand what is going on. (your descriptions are helpful but a screenprint would paint 1,000 words).
If you can't tell the difference between the drives then it's probably better to label them. Remove both then plug in one and see which drive it is, if it mounts automatically then unmount it. If its an ext based filesystem use e2label, then remove it, plug in the next drive and repeat.
Then with both plugged in you should have /media/<drive1label> and /media/<drive2label>
When a USB drive is plugged in it will be automatically mounted (if so configured) to /media/disk_label or /media/disk-x if no label. No fstab line is required. So it seems that if the drives have the same label then they will be mounted at the same mount point.
You can try changing one of the drives labels or as suggested manually mount them. If manually mounted you can create a directory with a unique name. Then you will easily know which drive is the source and which is the destination.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.