При загрузке Linux Linux монтирует файловую систему из раздела шифрования, как?

1102
Lyric

У моей SD-карты есть два раздела, один - загрузочный, а другой - файловая система, теперь я использую инструмент linux cryptsetup для шифрования раздела файловой системы, при загрузке на моей плате ядро ​​не может смонтировать файловую систему (шифровать), моя цель - Чтобы защитить всю файловую систему, может быть, три раздела может быть достигнуто, если у меня есть только два раздела, можно ли достичь этого? Нужно изменить исходный код ядра?

0

1 ответ на вопрос

0
davidgo

You have not advised the distro you are using, and this makes a difference. It is definitely possible to do "full disk" encryption with 2 partitions under Linux, and I know that it can be done with Ubuntu. (Not sure if the default install does it, I think it does, otherwise you can get an alternate disk which does). I'd imagine there is a Spin for Fedora or CentOS as well.

The mechanism used to achieve this is as follows:

  1. Create (or let the system create for you) 2 partitions, a small "boot" partition, typically about 200 megs, and a large partition for encryption. (You need to work out if you want an additional partition for swap, or if you want to mount swap encrypted either using LVM or as a file - there are advantages to each, but for security you would take a performance hit and mount it on the encrypted partition)

  2. Your OS will put the bare minimum it needs to boot on the boot partition (which will typically be /boot). While this is unencrypted, it only contains "stock files".

  3. The install then typically builds/recreates an initial ramdisk (initrd), which includes the files and commands needed to prompt for a password, decrypt the system and remount it as root.

загрузочный раздел, который я поместил в мои файлы boot.scr, MLO, u-boot.bin, u-boot.image, uImage и initrd (включая команду cryptsetup и т. д.), второй раздел, в который я поместил мою файловую систему шифрования (включая rootfs, некоторые библиотеки, приложения и т.д.), верно? Lyric 11 лет назад 0
Не знаю точно, что вы кладете на / boot (мой дистрибутив не использует boot.scr, MLO, u-boot. *, Скорее он использует Grub, ядро ​​и initramfs (Centos) или initrd (Ubuntu), но да, это правильная идея. davidgo 11 лет назад 0
Можете ли вы сказать мне шаг make initrd? чем больше подробностей, тем лучше. Я использую kernel3.4 на встроенном устройстве Linux. Lyric 11 лет назад 0