Various things you may wish to configure to optimize use of flash storage, such as CompactFlash card, MMC/SD card, or Solid State Drive (SSD), include:
- allow the flash controller to reclaim sectors with the TRIM command
- changing frequency of flushing writes
- disabling, by circumvention, synchronous writes for some applications
- changing which IO scheduler is used
- reducing amount of data written to the flash storage.
>> RattusRattus 20120905: [please relocate to a more suitable location] With the exception of TRIM these techniques also apply equally to other forms of block media. Indeed arguably more so as spinning disk has a much slower seek time than managed FLASH devices. Yes NAND devices (MLC especially) have a limited block erase endurance, but Hard disks accumulate bad blocks as well... So we have established that these techniques can improve the performance of the system, by reducing the amount of data flow between the host system and backing store, but what are the consequences of each of these actions?
Inform flash controller it can reclaim sectors
This is done by specifying the discard option in fstab. Recognizing this option is dependent on the file system. Ext4 and BTrFS recognize and use this option.
By informing the controller of the backing store when a block is no longer cared about, the controller can place this block into its delete queue. It can then erase the block as part of a background process giving a system wide performance increase as erase cycles take considerably longer than that of a write (which is still slower than a read). Furthermore endurance of the backing store is increased because the controller will not attempt to preform static wear leveling on 'fresh' blocks. This has the consequence that once data has been 'TRIMMED' it can no longer be recovered - undelete will not work.
This has the consequence that once data has been 'TRIMMED' it can no longer be recovered - undelete will not work.
Finding recently changed files
Finding out which files have been written to recently:
sudo find / -xdev -printf '%T+ %P\n' | sort -n | tail -99
Edit /etc/rsyslog.conf and comment out any log files that are not required.
/var/run and /var/lock
..then edit these lines:
..so that /var/run and /var/lock are mounted in RAM.