I'll start by saying that the answer you linked already summarizes all the optimizations you may need.
Next, to answer your questions:
1. Which file system (ext2/3/4 or something else)? (consider SSD life)
ext4 is a good filesystem even for SSD, so that would be my suggestion.
(If you want performance so bad you should try XFS )
2. Can it be changed after installation?
Yes, but it is not trivial, so choose well from the start :)
3. Should I partition the disk? (as we do in traditional HDD) for now, no plan of dual booting. Only Ubuntu will live on scarce space of 80GB SSD.
This is really not a matter of SSD, but your personal choice. If you were to ask me I'll say no; don't partition the disk you will end in loosing useful space.
(If you end with a partition with 2GB free and another with 1GB free, you theoretically have 3Gb free but cannot copy a 3GB file... that space is wasted )
4. I have 2 GB RAM, should I still allocate swap space (if I dont allocate swap space, can i still hibernate the machine)? will swap space impact SSD life?
I wouldn't worry so much about the SSD life ( modern one can run for decades ), however 2GB of RAM are enough not to need the swap partition.
Finally the swap partition is needed in order to hibernation, so if you want to hibernate the machine then you need the swap partition.
5. Should I consider putting additional 1GB RAM to avoid swap space?
1GB more or ram is always useful :) do it if you can.
6. What is partition aligning? is it needed to be done before installing the Ubuntu OS or can be done later?
That is the procedure where you align clusters, blocks and chunks. IMHO it is only needed on servers with a lot of data throughput. A good tool to do partition alignment is GParted. Of course this should be done before installing Ubuntu.
Hope this helps :)
fstrim
supports the option --all
on Ubuntu 16.04.
$ lsb_release -dirc
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
$ fstrim --help
Usage:
fstrim [options] <mount point>
Discard unused blocks on a mounted filesystem.
Options:
-a, --all trim all mounted filesystems that are supported
-o, --offset <num> the offset in bytes to start discarding from
-l, --length <num> the number of bytes to discard
-m, --minimum <num> the minimum extent length to discard
-v, --verbose print number of discarded bytes
-h, --help display this help and exit
-V, --version output version information and exit
For more details see fstrim(8).
By default, Ubuntu 16.04 mounts all file systems with relatime
. This works much better than noatime
while adding only a very small number of write operations.
Do not mess with the I/O scheduler.
For peace of mind, you can use smartctl
(install it with sudo apt-get install smartmontools
if needed) from time to time to check on Life_Curve_Status
, SSD_Life_Left
, and Lifetime_Writes_GiB
:
$ sudo smartctl --all /dev/sda
...
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
...
194 Temperature_Celsius 0x0022 047 063 000 Old_age Always - 47 (Min/Max 21/63)
...
230 Life_Curve_Status 0x0013 100 100 000 Pre-fail Always - 100
231 SSD_Life_Left 0x0013 100 100 010 Pre-fail Always - 0
...
241 Lifetime_Writes_GiB 0x0032 000 000 000 Old_age Always - 388
...
(Life_Curve_Status
and SSD_Life_Left
have values in percentage points: you will want to replace the SSD when they decrease below 20% or 10%. If you can, make your terminal 132 columns before running smartctl
.)
Finally, please remember that the 850 EVO is a high-quality expensive SSD from a reputable manufacturer. It is resilient and will last a long time, probably longer than any spinning disc. The only thing you can do which Samsung admits that it would help is to overprovision it a little, that is, when partitioning leave about 5% of unpartitioned space. (This will let the internal remapping / garbage collection algorithms work more efficiently; it you decide to do it then do it only when the SSD is new or after a full-disc trim or a security erase so that the overprovisioned space consists entirely of blocks known to be not in use.)
Best Answer
The thing is , first most important part about SSDs is minimizing the writes to the disk, which is why people add
nodiratime
,noatime
to the/etc/fstab
file.Second , is running
TRIM
which reclaims unused blocks of NAND memory back to SSD. Windows has TRIM enabled by default, AFAIK, so no one bothers there. With Ubuntu, it does have a weekly cronjob for TRIM, however for I've learned from Rinzwind's answer that the cron job only runs on Intel and Samsung SSDs. That's why you have to edit that/etc/cron.weekly/fstrim
file to haveexec fstrim-all --no-model-check
line, so that it runs no matter what is your SSD model.Over the recent years, this has not changed - these are still key points , minimizing writes and enabling TRIM.
Removing writes and expensive storage amount is the two factors why people also remove swap area. By default, Ubuntu creates swap partition equal to your RAM size. I have a 128 SSD and 6 GB of RAM. That means that by default Ubuntu will chop off 6 GB from 128GB, leaving 122GB for my OS, and 5% is typically reserved for root, so that leaves me 122-122*0.05=115.9 GB for myself. I might as well use that storage for something else, which is why I have only one main partition, no swap partition, but I do have a 512 MB swap file as a protective feature (not that I plan on running out of RAM, but it's always recommended to have swap)