Quantcast
Viewing latest article 6
Browse Latest Browse All 10

Arch Linux on Mac Pro with Luks Full Disk Encryption

You need: OS X Install CD (I used a copy of Snow Leopard), Arch Linux net install CD

1. Boot into Arch. Wipe hard drive, for example with #badblocks -c 10240 -wsvt random /dev/sda

2. #parted , set partition type to “msdos” (instead of “GPT”)

3. #cfdisk /dev/sda , add /dev/sda1 size 1024M , bootable, type 83 (linux) (for /boot); add /dev/sda2 size 8024M, type 82 (swap); add /dev/sda3 size XXXG , type 83 (linux) for / . Save partition table.

4. Reboot into OS X install DVD. Open terminal. #bless --device /dev/disk0sX --setBoot --legacy --verbose …. where “X” is the number for your /boot partition you created. You can find it by doing #diskutil list . Now your mac is configured to boot from /boot .

5. Boot into Arch CD. Set up encrypted swap volume: #cryptsetup -c aes-xts-plain -s 512 -h sha512 -v luksFormat /dev/sda2 (put your passphrase in)… Set up encrypted root volume: #cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda3 (put your passphrase in)

6. Set up mappers for crypt volumes in /dev: #cryptsetup luksOpen /dev/sda3 root … #cryptsetup luksOpen /dev/sda2 swapDevice

7. Create swap on swapDevice: #mkswap /dev/mapper/swapDevice

8. edit /lib/initcpio/hooks/openswap:

# vim: set ft=sh:
run_hook ()
{
cryptsetup luksOpen /dev/sda2 swapDevice
}

9. edit /lib/initcpio/install/openswap:

# vim: set ft=sh:
build ()
{
MODULES=""
BINARIES=""
FILES=""
SCRIPT="openswap"
}
help ()
{
cat <<HELPEOF
This opens the encrypted swap partition /dev/sda2 on swapDevice mapper.
HELPEOF
}

10. Edit /etc/mkinitcpio.conf; add “openswap” before “filesystems” but after “encrypt”. Add “resume” between “openswap” and “filesystems”. Should look something like this: HOOKS="base udev autodetect pata scsi sata usb usbinput keymap encrypt openswap resume filesystems"

11. Install arch with /arch/setup , and use /dev/mapper/root for / and /dev/mapper/swapDevice for your swap . Use /dev/sda1 for /boot . I use XFS for / .

12. When it comes time to modify the config files after installing packages, modify mkinitcpio.conf like above. Also set MODULES=”xfs” for whatever filesystem you used for /.

13. When it comes time to set up the bootloader grub, make this change to your grub config: kernel /vmlinuz-linux cryptdevice=/dev/sda3:root root=/dev/mapper/root resume=/dev/mapper/swapDevice ro

14. Install grub on /dev/sda

15. reboot. You’ll be asked twice for your luks keyphrase.. one for swap and one for root.

16. #pacman –sync –refresh

17. #pacman -Syu xorg-server
18. #pacman -S xorg-xinit xterm fluxbox xorg-utils xorg-server-utils xf86-video-ati chromium mesa-demos artwiz-fonts bdf-unifont cantarell-fonts font-bitstream-speedo font-misc-ethiopic font-misc-meltho ftgl gsfonts xpdf xv gv ttf-cheapskate ttf-bitstream-vera ttf-freefont ttf-linux-libertine xorg-xlsfonts

18a. edit ~/.xinitrc , make it executable.

#!/bin/sh

xset +fp /usr/share/fonts/local
xset fp rehash
nitrogen -restore
dropbox start
pidgin
exec startfluxbox

19. edit /etc/pacman.conf and uncomment the multilib section for 32bit support . #pacman –sync –refresh

19a. edit /etc/inittab … make SLIM do the login instead of text login .. by uncommenting x:5:respawn:/usr/bin/slim >/dev/null 2>&1 and commenting the other xdm line. Change id:5:initdefault: to be uncommented, comment out init level 3 initdefault. edit slim themes by editing /etc/slim.conf change current_theme line to whatever : current_theme fingerprint,default,rear-window,subway,wave,lake,flat,capernoited … for example.

20. #pacman -S dina-font font-mathematica terminus-font profont zsh vim slim slim-themes archlinux-themes-slim alsa-utils alsa-tools alsamixer thunderbird pidgin gtk-theme-switch2 gtk-engines nautilus rsync gnupg irssi flashplugin nitrogen xlockmore dnsutils wget glib wine gpgme cups ntp skype vpnc scrot xclip … etc etc

To update your system from time to time… do pacman -Syu


Viewing latest article 6
Browse Latest Browse All 10

Trending Articles