SSD and SolydXK

Questions about hardware, drivers and peripherals.
In the Original Post please also include the output of inxi -Fzx
nuts2u
Posts: 67
Joined: 03 Nov 2013 21:07

SSD and SolydXK

Postby nuts2u » 22 Apr 2015 22:28

I just installed a Samsung 850 EVO 500 GB SSD in my system and all I can say is (#$%^^$ WOW!!! My system now boots to my SolydX 64 desktop from the grub menu (when I press enter) in 6 seconds. I just want to say to all the SolydXK users that if your HD is starting to show its age or you are running out of space and are thinking of replacing you HD, upgrading/install an SSD in your system is one of the best investments you can make. Another idea is to move all your data files to your exisiting HD and install a smaller SSD 120 GB or 250GB into your system and load SolydXK on the SSD.

I bought the larger SSD because I have a large Virtualbox partion/mount point, which allows me to test variuos linux distro's and also a copy of Win 10 preview in VM's. They boot very quickly anbd it is now a real pleasure to test out the other distro's. I'm also testing the SolydX 32 EE edition and it just svreams on this SSD.

Just wanted to share this with you all.......


Liberalism is the art of standing on your head,
then telling everyone around you that they're upside-down.

User avatar
ilu
Posts: 2016
Joined: 09 Oct 2013 12:45

Re: SSD and SolydX 64

Postby ilu » 23 Apr 2015 18:03

Did you use any special mounting parameters for the SSD to reduce wear? noatime, nodiratime, discard? I've read a lot about it when installing mine but I understood not even half of it ...

nuts2u
Posts: 67
Joined: 03 Nov 2013 21:07

Re: SSD and SolydX 64

Postby nuts2u » 23 Apr 2015 18:53

Yes I did. I added the noatime to the following mount points/partions on my system.... / /home /vbox

I also setup cron jobs to issue the fstrim command on the drive. If you pm me with you email address I will send you the web page link for setting up the fstrim scripts.


Liberalism is the art of standing on your head,
then telling everyone around you that they're upside-down.

User avatar
Arjen Balfoort
Site Admin
Posts: 8817
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: SSD and SolydX 64

Postby Arjen Balfoort » 24 Apr 2015 08:02

This was a big help to me: https://wiki.archlinux.org/index.php/So ... rives#TRIM

I also added this to fstab (more than 4GB memory):

Code: Select all

tmpfs   /tmp    tmpfs   defaults,noatime,mode=1777      0       0
and added this to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub:

Code: Select all

rootfstype=ext4


SolydXK needs you!
Development | Testing | Translations

kurotsugi
Posts: 2098
Joined: 09 Jan 2014 00:17

Re: SSD and SolydX 64

Postby kurotsugi » 24 Apr 2015 16:57

if you have limited ram you can use this one

Code: Select all

# tmpfs
tmpfs /tmp tmpfs nosuid,nodev,mode=1777,size=512M 0 0
tmpfs /var/tmp tmpfs nosuid,nodev,mode=1777,size=512M 0 0

nuts2u
Posts: 67
Joined: 03 Nov 2013 21:07

Re: SSD and SolydX 64

Postby nuts2u » 24 Apr 2015 17:34

I also added this to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub:

elevator=deadline

This changes the scheduler from default cfq to deadline, or you can also choose noop instead of deadline.


Liberalism is the art of standing on your head,
then telling everyone around you that they're upside-down.

User avatar
Arjen Balfoort
Site Admin
Posts: 8817
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: SSD and SolydX 64

Postby Arjen Balfoort » 24 Apr 2015 19:30

These are very nice tips for SSD owners.
Let's find a better place for this topic and make it sticky?


SolydXK needs you!
Development | Testing | Translations

nuts2u
Posts: 67
Joined: 03 Nov 2013 21:07

Re: SSD and SolydX 64

Postby nuts2u » 25 Apr 2015 00:35

Schoelje,

Glad you like these tips. I am not sure how to make this topic a sticky or where to move it. Would you be kind enough to do this?


Liberalism is the art of standing on your head,
then telling everyone around you that they're upside-down.

User avatar
Arjen Balfoort
Site Admin
Posts: 8817
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: SSD and SolydXK

Postby Arjen Balfoort » 25 Apr 2015 06:24

I moved the topic to the Support/Hardware forum, changed the title to "SSD and SolydXK" and made it sticky.

I even used tmpfs mounts on the SolydX RPI2 image. It should help prevent SD corruption when unplugging the Raspberry PI.


SolydXK needs you!
Development | Testing | Translations

nuts2u
Posts: 67
Joined: 03 Nov 2013 21:07

Re: SSD and SolydXK

Postby nuts2u » 25 Apr 2015 17:34

Thanks Schoelje !!!


Liberalism is the art of standing on your head,
then telling everyone around you that they're upside-down.

User avatar
Arjen Balfoort
Site Admin
Posts: 8817
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: SSD and SolydXK

Postby Arjen Balfoort » 25 Apr 2015 17:43

I am now experimenting with these fstab settings:

Code: Select all

tmpfs   /tmp                    tmpfs   defaults,noatime,mode=1777              0       0
tmpfs   /var/tmp                tmpfs   defaults,noatime,mode=1777              0       0
tmpfs   /var/log                tmpfs   defaults,noatime,mode=0755              0       0
tmpfs   /var/log/apt            tmpfs   defaults,noatime                        0       0
tmpfs   /var/cache/apt/archives tmpfs   defaults,noexec,nosuid,nodev,mode=0755  0       0


SolydXK needs you!
Development | Testing | Translations

User avatar
bas_otten
Posts: 203
Joined: 19 Oct 2013 12:22
Location: Netherlands

Re: SSD and SolydXK

Postby bas_otten » 17 Jun 2015 13:09

Great topic this is! I learned a lot from it and my computers are running noticeably smoother now, with less load on the SSD 8-) . Also found this to be a pretty good resource: https://wiki.debian.org/SSDOptimization.

This is briefly what I implemented:
  • switched from ext3 to ext4 (I was on ext3 because of partimage, but gladly I found that FSArchiver, available on SystemRescueCD, does support ext4 to create/restore images)
  • added the 'noatime' mount option for the SolydK root filesystem in /etc/fstab
  • added a line in my /etc/cron.d/crontab specifying 'fstrim --all' on a daily basis
  • added the 'elevator=deadline' kernel parameter in /etc/default/grub
  • added several mountpoints as tmpfs in /etc/fstab, to reduce I/O and improve performance; like a DBA colleague of mine always says: the best I/O is no I/O :lol:
With regard to introducing tmpfs's in /etc/fstab: I encountered two points of attention:
  • For the size of /var/tmp you should accommodate for about 200MB per user logging in to KDE. If you don't have enough physical memory for that, you're probably better off leaving this out to avoid swapping and/or errors. The good news is - as I just discovered when testing - that the 'size' mount option is not the amount that is allocated from the start per se. Allocation is done on an actual use basis, the rest is left available for the system. So systems with moderate memory (say 1-2GB) can still classify for this, depending on the memory consumption of other processes.
  • Be really careful when adding /var/log to the list. First examine the subdirectories that exist on the physical filesystem before mounting it as tmpfs. By nature, specifying only /var/log as tmpfs leaves you with an empty filesystem to start with. Several services however, created subdirectories there when they were installed and assume a permanent existence of these subdirectories for logging. I found several services were either not running at all (e.g. apache) or running crippled (e.g. clamav,ConsoleKit,mysql). You can check on your system by searching the syslog for errors, using your services and see how they behave and log; also check systemd for failed units.
These are the settings I ended up with, tested on both a 8GB and a 1.5GB machine:

Code: Select all

tmpfs   /tmp                 tmpfs   size=20%   0  0
tmpfs   /var/tmp             tmpfs   size=40%   0  0
tmpfs   /var/backups         tmpfs   size=10%   0  0
tmpfs   /var/log             tmpfs   size=10%   0  0
tmpfs   /var/log/apache2     tmpfs   size=10%   0  0
tmpfs   /var/log/apt         tmpfs   size=10%   0  0
tmpfs   /var/log/clamav      tmpfs   size=10%   0  0
tmpfs   /var/log/ConsoleKit  tmpfs   size=10%   0  0
tmpfs   /var/log/cups        tmpfs   size=10%   0  0
tmpfs   /var/log/lightdm     tmpfs   size=10%   0  0
tmpfs   /var/log/mysql       tmpfs   size=10%   0  0
tmpfs   /var/log/samba       tmpfs   size=10%   0  0
tmpfs   /var/log/mpd         tmpfs   size=10%   0  0

Fargo
Posts: 896
Joined: 17 Sep 2013 14:40

Re: SSD and SolydXK

Postby Fargo » 17 Jun 2015 21:40

I'm glad to see more interest in setting up SSDs in SolydXK. There is a lot of good info in this thread as well.
http://forums.solydxk.com/viewtopic.php?f=5&t=2208

I hope you don't mind if I repost part of one of my comments from the thread above. This is how I did my system. I hope that some day someone will be able to write a short script that will allow users to setup their SSD with a gui. It seems that an easy way to set up an SSD could be another way for SoldydXK to set itself apart from the pack. It doesn't seem like it would be that hard to write such a script using fstrim like I did below, but I really don't know.

Fargo wrote:
... I finally decided to just use a different option and setup fstrim to run as a scheduled task. I have seen both methods recommended. So I don't know which is better. I suppose it varies on a persons needs. From what I read in this article, http://www.howtogeek.com/176978/ it sounds like Ubuntu is going to implement the fstrim option in future releases. So its probably an ok method.

This webpage is the page that I used for a guide in setting up my TRIM job.
http://www.webupd8.org/2013/01/enable-t ... rives.html
The page has some good info. It shows both ways of setting up trim and even shows code to check if your SSD supports trim. Using that page as my guidelines, I decided that setting up my system to run TRIM on a weekly basis was sufficent. So here is how I set mine up:
To use a weekly cron job (so the trimming will occur once a week) for TRIM (fstrim), open /etc/cron.weekly/trim as root with a text editor (/etc/cron.weekly/trim doesn't exist so this will create the file):

Code: Select all

gksu kate /etc/cron.weekly/trim
and paste this:

Code: Select all

#!/bin/sh
LOG=/var/log/trim.log
echo "*** $(date -R) ***" >> $LOG
fstrim -v / >> $LOG
fstrim -v /home >> $LOG

The last two commands in the code above perform the actual trimming for the root (/) and home (/home) partition and you need to edit them: here, add the SSD partitions for which you want to enable the daily TRIM job (usually, you must add "/" if the root partition is on the SSD and "/home" if you've set up a separate home partition).

Before saving the file, you can check if the fstrim command works:

Code: Select all

sudo fstrim -v /
The output should look similar to this:
andrei@ubuntu-desktop:~$ sudo fstrim -v /
/: 8158715904 bytes were trimmed
Once you've added your SSD partitions, save the file and make it executable using the following command:

Code: Select all

sudo chmod +x /etc/cron.weekly/trim
You can check the /var/log/trim.log log file to see the fstrim output.
I don't really know much about coding. I just picked this up from my research. Hopefully someone else can chime in if their are any errors in here. But I cross referenced the sites listed above so I think this should work.

EDIT: I also wanted to add that consideration could also be given to setting the swappiness of the harddrive. Along with changing things like the disk scheduler and noatime, nodiratime. But I really don't know enough about this stuff. So I didn't change any of that.

MOre info can be found here
http://chriseiffel.com/everything-linux ... -on-linux/

User avatar
bas_otten
Posts: 203
Joined: 19 Oct 2013 12:22
Location: Netherlands

Re: SSD and SolydXK

Postby bas_otten » 30 Jun 2015 20:05

Recently, I figured out an additional idea to avoid I/O and keep the system clean. It has to do with the 'controversial' files ~/.xsession-errors and ~/.xsession-errors.old in each user's homedirectory. Controversial, because in case of trouble during login or while starting an application, it can provide truely useful information; while, on the other hand, it also contains a whole lot of repetitive nonsense-type loglines and tends to grow pretty big during long and active uptimes (starting at ~50KB, easily growing to a couple MB's).

Specifications/requirements:
  • redirect .xsession-errors to tmpfs-mounted /tmp
  • symbolic link at original location pointing to new location
  • don't care if .xsession-errors.old from previous session is gone
Implementation example:
  • in /etc/X11/Xsession, change 'ERRFILE=$HOME/.xsession-errors' to 'ERRFILE=/tmp/$USER.xsession-errors' (l.61)
  • in /home/*/.kde/Autostart/startupscript.sh (specified to run at KDE SystemSettings Autostart), add the lines:

    Code: Select all

    rm ~/.xsession-errors* 2>/dev/null
    ln -s /tmp/$USER.xsession-errors ~/.xsession-errors
    
(Remarks:)
  • be notified that /etc/X11/Xsession is a config file of package x11-common
  • the example is for SolydK, if needed find your equivalent method on SolydX
  • ... did I so far mention the performance gain this will get you? ;)

User avatar
belze
Posts: 221
Joined: 29 Sep 2014 16:31
Location: Torino, Italy

Re: SSD and SolydXK

Postby belze » 01 Jul 2015 17:01

May i point you to this beautiful post: siduction and ssd by Ferdinand Thommes
This is one of the best articles i have aver read.
-------
Image

Fargo
Posts: 896
Joined: 17 Sep 2013 14:40

Re: SSD and SolydXK

Postby Fargo » 06 Aug 2015 16:29

belze wrote:May i point you to this beautiful post: siduction and ssd by Ferdinand Thommes
This is one of the best articles i have aver read.
Thanks for posting. I skimmed through it and it looks very informative. I will be sure to read it more thouroughly when I do an upcoming build.

LizziAS
Posts: 9
Joined: 19 Jun 2017 11:54

Re: SSD and SolydXK

Postby LizziAS » 19 Jun 2017 12:29

It's been noted in another forum that systemd automatically uses half your ram for the tmpfs and their is no point in adding it to your fstab unless you have a specific requirement for like say an amount other than half your ram..

would you like a link?

of course if you are not employing systemd (yay for you!) then you would still need the fstab entry

LizziAS
Posts: 9
Joined: 19 Jun 2017 11:54

Re: SSD and SolydXK

Postby LizziAS » 19 Jun 2017 12:39

also, tmpfs is not suitable for /var/tmp as /var/tmp is meant to preserve temporary files across multiple boots which isn't feasible in tmpfs

kurotsugi
Posts: 2098
Joined: 09 Jan 2014 00:17

Re: SSD and SolydXK

Postby kurotsugi » 20 Jun 2017 02:48

of course if you are not employing systemd (yay for you!) then you would still need the fstab entry
as far as I know it's not only systemd but all init also do that (i.e: creating tmpfs in the ram). normally you don't have to manually using fstab regardless the init. IIRC part of it are controlled from the kernel. though, I admit that I don't know the exact detail about it. the link would be aprreciated :3
It's been noted in another forum that systemd automatically uses half your ram for the tmpfs and their is no point in adding it to your fstab unless you have a specific requirement for like say an amount other than half your ram..
systemd (and the other init) only create tmpfs based on a common criteria. which means, it only create tmpfs for /run, /dev/shm, /run/lock, /sys/fs/cgroup, and /run/user/1000. it won't create another tmpfs partition. regardless the case, you need to create tmpfs manually if you want to move something to tmpfs.
also, tmpfs is not suitable for /var/tmp as /var/tmp is meant to preserve temporary files across multiple boots which isn't feasible in tmpfs
yes, but the main usage of /var/tmp is to speed up things. SSD is already fast enough so that you don't need a /var/tmp. OTOH, the frequent read/write of /var/tmp will reduce the SSD life. SSD is still quite expensive so in this case the disadvantages is greater than the advantage.

User avatar
belze
Posts: 221
Joined: 29 Sep 2014 16:31
Location: Torino, Italy

Re: SSD and SolydXK

Postby belze » 26 Jun 2017 19:04

well, i have another use case: in gentoo i compile a lot, and tmpfs on SSD is not a good idea if i have 8+gb RAM.
-------
Image


Return to “Hardware”

Who is online

Users browsing this forum: No registered users and 2 guests