LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Copying files from internal Hard drive to USB 2.0 Hard Drive is NOT Behaving (http://www.linuxquestions.org/questions/ubuntu-63/copying-files-from-internal-hard-drive-to-usb-2-0-hard-drive-is-not-behaving-530191/)

tubatodd 02-18-2007 03:19 PM

Copying files from internal Hard drive to USB 2.0 Hard Drive is NOT Behaving
 
I'm not sure what is going on. I copied my "music" folder (it houses my music collection....imagine that) to my USB Hard drive last week by using Nautilus and play ole "click and drag.". The process went without a hitch. Today, I decided I would copy the same folder over to the USB hard drive, so that I can have a more up-to-date backup on my USB drive. I was greeted with a message that said it would have to overwrite the folder. Since that is what I wanted to do, I click on "overwrite". Nautilus proceeds to update my folder (4500 or so files). Somewhere around 300th file the copy dialog closes without an error message. I go to check and see if the folder is fully updated. The music folder is there, but it isn't updated. After several more failed attempts, I simply deleted the music folder from the USB drive and dragged the source folder from my internal hard drive. It was time consuming, but.....It worked!

I guess my question is, how should I save an updated version of the music folder on my USB drive? Is there a USB syncing program that you would recommend?

**EDIT**
BTW, I checked the read/write permissions and every user had full read/write/execute access.

fukawi2 02-19-2007 12:51 AM

I've had similar problems with USB hard drives before - I think it was a kernel error. Open terminal after the copy dies, and run this:
Code:

dmesg | tail
A MUCH quicker method, which is what I use to reguarly backup my 30 - 40gb home folder to USB hard drive is 'rsync'. My backup's take less than a minute generally :)

'rsync' only transfers new and changed files. I just do it from the terminal:
Code:

rsync -av --delete-after /path/to/folder /mnt/usb-harddrive
The '-av' flag tells rsync to transfer the files (a) and list all the files as it goes (v). The '--delete-after' flag tells it to delete any files that are on the USB drive, but no longer on the hard drive.

kodalisrikanth 02-19-2007 01:48 AM

I think u r USB have some fragments....;First check for that by
Quote:

dmesg | tail
it is better if u post the output of that then it is very easy to identify the problem...

Then mount the USB drive by doing
Quote:

mount /path/of/source /path/of/destination
If u have the fragnments then perform defragmentation by doing
Quote:

fsck /path/to/ur/mountpoint
then it shows no.of nodes in that thumbdrive and no.of available nodes.The helth of the disk is estimated by the no.of nodes.If the nodes are equal to the available nodes then there is no fragments.If not there is a chance of fragmentation.

Then it asks the permission to defragment the drive.u just press 'y'.mail me if u have any problems regarding this session.

tubatodd 02-19-2007 10:35 AM

Thank you for your help. I will try the rsync command as that is truly what I want my machine to do. Thanks! :)

*** EDIT ***

I decided to make a shell script I called "usb_backup.sh" Here it is...
Code:

#!/bin/bash
#
# This little script will backup my "home" folder to my USB Hard drive
rsync -av --delete-after /home/tubatodd/ /media/Aluratek/

I created a launcher in Gnome for it. So, at anytime I can backup my home folder with a click. Thanks again for your help!!!

fukawi2 02-19-2007 05:32 PM

Nice :)

Now you can make it automatically mount and unmount the USB drive, redirect the output to a log file, e-mail errors to you and then schedule it :P

Glad that's useful to you,
~p


All times are GMT -5. The time now is 03:05 AM.