helpful hints installing on SSD (TRIM) speeding up sabayon

Discussion in general that pertains to Sabayon Linux - Must Pertain to Sabayon Linux

Moderator: Moderators

helpful hints installing on SSD (TRIM) speeding up sabayon

Postby anomaly65 » Sat Jan 21, 2012 1:45

Hi all,

might be good baseline for wiki page? Wish I could, but due to injury, I'm wearing icepacks on my head 24/7 :)

I bought 60G SSD for boot drive (/home on regular HD's). Tomshardware.com usually has current reviews on what's new/good/etc. Samsung (yesterday) seemed to have the best story to tell on such a drive.

SSD's use wear leveling algos to extend life, but when a file is deleted, just tossing the inode away doesn't give the SSD a clue as to what real free space or old used space can be overwritten thus performance slowly declines. Thus in windows "TRIM" is used to help out.

To copy my old install important stuff (flash usb stick), I copy over /etc and /root/.ssh and /root/.bash* to be able to copy, or preserve what you might want on the new fresh install.

Seems to be ext4 or btrfs filesystems are the best suited for SSD's in linux.

In my setup via installer (another USB stick created with unetbootin) I allocate as such:

/ 100% to the SSD. DO NOT put swap on an SSD, no real trim type support here. Partitions are pseudo partitions and performance can degrade easily.
other mount points (e.g. /home) leave on your spinning HD's. I also skip the separate /boot partition thing. It's not 1992 and my machine hasn't got a floppy drive :-)

"discard" is a newer mount option for fstab which enables TRIM support.

After install (goes darned fast!), I reboot on flash (livedvd) again, and do the following:
open a console, su to root.
Code: Select all
mkdir /mnt/a
mount -o noatime,discard /dev/sda1 /mnt/a

edit /mnt/a/etc/fstab to look something like this:
Code: Select all
UUID=ee80574a-e42b-426c-924f-2778f6be3e09 / btrfs   noatime,discard 1 1

noatime reduces writes, and automatically includes nodiratime as well. Of course, your UUID is unique, so don't accidentally just copy my example here!

I choose to add the following to fstab to speed up the machine, and reduce the writes/reads to the SSD. puts these in tmpfs (ram). /tmp is likely the best to offload as it is always expected to be clean at boot time.

Code: Select all
tmpfs                   /tmp                    tmpfs   defaults,nosuid,size=512M,mode=1777 0 0
tmpfs                   /var/log                tmpfs   defaults,noatime,mode=0755 0 0
tmpfs                   /var/tmp                tmpfs   defaults,noatime,mode=1777 0 0

note that these directories all really do disappear when you reboot. YMMV;-) /var/tmp is expected to survive reboots, but in this case, I don't really care.

if you also use portage, the following is a good idea as well.
I also do this:
Code: Select all
mount /dev/sdXn /mnt/a/home
mkdir /mnt/a/home/var /mnt/a/home/usr
cd /mnt/a/usr && tar cf - portage |(cd /mnt/a/home/usr; tar xpf - ) && mv portage portage.dist && ln -s /mnt/a/home/usr/portage .

Then reboot onto your new SSD, "su" to root and
Code: Select all
equo update database && equo  upgrade --multifetch=10

then install any programs you like that aren't part of the base distro. There are places (such as sabayon's package storage directory) which might be appropriate to relocate to /home/var but that's really up to you and your results may vary a LOT.

Result: boot time cut by 2/3 or so, machine quiet, and generally feels a bit faster when starting programs and such.

Good luck,
andy
--
Use handrails on stairs. A nasty fall face first changes your point of view quickly, and mine permanently :-)
User avatar
anomaly65
Advanced Hen
 
Posts: 240
Joined: Sat Nov 17, 2007 15:37

Re: helpful hints installing on SSD (TRIM) speeding up sabay

Postby anomaly65 » Sun Mar 25, 2012 0:52

update, after running samsung 830 SSD (64Gbyte) for a couple months, observations:

Of course, YMMV, but I've seen similar comments regarding the popular sandforce SSD controllers in addition to samsung's own controller chip.

btrfs, well, not quite ready for prime time, IMHO. randomly, I/O consumes all CPU and leaves the machine non responsive for 5seconds or 2-4 minutes. btrfs-endio is stuck at the top of the chart.

Code: Select all
echo noop > /sys/block/sda/queue/scheduler

does mitigate the issue "somewhat" but I'm pretty convinced to wait a while and rebuild from scratch. presentations last month or two regarding xfs and btrfs developer presentations (over on phoronix.com) highlight some of the back and forth commentary and benchmarks between the two.
--
Use handrails on stairs. A nasty fall face first changes your point of view quickly, and mine permanently :-)
User avatar
anomaly65
Advanced Hen
 
Posts: 240
Joined: Sat Nov 17, 2007 15:37

Re: helpful hints installing on SSD (TRIM) speeding up sabay

Postby anomaly65 » Mon Apr 02, 2012 3:10

really got tired of the system "btrfs-endio" chewing the machine to bits just when I was using it. No real solution seemed available. Looks like the xfs crew was correct in their assessment ;-) it's ext4 with b-trees and a new codebase. ugh!

Converted (i.e. booted off livedvd-usb , copied / and reformatted SSD, copied back, fixed grub and fstab) back to xfs. Much happier. xfs now supports the 'discard' mount option and does very well after the 3.0 kernel. Smooth as glass and ultra fast boot up and app launch speed.
--
Use handrails on stairs. A nasty fall face first changes your point of view quickly, and mine permanently :-)
User avatar
anomaly65
Advanced Hen
 
Posts: 240
Joined: Sat Nov 17, 2007 15:37

Re: helpful hints installing on SSD (TRIM) speeding up sabay

Postby dudumomo » Mon Apr 02, 2012 15:13

Hmmm I have simply installed Sabayon 8 with no SWAP on my OCZ Vertex 2 (60gb). I didn't really considered any of these.

Should we?
Beedbox is a self-hosting distribution project with a web interface to configure all the services to ease it access.
Join us in this promising project!
----------------------------------------------------------------------------------
French mirror - freelydifferent.com
dudumomo
Growing Hen
 
Posts: 116
Joined: Tue Nov 16, 2010 14:40

Re: helpful hints installing on SSD (TRIM) speeding up sabay

Postby anomaly65 » Sun May 13, 2012 21:59

Hi dudumomo,

If you have LOTS of RAM, then the tmpfs really works nicely.

Regardless, the discard options and others mentioned are really "required" to keep your SSD clean and happy.

I've now been running xfs (using entire SSD in one partition) without any issues, and xfs has been zero trouble with the SSD whereas btrfs would often bog the 4 core machine to "useless" with the endio process, regardless of scheduler used. I tried them all...... 10x better than btrfs (which is still evolving; although xfs has seen significant improvements lately as well). For swap, simply determine if your apps and use need it, if so, toss in a swap partition. Even 1/2 the amount of physical ram is ok. There are sysctl.conf parameters which adjust how "sticky" apps are in real memory, which reduces the often unneeded swap use.

I don't use a separate boot partition either. seems pointless, and even grub 1.x never complained about it!

for xfs, I use the following in my /etc/fstab settings:

Code: Select all
UUID=221f6fc9-3789-44ff-9a99-4d21ebee8295 /      xfs     discard,ssd,defaults,noatime,logbufs=8        1 0


For btrfs see my previous posts. xfs_fsr (a defrag program) runs fine with the SSD as well. zero issues thus far, and I've yet to need to use any repair or check tools on the SSD. Works like a charm.

For notebooks, I really really like my (seagate) Momentus XT hybrid HD. has 4G (think new ones may have 8G) of read flash on them. Invisible to the hardware and OS, but cuts my laptop boot time in half, and apps load much faster, as do any frequently used files. Credit for excellent "most used" algo on the XT drive. Similarly, I really like the Samsung SSD as boot drive on my desktop. Zero errors or hassles with either. Major performance and reliability increases with both:-)

Cheers!
andy
--
Use handrails on stairs. A nasty fall face first changes your point of view quickly, and mine permanently :-)
User avatar
anomaly65
Advanced Hen
 
Posts: 240
Joined: Sat Nov 17, 2007 15:37

Re: helpful hints installing on SSD (TRIM) speeding up sabay

Postby totedati » Wed May 16, 2012 2:01

note that these directories all really do disappear when you reboot


hummm ... not quite exact! /tmp is volatile, also /var/tmp ( which in many setups, including sabayon, is only a symlink to /tmp ) and tmpfs mapping is ok, but is not true for /var/log!

that thing, /var/log, is not volatile by default! is home for many persistent logs that can be relevant in an administrative sense if you keep that putter online for weeks or months with no reboots ( and yes, no need to be a server! )

/var/log is the home for kernel logs, UPS logs, emerge and entropy logs, login and logout logs and so on ...

spending money for a SSD is only one way to speed un sabayon linux ... another less expensive and smart solution is to buy four, six or eight mid sized hdd, with best price/capacity ratio, and make a LVM RAID0 poll! mid sized hdd is cheap as dirt!

sabayon linux can work just fine in a LVM setup scenario

now, six HDD in a RAID0 setup means exactly 6x speed increase! no more, no less! no if's or what if's! this is like a real SSD speed but with a 100x more space and if you are lucky can be even for less money!

now that is what i call a sabayon turbo jet!

no need to be afraid by RAID0 part ... my setup is 4x640 Gb WD hdd and all is healty and 2 year old! i just keep backups for my docs and that is
linux is free, the expertise to harness it is not!
you don't make so much money selling open source software!
You make MORE money USING it, just like google!
linux registered user #352479
User avatar
totedati
Technological Hen
 
Posts: 400
Joined: Thu Jan 11, 2007 0:24
Location: Sibiu, Romania

Re: helpful hints installing on SSD (TRIM) speeding up sabay

Postby anomaly65 » Thu May 17, 2012 15:42

Yes, /var/log isn't transient, but it's up to the user to decide. with the beta problems in BTRFS (yuk) I was doing anything / everything to avoid disk use (desktop has 8gigs ram anyway).

The hybrid XT drive for my laptop worked wonders. I got the 64Gig SSD for the desktop as my laptop was booting in 1/2 the time of the far superior desktop (extra 1Ghz CPU, double the number of cores & L2/3 cache, double the ram...). at $100, it wasn't a bad deal, nor heavy lifting to add to the mirrored pair for /home I have setup.

With xfs on the SSD (samsung 830), I've left /var/tmp and /var/log on the disk without any issues or slowdowns. Moving the browser cache to tmpfs does speed up chrome and firefox nicely though, and I typically only clean/reboot once every couple weeks anyway.

thanks!
andy
--
Use handrails on stairs. A nasty fall face first changes your point of view quickly, and mine permanently :-)
User avatar
anomaly65
Advanced Hen
 
Posts: 240
Joined: Sat Nov 17, 2007 15:37


Return to Sabayon Linux General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest