Solid State Drives (SSD)

From Funtoo
Revision as of 13:50, December 1, 2014 by Tassietux (talk | contribs) (applied a layout for this page as a starting guide)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


Solid State Drives (SSDs)...

Preparation

   Important

This section is in need of updates.

Partitioning

  • MBR/GPT partitioning
  • LVM

pvcreate --data-alignment 512 (equal to value given as chunksize) ?default? --data-alignment-offset (should not be needed for correctly aligned partitions)
vgcreate -s 4M (default)

  • mdadm RAID

mdadm -c 512 Aligns chunksize to 512KB erase block size times 1 data disk (for raid1)
mkfs.ext4 -b 4096 -E stride=128,stripe_width=128 (erase block size / 4096) (for raid1)
mkfs.xfs -b 4096 -d sunit=1024,swidth=1024 OR -d su=512K,sw=512K (for raid1)

  • Encrypted with dmcrypt/LUKS

cryptsetup luksFormat --align-payload 2048 (default)
cryptsetup luksOpen --allow-discards

File systems

  • EXT4
  • ZFS
  • Others

Installation

   Important

This section is in need of updates.

(Optional) Clearing SSD Memory Cells
WARNING
Avoid using dd command to overwrite data on SSD. The SSD controller has its own algorithms for allocating writes based on its internal topology. Trying to overwrite data the usual way (e.g. dd if=/dev/zero of=/dev/sda ) is not only futile but will reduce the remaining number of writes to the flash cells. To inform the controller that all data can be purged use hdparm --security-erase. [1]

Partition creation and alignment
The default alignment of 1MiB provides for proper SSD performance. For gdisk, ensure each partition starts at integer multiple of 2048 (sectors). If you change gdisk's default boundary then the default for other programs may change as a result.

Create File Systems

/etc/fstab, mount

SSD Optimization

   Important

This section is in need of updates.

Enable TRIM

Mount Options
noatime

I/O Scheduler

Use tmpfs for /tmp, /var/tmp, etc.