Public
ArchLinux 2012.7.15 UEFI+GPT+LVM+LUKS on an Asus EeePc 1215b
aka "It's-Been-Too-Long-Since-I-Last-Broke-My-Computer Weekend Project"
There's a bug when running 'efibootmgr' to add an entry to the EFI Boot Manager which throws a kernel panic on this computer. Consequently the EFI Shell has to be started manually from the BIOS "Launch EFI Shell from filesystem device".
I'm hoping I can use the EFI Shell 'bcfg' command to add an entry to the efi boot manager, but I haven't figured that out yet.
# Install Arch ISO on usb flash drive
dd if=archlinux.iso of=/dev/sdb
# Convert the disk to GPT using cgdisk
- Create a 512MB - 1 GB UEFI partition (gdisk Hex code ef00) /dev/sda1
- Create a Linux LVM partition (gdisk Hex code 8300) /dev/sda2
# LUKS full disk encryption
modprobe dm_mod
cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/sda2
cryptsetup luksOpen /dev/sda2 root
# LVM
pvcreate /dev/mapper/root
vgcreate root /dev/mapper/root
lvcreate -C y -L 4G root -n swap
lvcreate -L 32G root -n root
lvcreate -l +100%FREE root -n home
# Format
mkfs.vfat -F32 /dev/sda1
mkswap -L swap /dev/root/swap
mkfs.ext4 /dev/root/root
mkfs.ext4 /dev/root/home
# Mount
mount /dev/root/root /mnt
mkdir /mnt/home
mount /dev/root/home /mnt/home
mkdir /dev/sda1 /mnt/boot
# Connect to the internet
ip link set wlan0 up
wpa_passphrase <ssid> <key> > ~/wpa.conf
wpa_supplicant -i wlan0 -c ~/wpa.conf -B
dhcpcd
# Install Arch and GRUB2
pacstrap /mnt base base-devel grub-efi-x86_64
# Configure
genfstab -p -U /mnt > /mnt/etc/fstab
arch-chroot /mnt
# Remove codepage=437 from the options in fstab /boot
# Set rc.conf USELVM="yes"
echo <hostname> > /etc/hostname
echo LANG="en_US.UTF-8" > /etc/locale.conf
# Uncomment your locale in /etc/locale.gen
locale-gen
# Configure mkinitcpio.conf
- Add vfat to the modules array
- Add 'encrypt lvm2' before filesystem in the hooks array
mkinitcpio - linux
passwd
# Configure GRUB2
modprobe efivars
# Edit /etc/default/grub
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:root root=/dev/root/root ro
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug
mkdir -p /boot/efi/EFI/grub/locale
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo/boot/efi/EFI/grub/locale/en.mo
cp /boot/efi/EFI/arch_grub/grubx64.efi /boot/shellx64.efi
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg
# Finish
exit
umount /mnt/{boot,home,}
restart
#archlinux #uefi #linux #lvm2 #encrypt
aka "It's-Been-Too-Long-Since-I-Last-Broke-My-Computer Weekend Project"
There's a bug when running 'efibootmgr' to add an entry to the EFI Boot Manager which throws a kernel panic on this computer. Consequently the EFI Shell has to be started manually from the BIOS "Launch EFI Shell from filesystem device".
I'm hoping I can use the EFI Shell 'bcfg' command to add an entry to the efi boot manager, but I haven't figured that out yet.
# Install Arch ISO on usb flash drive
dd if=archlinux.iso of=/dev/sdb
# Convert the disk to GPT using cgdisk
- Create a 512MB - 1 GB UEFI partition (gdisk Hex code ef00) /dev/sda1
- Create a Linux LVM partition (gdisk Hex code 8300) /dev/sda2
# LUKS full disk encryption
modprobe dm_mod
cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/sda2
cryptsetup luksOpen /dev/sda2 root
# LVM
pvcreate /dev/mapper/root
vgcreate root /dev/mapper/root
lvcreate -C y -L 4G root -n swap
lvcreate -L 32G root -n root
lvcreate -l +100%FREE root -n home
# Format
mkfs.vfat -F32 /dev/sda1
mkswap -L swap /dev/root/swap
mkfs.ext4 /dev/root/root
mkfs.ext4 /dev/root/home
# Mount
mount /dev/root/root /mnt
mkdir /mnt/home
mount /dev/root/home /mnt/home
mkdir /dev/sda1 /mnt/boot
# Connect to the internet
ip link set wlan0 up
wpa_passphrase <ssid> <key> > ~/wpa.conf
wpa_supplicant -i wlan0 -c ~/wpa.conf -B
dhcpcd
# Install Arch and GRUB2
pacstrap /mnt base base-devel grub-efi-x86_64
# Configure
genfstab -p -U /mnt > /mnt/etc/fstab
arch-chroot /mnt
# Remove codepage=437 from the options in fstab /boot
# Set rc.conf USELVM="yes"
echo <hostname> > /etc/hostname
echo LANG="en_US.UTF-8" > /etc/locale.conf
# Uncomment your locale in /etc/locale.gen
locale-gen
# Configure mkinitcpio.conf
- Add vfat to the modules array
- Add 'encrypt lvm2' before filesystem in the hooks array
mkinitcpio - linux
passwd
# Configure GRUB2
modprobe efivars
# Edit /etc/default/grub
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:root root=/dev/root/root ro
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug
mkdir -p /boot/efi/EFI/grub/locale
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo/boot/efi/EFI/grub/locale/en.mo
cp /boot/efi/EFI/arch_grub/grubx64.efi /boot/shellx64.efi
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg
# Finish
exit
umount /mnt/{boot,home,}
restart
#archlinux #uefi #linux #lvm2 #encrypt
Add a comment...