LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 10-02-2012, 10:52 PM   #1
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 257

Rep: Reputation: 30
interesting article on configuring SSD


Im building a mini-itx system for full-time general-use desktop system, because:

1. low power use
2. small footprint
3. i rarely use cd's/dvd's
4. silent!! (fan-less)
5. something new (for me) .. !
6. cheap (like me)

I purchased a 32G SSD to run the system on; after researching online, i learned of limitations to the number of writes over time on drives of this type.

I found an interesting article, and i'd like comments as to whether folks here have opinions as to the veracity of its claims. Also comments in general 'cause im curious that way.

thx in advance LQers!

article below:

http://chriseiffel.com/everything-li...-ssd-on-linux/

Last edited by danimalz; 10-02-2012 at 10:54 PM.
 
Old 10-03-2012, 12:10 AM   #2
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware & CentOS
Posts: 2,854
Blog Entries: 1

Rep: Reputation: Disabled
I think it's a good article.

You mentioned that your learned of limitations to the number of writes over time on drives of this type of ssd.
If there is a chance that the limitations include the type of architecture your computer is you may want to do more research.

Benchmarking seems to be a very important role from what I gathered.

This page talks about tests on certain architecture and a comparison of different architectures-
http://en.wikipedia.org/wiki/Benchmark_%28computing%29

If this is what you would really like to consider doing it go for it-
But I would do (If it were my system)more research. I don't like running into surprises when working hard on a project. These instructions are most certainly going to be work for you.

If you happen to read the article again ask yourself one question.
Is there anything about this procedure that I'm going to perform have any conflicting practices?

If so you may run into unwanted distress.

Newegg has more if your intrested. I didn't know that some of the ssd's were so expensive!
http://www.newegg.com/Store/SubCateg...e=Internal-SSD

Good luck
 
Old 10-03-2012, 02:04 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,424
Blog Entries: 2

Rep: Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996
Nice article, just a few corrections:
- With normal desktop usage the wear-out caused by writes is a non-issue on modern SSDs.
- ext2/3/4 are not partition types, but filesystems.
- If I would consider wear-out as a problem I would still use ext4 because of its superior performance compared to ext2 and because it supports the TRIM function. You can use ext4 without the journal.
- The article omits any information about partition alignment. The partitions on a SSD should be aligned to the SSD's flash erase block size, otherwise you can get serious impacts on write performance. Since the usual erase block sizes are 128, 256 or 512KB it is the safest bet to align partitions to 2048 logical sectors (1 logical sector = 512 Byte). If you partition the disk with GParted this will usually be done automatically.
 
Old 10-03-2012, 12:53 PM   #4
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
One thing the article doesn't go into is swappiness, the propensity of the system to move things to swap, rather than keeping them in active memory. If you are attempting to limit writes, reducing swappiness can help. Most modern desktop machines are going to have at least 1GB RAM, but likely 2GB to 4GB or more. Most likely, you won't be swapping much under those conditions. However, that is very dependent on what you do with the system. And, as TobiSGD indicated, modern SSDs aren't as susceptible to write wear-out. But why take the chance, right?

For SSDs, you might not want to specify a swap partition at all (just don't make one on install, or reclaim the space later). Specifying a swap partition kind of just gives your SSD a defined place to wear out first (although wear leveling may mitigate this)... You can go with swap files, if you think you'll need swap to keep apps behaving themselves.

But to reduce swappiness, first determine where it is;
cat /proc/sys/vm/swappiness

It'll return a value of 60, most likely. That's fine for a server, but probably lousy for a desktop.

Permanent changes are made by editing the /etc/sysctl.conf file. Use what even text editor you prefer (gedit, kate, nano, etc.) with root authority, and either edit, or add the line;
vm.swappiness=5

(or 10, or 1,... personal choice,... but I've gone to 1 with no ill effects)

Temporary changes can be made with;
sudo sysctl vm.swappiness=5

(again, use whatever number you want to try)

As much as doing this will reduce writes, it will also reduce the drain on resources from IO operations while it's moving the data in and out of swap. You might notice the system appearing "snappier,"... or not.
 
Old 10-03-2012, 01:02 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,424
Blog Entries: 2

Rep: Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996Reputation: 3996
I disagree. If you have a workload on your system that indicates that you will use the swap partition (besides that few MB stale memory that you see from time to time swapped out) I would strongly recommend to put your swap on the SSD. This will give you much better performance than putting it on a conventional drive.
 
Old 10-03-2012, 01:37 PM   #6
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 10.04/12.04, Scientific Linux 6.3, Android-x86, Maemo
Posts: 1,658

Rep: Reputation: 138Reputation: 138
Well, swappiness is one of those controversial, heavily opinion laden things...

Some say "no swap," others counter 100% swappiness,... It really is one of those "Your mileage may vary," kind of things... and depends heavily on how the system is to be used... As far as SSDs are concerned, I take the better safe than sorry approach... Even in the face of empirical evidence stating that their reliability and end-of-life specs are on par with HDs,... I remain skeptical.
 
Old 10-03-2012, 07:59 PM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,046
Blog Entries: 1

Rep: Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371Reputation: 1371
Member Response

Hi,

I agree with TobiSGD. Point is if you do need swap at some point in time and no swap then the system will respond differently.
This is how I set my SSD;
Code:
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001e3e2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    41945087    20971520   83  Linux
/dev/sda2        41945088    46139391     2097152   82  Linux swap
/dev/sda3        46139392    88082431    20971520   83  Linux
/dev/sda4        88082432   234440703    73179136    5  Extended
/dev/sda5        88084480    94375935     3145728   83  Linux
/dev/sda6        94377984   115349503    10485760   83  Linux
/dev/sda7       115351552   136323071    10485760   83  Linux
/dev/sda8       136325120   138422271     1048576   83  Linux
/dev/sda9       138424320   146812927     4194304   83  Linux
When you create the filesystem for each partition then the option to discard can be setup by;
Code:
tune2fs -o discard /dev/some_device_partition #to disable journal
Or setup in /etc/fstab.

Then at boot;
Code:
/etc/rc.d/rc.local;

#09-25-12 gws 20:07
#
#08-20-12 gws 14:38
#set minimum swappiness
#
echo 1 > /proc/sys/vm/swappiness

#08-20-12 gws
#sets scheduler for SSD to 'noop' 
#SSD=(device ID's of all 'SSD': see note below)
#Note Information revised from ArchWiki;

#This provides the links listed with targets information to place in bash array 
#'SSD= ( ) parentheses in below 'SSD= ( );

#ls -l /dev/disk/by-id
#lrwxrwxrwx 1 root root  9 Aug 19 11:27 ata-OCZ-AGILITY3_OCZ-C93VFN4X0532CVMP -> ../../sda

SSD=(ata-OCZ-AGILITY3_OCZ-C93VFN4X0532CVMP)

declare -i i=0
while [ "${SSD[$i]}" != "" ]; do
  NODE=`ls -l /dev/disk/by-id/${SSD[$i]} | awk '{ print $NF }' | sed -e 's/[/\.]//g'`
  echo noop > /sys/block/$NODE/queue/scheduler
  i=i+1
done

#08-20-12 gws 14:45
#get some additional gain by setting up a write-back cache
hdparm -W1 /dev/sda   #where x= a,b,c,d...

#
#09-20-12:16:14 gws bumblebee
#for nvidia optimus
if [ -x /etc/rc.d/rc.bumblebeed ]; then
     /etc/rc.d/rc.bumblebeed start
fi
On Slackware swappiness is default set to '60'.
On my Dell XPS I am using OCZ 'SSD' with a mechanical in the other bay.

Most users fail to setup the environment properly. I do use 'ext4' no journal, discard and noatime for the 'SSD' partitions';
Code:
cat fstab
/dev/sda2        swap             swap        defaults         0   0
/dev/sda5        /                ext4        defaults,noatime,discard         1   1
/dev/sda6        /home            ext4        defaults,noatime,discard         1   2
/dev/sda7        /usr             ext4        defaults,noatime,discard         1   2
/dev/sda8        /var             ext4        defaults,noatime,discard         1   2
/dev/sda9        /tmp             ext4        defaults,noatime,discard         1   2
/dev/sdb2        /mnt/win7        ntfs-3g     fmask=111,dmask=000 1   0
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
No problems!
 
Old 10-04-2012, 02:41 PM   #8
jefro
Guru
 
Registered: Mar 2008
Posts: 11,116

Rep: Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362
In a real sense, I'd think that before this disk actually wears out, you'd buy a new one. It pretty much means you can run it as you wish or want to.

My more pressing concern is that some motherboards and OS's are pretty fickle on ssd's. A lot of issues reported on all brands of lockups and what not. Read the posts on the selections before you buy it.




" full-time general-use desktop system, "

I'd be more inclined to buy ram to substitute for swap file or partition. I would be even inclined to put a small CF disk or usb in for swap before going to an SSD swap. Or a complex swap scheme that has priority on one or more.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
interesting Microsoft article newbiesforever General 5 02-15-2010 12:02 PM
Interesting Article here shazam75 General 3 01-24-2007 12:35 PM
Interesting news article chestnut General 1 02-09-2004 02:49 PM
Interesting Article Risc91 Linux - General 1 10-21-2003 10:14 AM
interesting article ??? bigjohn Linux - General 1 01-12-2003 07:14 PM


All times are GMT -5. The time now is 02:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration