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've just installed the Ubuntu Raring (with Sandisk Extreme) and I know there're multiple articles over the internet (and here) about TRIM, but I suspect it's a native resource on Ubuntu Raring.

PS: Tried to find something in the Ubuntu's documentation, but did not.

Then I've read lots (and lots) of articles and all of them providing different ways to enable TRIM (fstab, cron job, init scripts, etc ..).

IE: How to enable TRIM?

And I got something interesting -> I've performed those tests (creating testfile / removing / running hdparm) WITHOUT "discard" in the /etc/fstab and I got that same results, I got those expected "zeros" output.

That suggested TRIM test I've uploaded (just in case), http://www.pasteall.org/43964/text

That's why I'm wondering -> Is the TRIM active by default on Ubuntu Raring?

If not .. any recommended way to active it, among so much options? Thx.

PS: This is not the same question as the duplicated one. Here I'm trying to understand the NATIVE trim support (as it looks like)

share|improve this question
    
Thx Jorge, I didn't notice :) –  rodhash Jul 11 '13 at 21:30
    
Luis Alvarado, you marked it as duplicated, but that is the exact link I provided .. not sure if you understand my point. WITHOUT adding "discard" to fstab, I got the same result.. got it? –  rodhash Jul 11 '13 at 21:49

1 Answer 1

Having recently bought a SSD I made some tests to understand the native Ubuntu support for SSD/TRIM.

I followed the following instructions (source)

sudo -i
dd if=/dev/urandom of=tempfile count=100 bs=512k oflag=direct
hdparm --fibmap tempfile

Note the first LBA

hdparm --read-sector FIRST_LBA /dev/sdX

Replace FIRST_LBA with the number found with --fibmap and /dev/sdX with the device name (probably sda).

You should get a set of numbers. If you get all zeros you are doing something wrong and you are probably reading the wrong segment or device.

At this point remove the file and check again.

rm tempfile
sync
hdparm --read-sector FIRST_LBA /dev/sdX

If TRIM is enabled you should get mostly zeros, if not you should get the same series of number than before.

So, to answer your question, if this test is to be belived Ubuntu is not supporting TRIM by default.

Personally I add discard to the fstab options, but many prefers to run fstrim from a cronjob, but this is covered by other threads/answers.

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.