紀錄一下 SSD 硬碟裝 GNN/Linux Debian 要注意的部份

關於,4K 對齊的部份,我直接安裝用 cfdisk 切割, sda1 都是由 2048 開始,一般就是要是 512 的倍數

/etc/fstab

# /etc/fstab: static file system information.
#
# Use ‘blkid’ to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
# / was on /dev/sda1 during installation
UUID=bababa_uuid / ext4 discard,noatime,commit=60,errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=bababa_another_uuid swap sw 0 0

我很不爭氣的還是切了一點點的 swap

記得 /etc/default/tmpfs 裡 RAMTMP=yes ,/tmp 就會用 tmpfs
把常用的軟體暫存設到 /tmp ,減少寫入,如果是用來開發,有跑 server 的話
要注意一些寫入很狂的工具,像是 mongodb 在開發時,mongodb.conf 裡 nojournal = true 記得加上
就是像這一類的,要注意一下,再背後狂操你的 SSD,可以用 iotop 找出來

設定 /etc/sysctl.conf
#net.ipv6.bindv6only = 0
fs.inotify.max_user_watches = 100000
fs.file-max = 128000
net.core.somaxconn=250000
vm.swappiness=1
vm.vfs_cache_pressure=50


裝一下 sysfsutils
aptitude install sysfsutils

就可以,直接設 /etc/sysfs.conf
block/sda/queue/scheduler = deadline

檢查 trim 有沒有真的開

root@x220:/var/log# hdparm -I /dev/sda1 | grep TRIM
* Data Set Management TRIM supported (limit 8 blocks)
* Deterministic read data after TRIM


檢查 SSD 的 wearing 情形

請安裝 smartmontools
aptitude install smartmontools

然後下指令看

smartctl -A /dev/sda

Linux 上面 update firmware,這裡指的 C4 SSD http://www.crucial.com/store/ssd.aspx
其他牌子的,還沒有本錢嘗試

其實就和 Debian 上面製作,開機 USB 碟一樣,依照 syslinux 的開機方式做開機碟,然後把他 ISO 裏面的東西
搬到做好的開機碟( mount -o loop 起來後,複製到 usb 開機碟),修改 usb 碟下面的開機設定檔,就可以用 USB 碟開機,
更新firmware ,我是有切回 BIOS 把硬碟換回 ata 模式,再開機,更新完 firmware 再改回 AHCI 模式

最後記得,所有的東西都要備份,我自己都是用 Dropbox ,你可以用自己喜歡的,重此就可以過著幸福快樂的生活了


參考資料

請愛用 man

http://wiki.debian.org/SSDOptimization?action=show&redirect=SSDoptimization

https://wiki.archlinux.org/index.php/SSD#Tips_for_Maximizing_SSD_Performance

https://wiki.archlinux.org/index.php/Maximizing_Performance