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.

A few years ago I installed Ubuntu 10.04 with LVM + LUKS on a system with SSD, TRIM was not enabled. Now I want to install Ubuntu 12.04 on the same SSD.

I have found a guide explaining how to enable TRIM on Ubuntu 12.04 with LVM + LUKS, but before installing the new system, I want to clean out all the "marked for deletion" data generated under Ubuntu 10.04, to make the disk fast as new.

My plan is to boot a Ubuntu 12.04 LiveCD and create a new ext4 filesystem on the SSD, then mount the filesystem and run fstrim on it. After rebooting the LiveCD I will install the system as normal, and enable TRIM. Can anybody say if this will work?

share|improve this question
add comment

1 Answer 1

If you are going to format the filesystem anyhow, you may just use the -E discard switch to mke2fs to have it trim the unused portions of the disk. e2fsck also supports the same option so you can trim the fs while checking it rather than formatting it.

sudo mke2fs -E discard -T ext4 /dev/sdaX
sudo e2fsck -E discard /dev/sdaX
share|improve this answer
add comment

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.