-   Linux - Newbie (
-   -   Preparing SSD for Linux installation (

Jackpot 11-14-2016 11:23 PM

Preparing SSD for Linux installation
Whats up guys....I recently picked up an SSD for my new laptop and was wondering what to do when preparing it for new installation of linux? I know that I should limit the read/write as much as possible so was seeing if anyone has any experience with them and what should be done.

What I got so far is to update firmware, use EXT4, deff kill the swap, reduce time stamps, and move /tmp on the RAM? Also, is it better to install everything on a single partition or break it down a little?

Any help would be great

AwesomeMachine 11-15-2016 12:19 AM

You just do it like with a HDD. After you have the operating system installed you can update the firmware, but that is usually not necessary. Only update the firmware if you know why you are doing it.

crazy-yiuf 11-15-2016 12:53 AM

I've heard that SSDs are degrading a lot slower than they predicted, as far as I know most people don't worry too much about limiting the writes. My current one has lasted four years just fine with pretty heavy use.

If you want to squeeze out every last write, though, here are some tips:

- I'd guess the most important thing for the average user is to disable browser caching. For Chromium I think the way to do this is to launch it with the --disk-cache-dir=null option.
- It also couldn't hurt to add noatime to the drive's fstab entry.
- As for swap, I never need it, but you might if you're doing a lot of fancy video games or movie editing or something. A better option than totally nixing it might be to adjust your swapiness, so it uses it as infrequently as possible. I'm not sure if all distros do swappiness the same way, so you should google it for yours.
- Assuming systemd, check your /etc/systemd/journald.conf file and set Storage=volatile, or none.
- Your filesystem keeps tracks of its lifetime writes. You can check with, for example:
dumpe2fs /dev/sda4 | grep "write"
Mine shows over a terabyte for the currently installed OSes, and there have been three or four others that I've clobbered.

I'm not sure how much use /tmp actually sees for the average user, I'd guess not all that much. Upgrading frequently increases the writes a lot though, I'd limit it to monthly upgrades.

How many partitions you use shouldn't directly effect anything. I only use about 8 gigs per Linux, and I like to have three or four Linuxes, so my 120 gig hard drive has four partitions with OSes, twenty gigs each, and a 40 gig data partition that they all mount, for music and such. Having multiple partitions per OS tends to be more trouble that it's worth, for me anyways.

Edit: Note some interesting math here: 1 tb / 120 gb = 8.33 writes per byte. SSDs distribute writes evenly across the drive. If I remember correctly, they last for 100,000 writes or more. So unless you're running a server or something, you should be fine.

BW-userx 11-15-2016 08:49 AM

you can also set up your system within fstab or by a cron job to trim or do something called "discard" with your sdd to keep it 'fresh.'

which is up to you to do either or not at all. It seems everyone has their own take on which is better, trim or discard.

I use trim via cron


userx@voided1.what~>> ls /etc/cron.weekly

userx@voided1.what~>> cat /etc/cron.weekly/trim
echo "*** $(date -R) (root)***" >> $LOG
fstrim -v / >> $LOG
echo "*** $(date -R)-(data) ***" >> $LOG
fstrim -v /media/data >> $LOG

Log looks like this

userx@voided1.what~>> cat /var/log/trim.log
*** Thu, 03 Nov 2016 07:05:01 -0500 (root)***
/: 22 GiB (23576133632 bytes) trimmed
*** Thu, 03 Nov 2016 07:05:02 -0500-(data) ***
/media/data: 179.4 GiB (192636121088 bytes) trimmed
*** Thu, 10 Nov 2016 06:13:01 -0600 (root)***
/: 19.2 GiB (20584620032 bytes) trimmed
*** Thu, 10 Nov 2016 06:13:02 -0600-(data) ***
/media/data: 170.2 GiB (182745985024 bytes) trimmed

as far as breaking it down.
I separate root / and /home period, for the purpose of ease to re-install the system without worry of loss of user data.

as far as swap I just added a swap file on my sdd, and keep it there that I turn on only when needed.

it is a faster swap being sdd only started up if and when needed, which is not very often.

the rest I keep the entire OS on /
/home is on a hybrid 750GB HDD 7200rpm

All times are GMT -5. The time now is 08:19 AM.