注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Solid State Drives (SSD)"

From Funtoo
Jump to navigation Jump to search
m (Tassietux moved page Ssd to Solid State Drives (SSD): page title should not be an acronym)
(Applied chapters/sections to the existing text.)
Line 1: Line 1:
{{PageNeedsUpdates}}
{{PageNeedsUpdates}}
This page aims to highlight SSD relevant options for commands commonly used during system setup/install.<br />
This page aims to highlight SSD relevant options for commands commonly used during system setup/install.<br />
'''<big>SSD</big>'''<br />
 
'''WARNING'''<br />
=Installation=
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. <ref>https://wiki.archlinux.org/index.php/SSD_Memory_Cell_Clearing</ref><br />
{{SectionNeedsUpdates}}
Partitioning<br />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.<br />
==Partitioning==
LUKS<br /> cryptsetup luksFormat --align-payload 2048 (default)<br />
{{SectionNeedsUpdates}}
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.<br />
==Cryptsetup/LUKS==
{{SectionNeedsUpdates}}
cryptsetup luksFormat --align-payload 2048 (default)<br />
cryptsetup luksOpen --allow-discards<br />
cryptsetup luksOpen --allow-discards<br />
MDADM<br />mdadm -c 512  Aligns chunksize to 512KB erase block size times 1 data disk (for raid1)<br />
 
LVM<br />pvcreate --data-alignment 512 (equal to value given as chunksize) ?default? --data-alignment-offset (should not be needed for correctly aligned partitions)<br />
==mdadm RAID==
{{SectionNeedsUpdates}}
mdadm -c 512  Aligns chunksize to 512KB erase block size times 1 data disk (for raid1)<br />
 
==LVM==
{{SectionNeedsUpdates}}
pvcreate --data-alignment 512 (equal to value given as chunksize) ?default? --data-alignment-offset (should not be needed for correctly aligned partitions)<br />
vgcreate -s 4M (default)<br />
vgcreate -s 4M (default)<br />
MKFS<br />mkfs.ext4 -b 4096 -E stride=128,stripe_width=128 (erase block size / 4096) (for raid1)<br />
 
==Create Files System==
{{SectionNeedsUpdates}}
mkfs.ext4 -b 4096 -E stride=128,stripe_width=128 (erase block size / 4096) (for raid1)<br />
mkfs.xfs -b 4096 -d sunit=1024,swidth=1024 OR -d su=512K,sw=512K (for raid1)
mkfs.xfs -b 4096 -d sunit=1024,swidth=1024 OR -d su=512K,sw=512K (for raid1)
=Clearing SSD Memory Cells=
{{SectionNeedsUpdates}}
'''WARNING'''<br />
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. <ref>https://wiki.archlinux.org/index.php/SSD_Memory_Cell_Clearing</ref><br />

Revision as of 13:20, December 1, 2014


This page aims to highlight SSD relevant options for commands commonly used during system setup/install.

Installation

   Important

This section is in need of updates.

Partitioning

   Important

This section is in need of updates.

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.

Cryptsetup/LUKS

   Important

This section is in need of updates.

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

mdadm RAID

   Important

This section is in need of updates.

mdadm -c 512 Aligns chunksize to 512KB erase block size times 1 data disk (for raid1)

LVM

   Important

This section is in need of updates.

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)

Create Files System

   Important

This section is in need of updates.

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)

Clearing SSD Memory Cells

   Important

This section is in need of updates.

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]