SSD "discard" on Arch

SMN

SMN

Soldato
Joined
2 Nov 2008
Posts
2,502
Location
The ether
Hi all,

Finally bought a new SSD (OCZ Vertex 2 60GB) to run Arch on. I installed it all fine and its all running brilliantly after fighting with XFCE4 and then Gnome 3 for a while (now got Gnome 3 fallback running compiz WM and its much nicer).

One problem I do have is with TRIM. I have the EXACT same hard drive running Ubuntu 11.04 and TRIM is working fine. The /etc/fstab for my Ubuntu install is:


Code:
# / was on /dev/sdf1 during installation
UUID=[removed] /               ext4    discard,noatime,barrier=0,nobh,commit=100,nouse$
# swap was on /dev/sdf5 during installation
UUID=[removed] none            swap    sw              0       0

And when I run the TRIM test found here it returns the desired result (all 0's after deleting a file and re-checking the sectors).

Now when I run that test on my new SSD, it doesnt clear the sectors. I have tried everything to get it to work, moved SATA ports beetween SSD's to check BIOS issues (works fine on Ubuntu in both ports, fails in Arch in both).

I downloaded the OCZ firmware upgrader tool and upgraded them both to 1.33, again Ubuntu works and Arch doesnt.

I added "discard" to my /etc/fstab for Arch along with noatime etc as per the guide. Anyone got any idea why its not working? Here is the /etc/fstab for my Arch:

Code:
UUID=[removed] /boot ext2 defaults 0 1
UUID=[removed] / ext4 discard,noatime,defaults 0 1
UUID=[removed] /home ext4  discard,noatime,defaults 0 1
UUID=[removed] swap swap defaults 0 0

From what I can remember without booting into it, My ubuntu install is on 2.6.38.10 and my Arch shows "3.0" on uname -r.

Any ideas chaps?
Sam
 
I'd guess that trim support is a kernel driver, and that ubuntu ship it as standard but arch doesn't. It's also possible that it's a user space thing, and installing the appropriate package will solve the problem.

Can you boot arch using the ubuntu kernel? This may cause more problems than it solves, but possibly worth a go before searching through the (kernels) config file for things that sound a bit like trim.
 
I'd agree it's probaly a kernel thing, probably a bug in the SATA controller driver. From memory, there isn't anything specific on trim in the kernel config, although there may well have been a SSD optimisation setting.
I'd save a copy of the kernel config from Ubuntu and try rolling yourself a copy of the latest mainline from that :)

-Leezer-
 
To enable trim on Linux it should be just:
- use ext4 fs
- use discard option in fstab
- use a kernel >2.6.33

All of which you appear to be doing. The only thing I could suggest is to try a different kernel version (as you appear to be running nigh on the latest you maybe want to try a slightly earlier one).
 
Last edited:
Cheers guys. Silly question but how do I change the kernel in arch (downgrade to a specific version etc)?
 
Hi all,

Finally bought a new SSD (OCZ Vertex 2 60GB) to run Arch on. I installed it all fine and its all running brilliantly after fighting with XFCE4 and then Gnome 3 for a while (now got Gnome 3 fallback running compiz WM and its much nicer).

One problem I do have is with TRIM. I have the EXACT same hard drive running Ubuntu 11.04 and TRIM is working fine. The /etc/fstab for my Ubuntu install is:


Code:
# / was on /dev/sdf1 during installation
UUID=[removed] /               ext4    discard,noatime,barrier=0,nobh,commit=100,nouse$
# swap was on /dev/sdf5 during installation
UUID=[removed] none            swap    sw              0       0
And when I run the TRIM test found here it returns the desired result (all 0's after deleting a file and re-checking the sectors).

Now when I run that test on my new SSD, it doesnt clear the sectors. I have tried everything to get it to work, moved SATA ports beetween SSD's to check BIOS issues (works fine on Ubuntu in both ports, fails in Arch in both).

I downloaded the OCZ firmware upgrader tool and upgraded them both to 1.33, again Ubuntu works and Arch doesnt.

I added "discard" to my /etc/fstab for Arch along with noatime etc as per the guide. Anyone got any idea why its not working? Here is the /etc/fstab for my Arch:

Code:
UUID=[removed] /boot ext2 defaults 0 1
UUID=[removed] / ext4 discard,noatime[COLOR=Red][B],defaults[/B][/COLOR] 0 1
UUID=[removed] /home ext4  discard,noatime[B][COLOR=Red],defaults[/COLOR][/B] 0 1
UUID=[removed] swap swap defaults 0 0
From what I can remember without booting into it, My ubuntu install is on 2.6.38.10 and my Arch shows "3.0" on uname -r.

Any ideas chaps?
Sam


Remove the highlighted bits.
 
Back
Top Bottom