Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a problem regarding copying of files using Ubuntu's copy feature. The problems goes on like this:

I copy a specific folder to my ZIP drive by creating a new folder each day (Backup). Now copy process starts and completes. No when I disconnect the drive from the system and re-plug, I find that all those files are now lost. Only the folder which I created manually, exists.

Also, if I use the terminal to copy and create the directories, windows XP detects a corrupt file system in the drive and I again have to scan and fix the drive. The files, though are recovered, still I am thinking why this is happening. Might be due to the different way these OSes create and maintain the table.

FAT32 is the file system in the ZIP (4 GB) drive. On XP (SP3) system it is NTFS and on Ubuntu (10.04) it is ext3.

There are however no other problems while copying data from the drive. Even copying a single file to the drive works fine. Only copying inside a folder gives the problem. Also, once copy attempt is done, nothing further can be added to the folder. It gives error that the folder is not accessible or so.

What could be the problem? Any workaround?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You seem to forget to unmount the pen drive before unplugging. The data is being written at hte time when you're physically detaching the drive; this results in a corruption.

In Nautilus, locate the drive in the left panel, click the eject button near its name. Alternatively, find it on the desktop, right-click, choose 'Eject'.

This is the same thing as 'Safe unplugging' in Windows.

share|improve this answer
    
Thanks for the response. I wonder, this never happens in Windows XP! –  venomrld Sep 24 '11 at 7:19
1  
On windows the buffer is smaller for removable media, so when it stops copying, the date is there. –  Michał Šrajer Sep 24 '11 at 8:20
    
Thanks.. got it now. –  venomrld Sep 24 '11 at 8:46
    
@venomrld Windows has special rules for removable devices, Linux doesn't. Windows's behavior is designed so that pulling the pendrive out suddenly will often not cause trouble, but it's not such a good idea because it doesn't always work, it's slower, and it wears the drive out prematurely. See Should I unmount a USB drive before unplugging it? –  Gilles Sep 24 '11 at 21:22
    
If you're familiar with tweaking /etc/fstab you could add the sync mount option which will cause Linux to actually block copying operations synchronously until all the data has been written. See man mount for details. –  Axel Knauf Sep 25 '11 at 13:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.