LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-18-2008, 04:47 AM   #1
make
Member
 
Registered: Apr 2004
Distribution: Mandriva, Ubuntu, openSuSE, FreeBSD, OpenSolaris, PC-BSD
Posts: 195

Rep: Reputation: 30
How to always mount removable devices with "noatime"?


I've noticed mounting USB-drives and USB-sticks with "noatime" boosts writing big files to them even by 50-80 % (measured with clock). I am very familiar with udev rules, too.

What I want to do, is not to create an udev rule for any specific drive or stick (I know how to do this), but to cause the Linux kernel to ALWAYS mount ANY USB or FireWire drive with certain options, in this case "noatime".

This includes automatic (KDE, GNOME, etc.) and also manual mounting - I tend to forget to specify "-o noatime" when I issue the "mount" command and while I can of course "mount -o remount,noatime" while it's copying, it tends to freeze and in the end I either have to abort the copying operation or wait for ages. One way coming to my mind is aliasing "mount" with "mount -o noatime", but I fear this might cause issues in the system. I also prefer to use autofs only for network drives (NFS).

Where could I specify "noatime" as the default option for all removable devices?
 
Old 11-18-2008, 11:32 PM   #2
jazzor
Member
 
Registered: Apr 2007
Posts: 41

Rep: Reputation: 16
For gnome, theres a couple of options: in gconf-editor /system/storage/default_options, you can add filesystems and put the noatime option onto every one of those (you really only need ntfs, vfat, ext*).

Gnome uses gnome-mount to do its actual mounting. Hacking the source to include noatime into the mount flags is very easy too, but slightly more advanced.

If you want to be even more advanced, you can hack the kernel. The relevant file is fs/namespace.c around line 1927, you can change that to allow noatime permanently for all calls to mount. This option might seem radical, but Ive been using this since 2.20 kernels with no issues whatsoever.

As for KDE, I am not too sure. I believe kde 3.5 uses HAL, but KDE4 dont know.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is noatime? How can I mount a partition with noatime? abefroman Linux - Software 6 03-17-2012 03:26 PM
LXer: Using external file devices in Linux: Climbing the "mount" command LXer Syndicated Linux News 0 04-02-2007 12:16 AM
"fc5" mount does not recognize "smbfs" file system? bdplays Linux - Networking 6 06-28-2006 11:21 AM
Common problems explained: "kernel panic - not syncing", "unable to mount..." sundialsvcs Linux - Newbie 2 03-01-2006 12:17 PM
Do not have "Wireless Connection" listed in "Devices" Jason267 Linux - Newbie 8 07-24-2002 10:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration