На данный момент нет возможности настроить параметр монтирования luks-разделов --allow-discards. Поэтому практически невозможно использовать корневой раздел на ssd без использования обходных путей типа: diff --git a/data/lib/initrd/handlers/050-luks b/data/lib/initrd/handlers/050-luks index 6a013ff..7deac8b 100755 --- a/data/lib/initrd/handlers/050-luks +++ b/data/lib/initrd/handlers/050-luks @@ -63,11 +63,11 @@ handler() { if [ -n "${LUKS_KEY-}" ]; then findkey "$nameluks" readkey "$nameluks" | - cryptsetup --allow-discards -d- luksOpen "$LUKS_ROOT" "$nameluks" + cryptsetup -d- luksOpen "$LUKS_ROOT" "$nameluks" else rc=2 while [ "$rc" = 2 ]; do - cryptsetup --allow-discards -d- luksOpen "$LUKS_ROOT" "$nameluks" + cryptsetup -d- luksOpen "$LUKS_ROOT" "$nameluks" rc="$?" done fi
Спасибо! А можно ещё дооформить патч до коммита и приложить? (git format-patch HEAD^ в помощь)
Created attachment 6928 [details] Патч для установки параметра по умолчанию.
Просьба проверить http://webery.altlinux.org/task/176003 после сборки. На всякий цитирую соответствующие фрагменты cryptsetup(8): --- WARNING: Option --allow-discards cannot be combined with option --tcrypt-hidden. For normal mapping it can cause destruction of hidden volume (hidden volume appears as unused space for outer volume so this space can be discarded). [...] --allow-discards Allow the use of discard (TRIM) requests for device. This option is only relevant for open action. WARNING: This command can have a negative security impact because it can make filesystem-level operations visible on the physical device. For example, information leaking filesystem type, used space, etc. may be extractable from the physical device if the discarded blocks can be located later. If in doubt, do not use it. A kernel version of 3.1 or later is needed. For earlier kernels this option is ignored. ---
Я бы сделал флаг, который высталяется через initrd.mk или же позволить передавать произвольные параметры.
2.0.7-alt1 - Add initrd-extract to split initramfs. - Add feature to save information about generated initramfs. - Feature make-initrd-ucode requires cpio (ALT#34270). - LUKS feature changes: + Add luks-ignore option (thx Vladimir D. Seleznev). + Add luks-discard option (thx Vladimir D. Seleznev). + Add support for xts blockcipher (thx Vladimir D. Seleznev). + Add luks-key-format option.