Unallocated space on SSD for OS install

4 risposte [Ultimo contenuto]
Hikaru
Offline
Iscritto: 02/02/2023

hello forums! I have a 500 GB new SSD and I want Trisquel on it, I read somewhere on WWW to leave 100 GB unallocated space and partition 400 GB for the OS. Unallocated space will be used to "overprovisioning" the SSD with spare sectors it can use to replace worn-off sectors : "each block on solid state drive can be overwritten a certain number of times, when that point is reached, the contents of the block has to be moved to unallocated space". Is 100 GB enough to "overprovisioning" my SSD?

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

https://en.wikipedia.org/wiki/Write_amplification#Free_user_space says:

The SSD controller will use free blocks on the SSD for garbage collection and wear leveling. The portion of the user capacity which is free from user data (either already TRIMed or never written in the first place) will look the same as over-provisioning space (until the user saves new data to the SSD). If the user saves data consuming only half of the total user capacity of the drive, the other half of the user capacity will look like additional over-provisioning (as long as the TRIM command is supported in the system).

So, as far as I understand, with trimming, there is no reason to leave free space. There is a command, fstrim, to trim (aka discard) the unused blocks. 'man fstrim' warns:

Running fstrim frequently, or even using mount -o discard, might negatively affect the lifetime of poor-quality SSD devices. For most desktop and server systems a sufficient trimming frequency is once a week.

Looking at 'man ext4' and 'man xfs' (the filesystems Trisquel uses by default), the discard option is, in both cases, off by default, and that option is absent from /etc/fstab. Trisquel (11 at least) includes a systemd service to run fstrim every week, exactly as 'man fstrim' recommends:
$ systemctl status fstrim.timer
* fstrim.timer - Discard unused blocks once a week
Loaded: loaded (/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled)
Active: active (waiting) since Tue 2023-02-21 19:11:26 -03; 18h ago
Trigger: Mon 2023-02-27 01:11:38 -03; 4 days left
Triggers: * fstrim.service
Docs: man:fstrim
Feb 21 19:11:26 helena systemd[1]: Started Discard unused blocks once a week.

In conclusion, you can partition the whole disk and let Trisquel takes care of the trimming. At least Trisquel 11. With an older version of Trisquel, it is worth running the above command to check that fstrim is scheduled to run once a week.

Hikaru
Offline
Iscritto: 02/02/2023

thank You!

Sunny Day
Offline
Iscritto: 01/05/2023

Great question and great answer - I am also planning to use (reuse) a 500GB SSD and this was very helpful, thank you both!

Hikaru
Offline
Iscritto: 02/02/2023

thank You too!