Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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?
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.
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802
Rep:
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.
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.
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802
Rep:
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.
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;
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.