Differences between revisions 3 and 4
Revision 3 as of 2009-11-22 13:22:45
Size: 638
Editor: SamatJain
Comment:
Revision 4 as of 2010-05-18 10:08:11
Size: 1379
Editor: SamatJain
Comment: Add section on filesystem alignment
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:

== Creating aligned filesystems ==

This assume that the underlying partitions (including layers, such as LVM) have been created on properly-aligned sector boundaries.

These assume a 128 KiB erase block size.

=== ext4 ===

{{{
mkfs -t ext4 -E stripe-width=32 /dev/sda1
}}}

Source: [[http://thunk.org/tytso/blog/2009/02/20/aligning-filesystems-to-an-ssds-erase-block-size/|Aligning filesystems to an SSD's erase block size]]

This can also be down at mount time:

{{{
mount -t ext4 -o stripe=32 /dev/sda1
}}}

=== XFS ===

{{{
mkfs -t xfs -d su=128k -d sw=1 /dev/sda1
}}}

This can also be done at mount time, though the options/units are different:

{{{
mount -t xfs -o sunit=256,swidth=256 /dev/sda1
}}}

Solid-state disks have low-level block fragmentation problems (see Anandtech article), and these problems will persist even after formatting. Most disk's block mapping table can be reset by issuing an ATA secure erase command.

Reducing writes

Remounting temporary files as tmpfs

To /etc/fstab:

none /tmp tmpfs defaults,noatime,mode=1777,size=1024M 0 0
none /var/tmp tmpfs defaults,noatime,mode=1777,size=512M 0 0

Creating aligned filesystems

This assume that the underlying partitions (including layers, such as LVM) have been created on properly-aligned sector boundaries.

These assume a 128 KiB erase block size.

ext4

mkfs -t ext4 -E stripe-width=32 /dev/sda1

Source: Aligning filesystems to an SSD's erase block size

This can also be down at mount time:

mount -t ext4 -o stripe=32 /dev/sda1

XFS

mkfs -t xfs -d su=128k -d sw=1 /dev/sda1

This can also be done at mount time, though the options/units are different:

mount -t xfs -o sunit=256,swidth=256 /dev/sda1

SamatsWiki: SSD (last edited 2021-11-03 07:05:58 by SamatJain)