Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I know EXT4 is the fastest by 3y already checking test blog posts from different authors But theres also other settings that make SSD faster i found in http://www.howtogeek.com/62761/how-to-tweak-your-ssd-in-ubuntu-for-better-performance/

sudo gedit /etc/fstab
add to / partition <options> noatime,nodiratime,
and also if kernel is >2.6.33 also add discard,
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

AND https://wiki.ubuntu.com/MagicFab/SSDchecklist

sudo gedit /etc/fstab
add to / partition <options> noatime, and thats it
and data=writeback mounting option if you formatted the disk without journaling. Otherwise add data=ordered which sould be a good compromise between full journaling and none at all.
tmpfs   /tmp  tmpfs  nodev,nosuid,noexec,mode=1777  0 0

why only noatime? And how to know if disk is without journaling from installation? And whats faster? No Jornaling or opposite? And diff no journaling data=writeback or journaled data=ordered?

And why tmpfs /tmp differs in both arcticles and how they dffer and witch is better and why?

All of this is about SSD but can i use same settings in HDD? I want to find answer for HDD and SSD as ive made one time scripts for setting it up in my https://wiki.ubuntu.com/Kangarooo/AfterCleanInstallation

share|improve this question

4 Answers 4

up vote 9 down vote accepted

The howtogeek site is the more responsible of the two sites you mentioned. The atime tweaks are just metadata optimization that pipeline when a file will receive a certain timestamp update. It's applicable regardless of the media you use, it also depends on how sensitive your application is to the coherency of that metadata. Most desktop users won't miss it.

Now as for disabling journaling... that's just crazy. That's the whole point of using these advanced file systems: better performance while securing data integrity. Understand that if you make this trade you're exchanging your personal data for a modest increase in speed. I personally wouldn't recommend it. Most people don't keep good backup's to begin with to compensate for taking this risk.

Partition alignment does matter but not tweaking that bit won't kill you either. It really depends on how heavily the disk is accessed. Assuming it's unaligned, if you had tons of I/O going on a regular basis (server) you would see an improvement. On average desktop usage, who knows, probably not appreciable.

I would disregard that Ubuntu wiki you mentioned except for the notion that partition alignment is valuable. Here's a more responsible link:

http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/index.html?ca=dgr-lnxw074KB-Disksdth-LX

Some of the recommendations in that Ubuntu wiki are just plain wrong, like the reconfiguration of tmpfs using "nodev". It's already a RAMFS!

Moving firefox cache to /tmp may increase speed in your current session. Though it might be a security hazard (not secured in your home anymore) and it will be rebuilt on each boot since tmpfs isn't persistent.

Summary:

Adding discard to ext4 options is prudent, writeback is the default mode, leave journaling settings alone, the atime tweaks are fine, and the switch to deadline or nop scheduler might also be useful, partition alignment is optional. The rest is bunk.

share|improve this answer
    
The atime tweaks are fine but ultimately pointless. relatime is a great compromise and will only cause an atime write if the file has been modified since last being accessed. This cuts down on atime writes drastically already without losing atime functionality completely. –  Caesium Nov 22 '11 at 11:48
1  
I agree that relatime is the best compromise however I was limiting my analysis to the facts presented. A lot of these tweaks really don't matter unless you have server workloads. I'm talking about performance, not wear leveling. The most important thing this user can do is enable discard support. I've owned an SSD for 1.5 years now and have never tweaked it, works great, manages its own discards. –  ppetraki Nov 22 '11 at 13:11
    
Why would nodev be stupid? It does not make the system aware that the filesystem is a device, but prevents device files from being treated as devices. You can test the different using sudo mknod -m666 test c 1 3 (which creates a file test that acts as a writable null device, i.e. /dev/null). On a filesystem mounted nodev, echo > test and cat test fails, regardless if you run it as root or not. –  Lekensteyn Nov 22 '11 at 13:47
    
I know what the man page says. Could you please explain then how this has any impact on performance whatsoever, especially in the context of an SSD? –  ppetraki Nov 22 '11 at 14:56

Do not enable 'noexec' on /tmp or you will face problem with certain 3D drivers which require executing from /tmp. NVIDIA drivers for modern hardware have this requirement, any application you have will segfault (like xscreensaver glmatrix) if you have 'noexec' enabled.

share|improve this answer
    
So i can add line without noexec? Like this? tmpfs /tmp tmpfs nodev,nosuid,mode=1777 0 0 –  Kangarooo May 7 '12 at 9:17

The discard option is no longer suggested for SSD-hosted filesystems, as it slows things down because the Linux kernel has a non-optimized implementation of the command. (IIRC, TRIM requests only use one ATA sector range at a time, making it slow.)

Instead, create a daily cron job that runs fstrim -v / (or whatever your SSD partitions are). This is the solution that Ubuntu 14.04 LTS will be shipping with. [1]

share|improve this answer

In addition to ppetraki's answer, if flash wear is a concern, you should mount a RAM file system for your /tmp folder.

tmpfs /tmp tmpfs defaults,size=15%,mode=1777 0 0
tmpfs /var/tmp tmpfs defaults,size=10%,mode=1777 0 0

But don't move your /var/log files to RAM unless you're sure you won't crash ;) AND you've already installed all your server packages that create new /var/log directories (like apache) and don't like to have them disappear between boots:

tmpfs /var/log tmpfs defaults,mode=0755 0 0 
tmpfs /var/log/apt tmpfs defaults 0 0
none /var/cache unionfs dirs=/tmp:/var/cache=ro 0 0

This is a blend of JR0cket's answer and other blog articles on the topic.

share|improve this answer

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.