- Оптимизация Ubuntu (и прочих Linux-ов) под SSD
- Рекомендации по использованию SSD в Linux
- Размеры разделов
- Форматирование разделов
- Конфигурация отделки
- Вручную
- Настройка /etc/fstab
- Планирование выполнения fstrim
- Монтирование разделов
- Временные каталоги
- Настройка GRUB: вход/выход планировщика
- SWAP или без SWAP?
- Сокращение количества проверок файловых систем
- Испытание Скорости
- Добавить комментарий Отменить ответ
- Solid state drive
- Contents
- Usage
- Periodic TRIM
- Continuous TRIM
- Trim an entire device
- dm-crypt
- Maximizing performance
- Native sector size
- SSD memory cell clearing
- Security
- Hdparm shows «frozen» state
- Hardware encryption
- Troubleshooting
- Resolving NCQ errors
- Resolving SATA power management related errors
- External SSD with TRIM support
- Firmware
- ADATA
- Crucial
- Intel
- Kingston
- Mushkin
- Samsung
- Update under Linux
- SanDisk
Оптимизация Ubuntu (и прочих Linux-ов) под SSD
Доброго времени суток всем читающим. В данной мини-статье мне хотелось бы собрать и рассмотреть основные моменты оптимизации работы (и, конечно, продления жизненного цикла ) твердотельных накопителей. Практически всю информацию можно легко найти в сети, но тут я попытаюсь упомянуть пару подводных камней.
Первое, с чего стоит начать — это выбор файловой системы. Если система на десктопе — то особо вопросов не возникает — брать журналируемую ext4 — у которой масса преимуществ перед остальными ФС. Да, будет больше циклов записи на носитель, но будет гарантия того, что в случае сбоя питания вы не потеряете данные. На ноутбуках, нетбуках — имеются батареи, и вероятность отключения из-за потери питания — практически нулевая (но, конечно, всякое бывает), в связи с чем журналирование, обычно рекомендуют отключать. Если это очень хочется сделать, то после установки системы грузимся с liveCD, и пишем в терминале
tune2fs -O ^has_journal /dev/sda1
e2fsck -f /dev/sda1
Другие способы не рекомендуются — потеряете поддержку TRIM. Также не стоит отключать журнал, добавляя параметр «writeback» в конфигурацию fstab — система не запустится из-за ошибки монтирования (если до этого был включен трим).
Следующее, что нужно учесть — файл подкачки. Под моим никсом (сейчас — убунту 11.04) обычно пишется код, смотрятся фильмы в HD и активно серфится интернет. За это время файл подкачки не понадобился ни разу, максимальное потребление ОЗУ было 1Гб, из 2х доступных в нетбуке.
Если Ваш сценарий использования системы подобен моему, или у Вас не десктоп — файл подкачки не нужен. Иначе стоит его перенести на HDD. Если журналирование еще можно оставить, ввиду его относительной безобидности, то своп-раздел — однозначно зло, сжирающее как ограниченные циклы перезаписи, так и недешевые гигабайты, количеством которых современные SSD пока не могут похвастаться.
Ну вот, система поставлена — можно заниматься оптимизацией! Самый первый шаг — включение TRIM — главная технология, которая должна продлить жизнь и распределить нагрузку SSD.
Делается очень просто — открываем fstab (например так)
gksudo gedit /etc/fstab
ищем строчки
«UUID=[NUMS-AND-LETTERS] / ext4 errors=remount-ro 0 1»
и заменяем на
«UUID=[NUMS-AND-LETTERS] / ext4 disсard,errors=remount-ro 0 1»
Обычно по умолчанию трим отключен, но выкладываю способ проверить — заходим под рут и выполняем команды
1. dd if=/dev/urandom of=tempfile count=10 bs=512k oflag=direct //запись 5Мб рандомных данных
2. hdparm —fibmap tempfile //Ищем любой стартовый LBA адрес у файла
3. hdparm —read-sector [ADDRESS] /dev/sdX //Читаем данные со стартового LBA адреса файла, замените [ADDRESS] на свой Starting LBA address из вывода предыдущей команды
4. rm tempfile //Теперь удалим временный файл и синхронизируем ФС:
5. sync
Повторяем пункт 3 — и смотрим на вывод консоли. Если выведутся нули — то трим работает. Если вы исправили fstab, перезагрузились, но трим не активировался — ищите ошибки в неверном отключении журналирования.
Далее стоит вспомнить о том, что наш никс очень любит вести разнообразные логи. И либо перенести их на HDD, либо держать в ОЗУ до перезагрузки системы. Я считаю, что если у Вас дома не сервер — то оптимален второй вариант, и реализуется он добавлением в fstab следующих строчек
tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
tmpfs /var/lock tmpfs defaults 0 0
tmpfs /var/spool/postfix tmpfs defaults 0 0
По умолчанию, после каждого открытия файла — система оставляет отметку времени последнего открытия — лишние операции записи. Отучить просто — добавить в fstab перед параметрами
disсard,errors=remount-ro 0
еще парочку опций —
relatime,nodiratime Первая разрешает записывать только время изменения (порой необходимо для стабильной работы некоторых программ), вторая — отменяет запись времени доступа к директориям. В принципе, вместо relatime можно поставить и noatime, который вообще ничего не будет обновлять.
После этого стоит настроить отложенную запись — ядро будет копить данные, ожидающие записи на диск, и записывать их либо при острой необходимости, либо по истечении таймаута. Я ставлю таймаут на 60 секунд, кто-то — на 150.
Для этого открываем /etc/sysctl.conf и добавляем параметры
vm.laptop_mode = 5 // Включение режима
vm.dirty_writeback_centisecs = 6000 время в сСк. Т.е. 100ед = 1секунда
И, напоследок, отключаем I/O планировщик, который был когда-то нужен для лучшего позиционирования головок HDD. Для этого заходит в конфиг граба /etc/default/grub
и в строчку
GRUB_CMDLINE_LINUX_DEFAULT=«quiet splash» вставляем параметр elevator=noop
По пути можно убрать ненужный и малоинформатиынй сплэш-скрин, сократив время старта системы еще на секунду, просто убрав quiet splash.
Вот, в общем основные моменты. Дальше стоит проявить фантазию — например, перенести куда-нибудь, или вовсе отключить кеш браузеров и тд. В награду за проделанные манипуляции Ваш SSD прослужит вам верой и правдой, и с каждым стартом будет радовать хорошей скоростью.
Источник
Рекомендации по использованию SSD в Linux
Твердотельные накопители удивительно быстры и лишены каких-либо механических частей, мобильны, что делает их бесшумными, поддерживают гораздо лучшую вибрацию и удары и не затрагивают (или почти не затрагивают) такие проблемы, как фрагментация файловой системы. Но, конечно, необходимо учитывать ряд особенностей, чтобы максимально увеличить пользу и продлить их жизнь.
Размеры разделов
Размеры разделов должны быть кратны 512 МБ. Кроме того, настоятельно рекомендуется создать раздел на жестком диске для хранения данных в /home. А также наличие как минимум двух разделов, где в одном мы будем хранить /boot, а остальное будет /.
Мы поставим /home на жесткий диск, из-за некоторых недостатков, которые приходят с дисками SSD, т.к. они теряют скорость записи, когда место на диске подходит к концу. Эта проблема исправляется с выходом новых драйверов, которые лучше управляют очисткой данных, но на данный момент она все еще существует.
Форматирование разделов
Более целесообразными являются следующие форматы:
- ext4 (рекомендуется)
- btrfs
- f2fs
- xfs
- jfs
Все эти форматы поддерживают TRIM. Зачем так важен TRIM? Потому что он позволяет операционной системе сообщать какие блоки данных не используются и могут быть удалены. Это имеет особое значение в случае твердотельных накопителей, поскольку флэш-память типа NAND, которые используют в SSD, не может перезаписать существующие данные. Прежде чем записывать новые данные поверх существующих, необходимо сначала их удалить. Эта проблема усугубляется тем, что минимальной единицей стирания является блок, так как единицей минимальной записи является страница (блок-64 страницы).
Это означает, что с течением времени диск SSD будет, определенным образом фрагментироваться внутри (не так, как традиционные жесткие диски), являясь страницами с пустыми блоками, которые в какой-то момент, даже когда у вас есть свободное пространство на SSD, не будут пустыми страницами для записи. Это снизит производительность, за счет которой для записи новых данных будет та группа блоков, которая рассредоточена, копируя их в буферную память, стирая и собирая вместе с ними все снова на одной странице.
При удалении файла ОС помечает его как удаленный в файловой системе, но не переданный на твердотельный диск. Именно поэтому TRIM, который, как мы уже говорили, отвечает за информирование твердотельного диска, который удаляется, помогает нам избежать вышеупомянутых проблем.
Конфигурация отделки
Сначала мы проверим, поддерживает ли наш SSD TRIM следующей командой:
# hdparm -I /dev/sdX | grep TRIM
Где X-буква вашего SSD. Ответ команды будет ясен, если он показывает вам что-то подобное, как на следующем скриншоте есть поддержка TRIM, если ничего не появляется у вас её нет.
Вы можете настроить TRIM тремя способами: вручную, настроив fstab и запланировав выполнение fstrim с помощью cron или systemd.
Вручную
Мы установим пакет fstrim:
# aptitude install fstrim
Выполните следующую команду, чтобы включить TRIM:
# fstrim -v [Точка монтирования]
В точке монтирования вы указываете, где монтируется наш SSD. Можно указать просто / (Root).
Настройка /etc/fstab
С помощью опции discard в файле fstab мы можем настроить наш SSD для использования TRIM. Просто добавить опцию как показано в примере ниже:
Планирование выполнения fstrim
Наиболее эффективным методом является запланированное выполнение fstrim, которое позволяет нам пользоваться его преимуществами без какого-либо влияния на производительность.
С помощью cron
Создаём следующий файл /etc/cron.daily/trim и добавляем в него:
Предоставление прав для выполнения:
# chmod +x /etc/cron.daily/trim
С использованием systemd
Если ваш Linux использует systemd, вы можете сделать это следующим образом. Сначала мы создаем файл в /lib/systemd/fstrim.service который содержит следующее:
Примечание: где / точка монтирования корня (root).
Используем systemctl для запуска службы:
# systemctl start fstrim
Монтирование разделов
Еще одна вещь, которую мы рассмотрим, это монтирование разделов. В конфигурационном файле /etc/fstab есть опция noatime для повышения производительности диска.
Использование параметров noatime, nodiratime или relatime может повысить производительность диска. По умолчанию Linux хранит запись (записывает на диск) каждого чтения, сделанного atime. Это полезно при использовании Linux для серверов, но не имеет большого значения при использовании для рабочего стола. Недостатком опции по умолчанию atime является то, что даже чтение файла из кэша памяти (чтение из памяти, а не с диска напрямую), даже в этом случае, он будет зарегистрирован! Использование параметра noatime полностью отключает обновление времени доступа к файлам при каждом чтении файла. Мы не добавляем два варианта noatime и nodiratime, потому что noatime уже включает nodiratime.
Временные каталоги
Также настройки временных каталогах (для/tmp, /VAR и/boot, в папке /var/lock и /var/log) в оперативной памяти, чтобы избежать записи на диск. Если у вас мало оперативной памяти, еще лучше иметь раздел на жестком диске на всю жизнь. Параметры монтирования noatime,nodiratime, nodev и nosuid.
Настройка GRUB: вход/выход планировщика
В целом, подавляющее большинство Linux используют CFQ для планирования устройств ввода / вывода. Однако для дисков SSD есть и другие варианты, которые являются более удачными:
- noop (рекомендуется)
- deadline
Если SSD будет единственным носителем информации компьютера, мы настроим GRUB изменяя файл /etc/default/grub.
Мы будем искать в файле что-то вроде «GRUB_CMDLINE_LINUX=»» и оставим его так же:
Сохраните изменения и обновите grub с помощью этой команды:
# update-grub
SWAP или без SWAP?
Если не волноваться за срок полезного использования, мы все равно можем настроить своп (в том случае, если у нас очень мало оперативной памяти) но с несколькими нюансами:
- Уменьшить процент использования SWAP/RAM 1%
- Уменьшить значение блоков данных кэша со 100 до 50
- Изменить частоту обращений к диску от 500 до 1500
Для этого мы модифицируем следующий файл /etc/sysctl.conf и меняем или добавляем эти значения:
Сокращение количества проверок файловых систем
Как известно, каждый раз при запуске система автоматически выполняет проверку файловых систем на предмет того, все ли в порядке.
Поскольку мы стремимся ограничить использование диска на SSD, было бы неплохо сделать чтобы эти проверки происходили реже, изменяя интервал времени или количество перезапусков, которые проходят между одним и другим.
С помощью tune2fs вы можете изменить это значение, а также сделать много других вещей, всегда указывая на раздел, на котором мы хотим действовать:
# tune2fs -c 80 /dev/sda1 (каждые 80 перезагрузок)
# tune2fs -i 2m /dev/sda1 (каждые 2 месяца)
# tune2fs -i 2w /dev/sda3 (каждые 2 недели)
# tune2fs -i 2d /dev/sda1 каждые 2 дня)
# tune2fs -l /dev/sdb1 (просмотр полной записи раздела)
# tune2fs -l /dev/sda3 | grep ‘Last checked’ (просмотр даты последнего сканирования)
# tune2fs -l /dev/sda3 | grep -i check (время проверки)
# tune2fs -i 0 /dev/sda3 (отключить проверку)
Испытание Скорости
С помощью команды hdparm-Tt /dev/sdX , мы можем сделать тест скорости записи, так что вы можете увидеть разницу я сделал два теста, один на SSD и другой на жестком диске. Вот результат:
/dev/sdb:
Timing cached reads: 2070 MB in 2.00 seconds = 1034.96 MB/sec
Timing buffered disk reads: 646 MB in 3.00 seconds = 215.11 MB/sec
/dev/sda:
Timing cached reads: 28842 MB in 2.00 seconds = 14435.64 MB/sec
Timing buffered disk reads: 1232 MB in 3.01 seconds = 409.76 MB/sec
Добавить комментарий Отменить ответ
Для отправки комментария вам необходимо авторизоваться.
Источник
Solid state drive
This article covers special topics for operating solid state drives (SSDs) and other flash-memory based storage devices. If you want to partition an SSD for a specific purpose, it may be useful to consider the List of file systems optimized for flash memory. For general usage, you should simply choose your preferred filesystem.
Contents
Usage
Most SSDs support the ATA_TRIM command for sustained long-term performance and wear-leveling. A TechSpot article shows performance benchmark examples of before and after filling an SSD with data.
As of Linux kernel version 3.8 onwards, support for TRIM was continually added for the different filesystems. See the following table for an indicative overview:
File system | Continuous TRIM ( discard option) | Periodic TRIM (fstrim) | References and notes |
---|---|---|---|
Btrfs | Yes | Yes | |
exFAT | Yes | Yes | fstrim is supported since kernel 5.13, [1] |
ext3 | Yes | Yes | |
ext4 | Yes | Yes | «discard, nodiscard(*)» in [2] |
F2FS | Yes | Yes | |
JFS | Yes | Yes | [3] |
NILFS2 | Yes | Yes | |
NTFS-3G | No | Yes | since version 2015.3.14, [4] |
VFAT | Yes | Yes | fstrim is supported since kernel 4.19, [5] |
XFS | Yes | Yes | [6] |
To verify TRIM support, run:
And check the values of DISC-GRAN (discard granularity) and DISC-MAX (discard max bytes) columns. Non-zero values indicate TRIM support.
Alternatively, install hdparm package and run:
Periodic TRIM
The util-linux package provides fstrim.service and fstrim.timer systemd unit files. Enabling the timer will activate the service weekly. The service executes fstrim(8) on all mounted filesystems on devices that support the discard operation.
The timer relies on the timestamp of /var/lib/systemd/timers/stamp-fstrim.timer (which it will create upon first invocation) to know whether a week has elapsed since it last ran. Therefore there is no need to worry about too frequent invocations, in an anacron-like fashion.
To query the units activity and status, see journalctl. To change the periodicity of the timer or the command run, edit the provided unit files.
Continuous TRIM
Instead of issuing TRIM commands once in a while (by default once a week if using fstrim.timer ), it is also possible to issue TRIM commands each time files are deleted instead. The latter is known as the continuous TRIM.
Using the discard option for a mount in /etc/fstab enables continuous TRIM in device operations:
On the ext4 filesystem, the discard flag can also be set as a default mount option using tune2fs:
Using the default mount options instead of an entry in /etc/fstab is particularly useful for external drives, because such partition will be mounted with the default options also on other machines. This way, there is no need to edit /etc/fstab on every machine.
Trim an entire device
If you want to trim your entire SSD at once, e.g. for a new install, or you want to sell your SSD, you can use the blkdiscard command, which will instantly discard all blocks on a device.
TRIM requests that get passed from the file system to the logical volume are automatically passed to the physical volume(s). No additional configuration is necessary.
No LVM operations (lvremove, lvreduce and all others) issue TRIM requests to physical volume(s) by default. This is done to allow restoring previous volume group configuration with vgcfgrestore(8) . The setting issue_discards in /etc/lvm/lvm.conf controls whether discards are sent to a logical volume’s underlying physical volumes when the logical volume is no longer using the physical volumes’ space.
dm-crypt
For non-root filesystems, configure /etc/crypttab to include discard in the list of options for encrypted block devices located on an SSD (see dm-crypt/System configuration#crypttab).
For the root filesystem, follow the instructions from dm-crypt/Specialties#Discard/TRIM support for solid state drives (SSD) to add the right kernel parameter to the bootloader configuration.
Maximizing performance
Follow the tips in Improving performance#Storage devices to maximize the performance of your drives.
Native sector size
This article or section is a candidate for merging with Advanced Format.
Most SSDs report their sector size as 512 bytes, even though they use larger sectors — typically 4 kB, 8 kB, or sometimes larger. Because they report as 512 byte devices, filesystems cannot automatically optimise for the native sector size and this must be manually specified when creating a filesystem to avoid suboptimal performance.
As an alternative to manually overriding the autodetected sector size, some SSDs can have their sector size changed during formatting, so that they report a number closer to their true sector size.
To see whether a given NVMe device supports this, use the Identify Namespace command.
nlbaf is the number of LBA formats minus 1, so here there is only one format supported. The list of formats is at the end of the output. Here lbaf 0 means LBA format #0. It has an lbads (LBA data size) of 9, which means sectors are 2 9 or 512 bytes. If the device is capable of 4 kB sectors, there will be another entry here with an lbads of 12. The rp (Relative Performance) value indicates which format will provide the best performance, with 0 being the best. ms is (probably) the number of extra metadata bytes per sector, and this is not well supported under Linux so best to select a format with a value of 0 here.
To change the sector size, use nvme format and specify the preferred value with the —lbaf parameter.
For SATA devices, manufacturer specific programs must be used. Not all SATA devices support having the sector size changed.
SSD memory cell clearing
On occasion, users may wish to completely reset an SSD’s cells to the same virgin state they were at the time the device was installed thus restoring it to its factory default write performance. Write performance is known to degrade over time even on SSDs with native TRIM support. TRIM only safeguards against file deletes, not replacements such as an incremental save.
The reset is easily accomplished in a three step procedure denoted on the SSD memory cell clearing wiki article. If the reason for the reset is to wipe data, you may not want to rely on the SSD bios to perform it securely. See Securely wipe disk#Flash memory for further information and examples to perform a wipe.
Security
Hdparm shows «frozen» state
Some motherboard BIOS’ issue a «security freeze» command to attached storage devices on initialization. Likewise some SSD (and HDD) BIOS’ are set to «security freeze» in the factory already. Both result in the device’s password security settings to be set to frozen, as shown in below output:
Operations like formatting the device or installing operating systems are not affected by the «security freeze».
The above output shows the device is not locked by a HDD-password on boot and the frozen state safeguards the device against malwares which may try to lock it by setting a password to it at runtime.
If you intend to set a password to a «frozen» device yourself, a motherboard BIOS with support for it is required. A lot of notebooks have support, because it is required for hardware encryption, but support may not be trivial for a desktop/server board. For the Intel DH67CL/BL motherboard, for example, the motherboard has to be set to «maintenance mode» by a physical jumper to access the settings (see [10], [11]).
If you intend to erase the SSD, see Securely wipe disk#hdparm and #SSD memory cell clearing below.
Hardware encryption
As noted in #Hdparm shows «frozen» state setting a password for a storage device (SSD/HDD) in the BIOS may also initialize the hardware encryption of devices supporting it. If the device also conforms to the OPAL standard, this may also be achieved without a respective BIOS feature to set the passphrase, see Self-encrypting drives.
Troubleshooting
It is possible that the issue you are encountering is a firmware bug which is not Linux specific, so before trying to troubleshoot an issue affecting the SSD device, you should first check if updates are available for:
Even if it is a firmware bug it might be possible to avoid it, so if there are no updates to the firmware or you hesitant on updating firmware then the following might help.
Resolving NCQ errors
Some SSDs and SATA chipsets do not work properly with Linux Native Command Queueing (NCQ). The tell-tale dmesg errors look like this:
To disable NCQ on boot, add libata.force=noncq to the kernel command line in the bootloader configuration. To disable NCQ only for disk 0 on port 9 use: libata.force=9.00:noncq
Alternatively, you may disable NCQ for a specific drive without rebooting via sysfs:
If this (and also updating the firmware) does not resolve the problem or causes other issues, then file a bug report.
Resolving SATA power management related errors
Some SSDs (e.g. Transcend MTS400) are failing when SATA Active Link Power Management, ALPM, is enabled. ALPM is disabled by default and enabled by a power saving daemon (e.g. TLP, Laptop Mode Tools).
If you are starting to encounter SATA related errors when using such a daemon, you should try to disable ALPM by setting its state to max_performance for both battery and AC powered profiles.
External SSD with TRIM support
This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.
Several USB-to-SATA bridge chips (like VL715, VL716 etc.) and also USB-to-PCIe bridge chips (like the JMicron JMS583 used in external NVMe enclosures like IB-1817M-C31) support TRIM-like commands that can be sent through the USB Attached SCSI driver (named «uas» under Linux).
But the kernel may not automatically detect this capability, and therefore might not use it. Assuming your block device in question is /dev/sdX, you can find out whether that is the case by using the command
If in its output you find a line stating «Logical block provisioning: lbpme=0» then you know that the kernel assumes the device does not support «Logical Block Provisioning Management» because the (LBPME) bit is not set.
If this is the case, then you should next find out whether the «Vital Product Data» (VPD) page on «Logical Block Provisioning» of your device tells of supported mechanisms for unmapping data. You can do this using the command:
Look for lines in the output that look like this:
This example would tell you the device supports the «UNMAP» command.
Have a look at the output of
If the kernel did not detect the capability of your device to unmap data, then this will likely return «full». Apart from «full», the kernel SCSI storage driver currently knows the following values for provisioning_mode:
For the example above, you could now write «unmap» to «provisioning_mode» to ask the kernel to use that:
This should immediately enable you to use tools like «blkdiscard» on /dev/sdX or «fstrim» on filesystems mounted on /dev/sdX.
If you want to enable a «provisioning_mode» automatically when an external device of a certain vendor/product is attached, this can be automated via the «udev» mechanism. First find the USB Vendor and Product IDs:
Then create or append to a udev rule file (example here using idVendor 152d and idProduct 0583):
(You can also use the lsusb command to look for the relevant idVendor / idProduct.)
Firmware
ADATA
ADATA has a utility available for Linux (i686) on their support page. The link to latest firmware will appear after selecting the model. The latest Linux update utility is packed with firmware and needs to be run as root. One may need to set correct permissions for binary file first.
Crucial
Crucial provides an option for updating the firmware with an ISO image. These images can be found after selecting the product on their SSD support page and downloading the «Manual Boot File.»
Owners of an M4 Crucial model, may check if a firmware upgrade is needed with smartctl .
Users seeing this warning are advised to backup all sensible data and consider upgrading immediately. Check this instructions to update Crucial MX100 firmware by using the ISO image and Grub.
Intel
Intel has a Linux live system based Firmware Update Tool for operating systems that are not compatible with its Windows Intel® Memory and Storage Tool (GUI) software.
There is also a newer Linux command-line utility that can reflash firmware called the Intel Memory and Storage (MAS) Tool available in the AUR as intel-mas-cli-tool AUR . There is a PDF user guide available.
An example for checking the firmware status is:
-intelssd 0 can be omitted if there is only one Intel SSD in the system, or 1 passed for the second SSD, and so on.
If an update is available, it is performed by running intelmas load -intelssd 0 . The PDF user guide suggests that this procedure needs to be performed twice in Linux, with a power cycle in between. The latest firmware for all devices is distributed as part of the MAS Tool itself, so does not need to be downloaded separately.
Kingston
KFU tool is available on the AUR for the Sandforce based drives, kingston_fw_updater AUR .
Mushkin
The lesser known Mushkin brand solid state drives also use Sandforce controllers, and have a Linux utility (nearly identical to Kingston’s) to update the firmware.
Samsung
Although Samsung deems firmware update methods outside of their Magician software as «unsupported», they still can work. The Magician software can create a bootable USB drive containing the firmware update. Samsung also provides pre-made bootable ISO images that can be used to update the firmware. Another option is to use Samsung’s magician utility provided by samsung_magician-consumer-ssd AUR . Magician only supports Samsung-branded SSDs; those manufactured by Samsung for OEMs (e.g., Lenovo) are not supported.
Users preferring to run the firmware update from a live USB created under Linux (without using Samsung’s Magician software under Microsoft Windows) can refer to [12] for more details.
Update under Linux
The SSD firmware can be updated natively (without making a bootable USB stick) as shown below. First visit the Samsung downloads page, go to the «Samsung SSD Firmware» section, and download the latest firmware for your SSD—it should be an ISO image.
Extract the initrd Linux image from the ISO image:
Extract root/fumagician/ . This directory contains the firmware update files:
Finally, run root/fumagician/fumagician with root privileges and reboot your system (if the firmware was successfully updated).
Older SSDs
Some of the SSD firmware ISO images contain a FreeDOS image instead of an initrd Linux image, so the steps needed to update the SSD firmware differ from above. The following table lists these SSDs (and relevant paths):
SSD model | FreeDOS image path | Firmware package path |
---|---|---|
470, 830 | BTDSK.IMG | SSR/ |
840 | isolinux/btdsk.img | samsung/DSRD/ |
840 EVO (mSATA), Pro | ISOLINUX/BTDSK.IMG |
First, extract the FreeDOS image from the ISO image:
Mount the FreeDOS image to /mnt/ :
Get the disk number of the SSD under Disk Number from the Magician SSD management utility:
Update the SSD firmware for the specified disk by providing the firmware package path:
Finally, verify whether the firmware was successfully updated by checking the version under Firmware from the output of magician —list (with root privileges). Reboot your system if so.
SanDisk
SanDisk makes ISO firmware images to allow SSD firmware update on operating systems that are unsupported by their SanDisk SSD Toolkit.
One must choose the firmware for the correct SSD model, and the correct capacity that it has (e.g. 60GB, or 256GB). After burning the ISO firmware image, simply restart the PC to boot with the newly created CD/DVD boot disk (may work from a USB stick).
The iso images just contain a linux kernel and an initrd. Extract them to /boot partition and boot them with GRUB or Syslinux to update the firmware.
Источник