Greetings!
I've recently come across two Ubuntu/Linux tips that I wanted to share (and document). They are particularly import if you run Ubuntu on machine with not a lot of extra hard disk space. In my case, I have a hybrid hard drive with a 24 GB SSD partition, and a 750 GB data partition (Ubuntu is installed on the SSD partition of obvious reasons, while most of /home uses symbolic links to the data partition). Over the last year or so, I've noticed my SSD partition steadily increase is size, from about 40% to 73%. Fearing I would run out of room soon, I did some research on if this was merely from system updates and installed software, or if it was something else. I also noticed my machine seemed to be responding much more slowly then it had been when I first set it up a year ago, and tried several things to improve performance without much result. I feared this might be related to the lack of disk space on the SSD partition as well, and I was sort of right.
These tips might be application to other Linux distributions as well. As always, use at your own risk!
1) Clearing out old kernel versions
Ubuntu keeps old kernels hanging around after you install
new ones via auto-update. They can take up quite a bit of room. There are some good reasons for keeping old kernels around (e.g. reverting if a kernel update breaks something). But it's unlikely you'll need all of them.
Here's a simple little command line to clear out the old ones.
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" |
awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r
's/-[a-z]+//')")
It worked for me, and cleared out a good 6 GB or so of old kernel
files, which made a big difference on my 24GB SSD (I went from 73% full to 45% full). I'd recommend only doing this after you've confirmed that the newest kernel works, and even then, you might want to modify it slightly to keep the second last kernel just in case.
This also made a big difference in my /boot partition, which is about 500 MB. This is in fact what led me to find this, as I'd been getting error messages upon boot about /boot being nearly full and went to investigate. After removing the extra kernels, I'm back down only 29 MB full on /boot. Nice!
Reference: http://askubuntu.com/questions/89710/how-do-i-free-up-more-space-in-boot
2) SSD Trim
If you ever use Ubuntu on an SSD drive (as I do), your performance
will slow overtime unless you periodically run the 'fstrim' command
(e.g. in a daily cron job) to send SSD delete commands for removed files. I definitely noticed a drop in
performance over the last year, and have been trying to diagnose why
when I came across this little gem.
Since then I've started running fstrim,
I've definitely noticed an improvement. The first time I ran it, it sent about 7GB worth of "deletes". They are supposed to add
this in 14.04, but it's not in as of 13.10 (or 12.04, which is what I use).
Full instructions and information are in the link below. Enjoy!
Reference: http://www.howtogeek.com/176978/ubuntu-doesnt-trim-ssds-by-default-why-not-and-how-to-enable-it-yourself/
No comments:
Post a Comment