Я пытаюсь установить Kubuntu 19.04 на зашифрованном системном диске с LUKS. Концы установки, но GRUB не просит пароль, и система не загрузится.
Я нашел несколько других вопросов об этом, но они приводят к битым ссылкам или говорят мне устанавливать CRYPTFS=y
и выполненный update-initramfs
. Я думаю, что это уже - значение по умолчанию в Ubuntu 19.04, но я попробовал его так или иначе, и это не работает.
Как я могу заставить GRUB попросить пароль на начальной загрузке?
/dev/sda1
: /boot/efi
, незашифрованный/dev/sda2
: /boot
, незашифрованный/dev/sda3
, /dev/mapper/cryptroot
: /
, зашифрованныйcryptdevice=UUID=6d5b5f47-58e8-4a9c-89c8-4f503f35ff3f:cryptroot root=/dev/mapper/cryptroot
кому: /etc/default/grub
и работал update-grub
в chrootДисковое использование раздела sudo fdisk /dev/sda
/dev/sda1
: Система EFI/dev/sda2
: Файловая система Linux/dev/sda3
: Файловая система LinuxWelcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x087d3a28.
Command (m for help): g
Created a new GPT disklabel (GUID: 73F157B8-7425-7844-AE8E-3A46EF2ED5A4).
Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-20971486, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-20971486, default 20971486): +128M
Created a new partition 1 of type 'Linux filesystem' and of size 128 MiB.
Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 1
Changed type of partition 'Linux filesystem' to 'EFI System'.
Command (m for help): n
Partition number (2-128, default 2):
First sector (264192-20971486, default 264192):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (264192-20971486, default 20971486): +512M
Created a new partition 2 of type 'Linux filesystem' and of size 512 MiB.
Command (m for help): n
Partition number (3-128, default 3):
First sector (1312768-20971486, default 1312768):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1312768-20971486, default 20971486):
Created a new partition 3 of type 'Linux filesystem' and of size 9.4 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
Зашифруйте корневое использование раздела sudo cryptsetup -y -v luksFormat --type luks2 /dev/sda3
sudo cryptsetup open /dev/sda3 cryptroot
sudo mkfs.vfat /dev/sda1
sudo mkfs.ext4 /dev/sda2
sudo mkfs.ext4 /dev/mapper/cryptroot
/dev/sda1
, /dev/sda2
и /dev/mapper/cryptroot
)Chroot в установленный Kubuntu:
Смонтируйте выбранные устройства:
sudo mount /dev/mapper/cryptroot /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /sys /mnt/sys
sudo mount --bind /proc /mnt/proc
sudo mount /dev/sda2 /mnt/boot
Введите chroot: sudo chroot /mnt
Скорректируйте параметры ядра (/etc/default/grub
):
GRUB_CMDLINE_LINUX="cryptdevice=UUID=6d5b5f47-58e8-4a9c-89c8-4f503f35ff3f:cryptroot root=/dev/mapper/cryptroot"
Я также попробовал:
GRUB_CMDLINE_LINUX="rd.luks.name=6d5b5f47-58e8-4a9c-89c8-4f503f35ff3f=cryptroot root=/dev/mapper/cryptroot"
Выполненный update-grub
Перезагрузка, когда я загружаюсь без quiet
Я вижу следующий вывод:
[some other output]
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... done.
done.
Gave up waiting for root file system device. Common problems:
- Boot args (cat /proc/cmdline)
- Check rootdelay= (did the system wait long enough?)
- Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/mapper/cryptroot does not exist. Dropping to a shell!
[BusyBox shell]
Хорошо, я просто пропустил один единственный шаг, который я нашел здесь .
В основном, находясь в chroot, мне пришлось создать /etc/crypttab
со следующим содержимым:
cryptroot UUID=6d5b5f47-58e8-4a9c-89c8-4f503f35ff3f none luks
И затем запустить update-initramfs -u -k all
.