LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Options to write to USB disk immediately (https://www.linuxquestions.org/questions/linux-hardware-18/options-to-write-to-usb-disk-immediately-4175530045/)

tonyfreeman 01-04-2015 08:37 PM

Options to write to USB disk immediately
 
I have a 64G usb disk with ext4 file system that I write large files to every day. udev mounts the usb drive when I plug it in. I then use Nautilus to copy or move files onto the disk. The popup progress bar runs and goes away when the copy/move is done ... however ... the files are not really completely on the disk when the popup closes.

I'd like to configure things so that when the popup progress bar closes, I can be sure the files are on disk ready for me to eject the device (i.e. I don't want to have to type 'sync' and have to wait again and especially I don't want extra waiting for further writes to be done if I click on the eject button in nautilus).

I've been playing with tune2fs but was just wondering if there are kernel parameters to set as well.

I'd really like the file to write to the disk immediately and completely ... so was just wondering if there is a recipe for what I'm looking for?

veerain 01-04-2015 11:27 PM

You should mount the filesystem in USB Drive with sync option.

Code:

mount -t yourfs -o noatime,sync /dev/sdx1 /mnt/usb


All times are GMT -5. The time now is 09:32 AM.