[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Current SSD setup recommendations for laptop with Debian



Nick Lidakis wrote at 2012-07-04 16:15 -0500:
> I'm not a tweaker; I need to get work done on my laptop. Also, I need the
> drive to perform reliably for as long as possible. My data is important to me
> and I try to use my computer hardware for as long as possible --not
> subscribing to the idea of disposable consumerism that is prevalent today.

This is precisely why I have purchased a Crucial m4 and researched alignment, 
TRIM, etc.  I would like to see the particular build I am working on last for 
10+ years, as previous systems have, as a production workstation.

With my limited understanding of wear-leveling, TRIM especially seems (to me) 
to be important for long-term reliability (provide the controller with true 
'free space' to work with).  Anyone, feel free to enlighten me.

Unfortunately it is difficult to find current and concise information about 
SSD, TRIM, and alignment.  What I have learned follows.

Use a current kernel: either wheezy or squeeze-backports (≥2.6.33?).  For 
encryption, use at least cryptsetup v1.4.  I do not have information about 
LVM.

Use gdisk (GPT partition table) if possible; it automatically aligns (start 
of) partitions at 1MB ("sector alignment" = 2048).

If you need encryption:
`cryptsetup luksFormat --align-payload=2048 /dev/sda1`

Create ext4 partition with:
`mkfs.ext4 -b -4096 -E stride=128,stripe_width=128 /dev/sda1`

If using encryption, add discard option to `/etc/crypttab`.

Add discard option to `/etc/fstab` *or* set up a fstrim cron job.

Test with `fstrim` in the util-linux package and/or see 
<http://blog.alexanderkoch.net/2011/testing-trim-with-luks-on-lvm/>.

If you are doing a new squeeze install, you probably want to set up the 
partitions and filesystems yourself before the install (or using the alt-f2 
console, before the 'partition disks' step), then select 'keep existing data' 
(use the empty filesystem).  If you are doing encryption, perhaps create the 
encrypted partition with the installer, then backup, re-format, and restore 
the encrypted partitions using eg. grml.

Note that this setup has so far only been tested in a virtual machine and is 
waiting for actual implementation.

Hope this helps.

Attachment: signature.asc
Description: Digital signature


Reply to: