You are not logged in.
I have a Macbook Pro (mid 2012) on which I am attempting to dual boot OS X and arch. I have installed arch on its own partition, and - using dm-crypt - I have encrypted the entire arch partition with an LVM on LUKS structure. I followed this dm-crypt arch wiki and was able to set up the encryption and complete the install of arch without issue. However, I skipped the preparing the boot partition section of the dm-crypt arch wiki (as well as the install and configure a bootloader section of the beginner's install guide). The reason is that I instead followed this part of the macbook arch wiki in order to install grub to the Macbook's preexisting efi partition (I want to boot arch by default and be able to boot OS X by holding option at bootup - I am attempting to avoid rEFInd). For those who are tired of clicking on links, here is what I did to set up grub on my efi partition, /dev/sda1 (I had already installed grub from arch repos at this point):
# mkdir -p /mnt/boot/efi
# mount -t vfat /dev/sda1 /mnt/boot/efi
# arch-chroot /mnt /bin/bash
# modprobe dm-mod
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug
# mkdir -p /boot/grub/locale
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
[Edit: the above commands have been corrected from my original post - I forgot to include the switch into chroot /mnt environment (at this point in the install I had already mounted my other partitions)]
I then editted /etc/default/grub and added my cryptsetup and root kernel parameters (as specified in the arch dm-crypt wiki) following the example of the arch kernel parameters wiki, and I ran
# grub-mkconfig -o /boot/grub/grub.cfg
Once I finished the install and rebooted the system, however, grub started but immediately gave an error and dropped into a rescue terminal:
error: no such device: a1ab5dcd-190a-4b15-9861-227a875d1149
Entering rescue mode...
grub rescue>
For the record, here are what my partitions look like:
Device Type
/dev/sda1 EFI System ### this is my boot partition
/dev/sda2 Apple HFS/HFS+ ### this is my main OS X partition
/dev/sda3 Apple HFS/HFS+ ### this is my OS X recovery HD partition
/dev/sda4 Linux filesystem ### this is my encrypted arch partition (decrypted at the time of fdisk -l, of course)
The UUID from the grub error message is not the correct UUID for my logical root volume. In fact, as far as I can tell, it is not the correct UUID for any volume. I took a look at /boot/grub/grub.cfg, and for some reason it was littered with the incorrect UUID. I replaced all instances of the incorrect UUID in /boot/grub/grub.cfg with my root UUID that I pulled from fstab. However, when I rebooted I got the same error message and grub rescue terminal. I booted back into the arch live cd, and checked /boot/grub/grub.cfg, and found that somehow it had changed and was again littered with a UUID that does not correspond to my root UUID.
I am fairly confident that the arch install is solid, if I could just boot into it. Clearly I am missing something with regard to getting grub to function properly. I appreciate any insights or suggestions that you can offer.
Last edited by Olorin (2015-01-01 04:57:00)
Offline
Your encrypted partition will have two UUIDs. The first is the "visable" one for the partition (i.e. /dev/sda4). The other is the "hidden" UUID for the encrypted layer, which will not be visable to the system or anyone else until decryption has taken place. This is identified via "/dev/mapper/<name>" rather than "/dev/sdxY". As such, I suspect that your grub is using the hidden encrypted UUID (as it should), but cannot find it because the partition itself has not been decrypted during the bootup process. As such, please post the content of:
1. /etc/mkinitcpio.conf (should have the encrypt hook listed)
2. /etc/fstab (shoud list the UUID / mapper path for the encrypted partition)
3. /etc/default/grub (should have the cryptdevice= parameter listed, and insmod luks)
4. /boot/grub/grub.cfg
5. blkid outputs for both /dev/sda4 and /dev/mapper/<whatever you called the partition>
Edit: See This for more information, too.
Last edited by CarlD (2014-12-29 13:01:31)
Offline
(0) Before checking the output of the files you mentioned, I mounted my encrypted volumes and set myself up (from the arch live cd) in a chroot environment in the following fashion (note that my volume group is named Harbinger and my logical volumes are rootvol, homevol, and swapvol):
# cryptsetup open --type luks /dev/sda4 lvm
# mount /dev/Harbinger/rootvol /mnt
# mount /dev/Harbinger/homevol /mnt/home
# swapon /dev/Harbinger/swapvol
# mount -t vfat /dev/sda1 /mnt/boot/efi
# arch-chroot /mnt /bin/bash
(1) /etc/mkinitcpio.conf
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run. Advanced users may wish to specify all system modules
# in this array. For instance:
# MODULES="piix ide_disk reiserfs"
MODULES=""
# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image. This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=""
# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way. This is useful for config files.
FILES=""
# HOOKS
# This is the most important setting in this file. The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
## This setup specifies all modules in the MODULES setting above.
## No raid, lvm2, or encrypted root is needed.
# HOOKS="base"
#
## This setup will autodetect all modules for your system and should
## work as a sane default
# HOOKS="base udev autodetect block filesystems"
#
## This setup will generate a 'full' image which supports most systems.
## No autodetection is done.
# HOOKS="base udev block filesystems"
#
## This setup assembles a pata mdadm array with an encrypted root FS.
## Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
# HOOKS="base udev block mdadm encrypt filesystems"
#
## This setup loads an lvm2 volume group on a usb device.
# HOOKS="base udev block lvm2 filesystems"
#
## NOTE: If you have /usr on a separate partition, you MUST include the
# usr, fsck and shutdown hooks.
HOOKS="base udev autodetect keyboard modconf block encrypt lvm2 filesystems fsck"
# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"
# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=""
(2) /etc/fstab [Edit: my originally posted fstab was incorrect - I had generated it before mounting my efi partition. However, replacing my fstab with the corrected version did not solve the problem]
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/Harbinger-rootvol
UUID=de69fec6-e3af-45fd-9bb7-6b9c2207fce7 / ext4 rw,relatime,data=ordered 0 1
# /dev/mapper/Harbinger-homevol
UUID=c0729f5c-e54f-4ff6-b167-236dcfa3f1c0 /home ext4 rw,relatime,data=ordered 0 2
# /dev/sda1 LABEL=EFI
UUID=67E3-17ED /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2
# /dev/mapper/Harbinger-swapvol
UUID=71ae5f52-93fa-41ea-8dd6-10948ffbb13e none swap defaults 0 0
(3) /etc/default/grub
GRUB_DEFAULT=0
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet cryptdevice=/dev/sda4:Harbinger root=/dev/mapper/Harbinger-rootvol"
GRUB_CMDLINE_LINUX=""
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=3
#GRUB_HIDDEN_TIMEOUT_QUIET=true
# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console
# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto
# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep
# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true
# Uncomment and set to the desired menu colors. Used by normal and wallpaper
# modes only. Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"
# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"
#GRUB_SAVEDEFAULT="true"
(4) /boot/grub/grub.cfg [disregard what I said before about the UUID in grub.cfg being incorrect - when I said that I was looking at grub.cfg from the arch live CD without having mounted my partitions and chrooted into /mnt; however, interestingly enough, the UUID displayed by the grub error is the same UUID found in grub.cfg if I just boot into the arch live CD and immediately look inside the grub.cfg file without having mounted any partitions or chrooted into /mnt]
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if loadfont unicode ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=0
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=0
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-de69fec6-e3af-45fd-9bb7-6b9c2207fce7' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod cryptodisk luks gcry_rijndael gcry_rijndael gcry_sha512 lvm
insmod ext2
set root='lvmid/sFSh64-7UnS-97Ql-qoNj-bdZ7-Jwy0-lnX1if/hw10MN-DStk-Fzjl-fBBr-B0nV-OLFy-nF8ZZ2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/sFSh64-7UnS-97Ql-qoNj-bdZ7-Jwy0-lnX1if/hw10MN-DStk-Fzjl-fBBr-B0nV-OLFy-nF8ZZ2' de69fec6-e3af-45fd-9bb7-6b9c2207fce7
else
search --no-floppy --fs-uuid --set=root de69fec6-e3af-45fd-9bb7-6b9c2207fce7
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=de69fec6-e3af-45fd-9bb7-6b9c2207fce7 rw quiet cryptdevice=/dev/sda4:Harbinger root=/dev/mapper/Harbinger-rootvol
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-de69fec6-e3af-45fd-9bb7-6b9c2207fce7' {
menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-de69fec6-e3af-45fd-9bb7-6b9c2207fce7' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod cryptodisk luks gcry_rijndael gcry_rijndael gcry_sha512 lvm
insmod ext2
set root='lvmid/sFSh64-7UnS-97Ql-qoNj-bdZ7-Jwy0-lnX1if/hw10MN-DStk-Fzjl-fBBr-B0nV-OLFy-nF8ZZ2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/sFSh64-7UnS-97Ql-qoNj-bdZ7-Jwy0-lnX1if/hw10MN-DStk-Fzjl-fBBr-B0nV-OLFy-nF8ZZ2' de69fec6-e3af-45fd-9bb7-6b9c2207fce7
else
search --no-floppy --fs-uuid --set=root de69fec6-e3af-45fd-9bb7-6b9c2207fce7
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=de69fec6-e3af-45fd-9bb7-6b9c2207fce7 rw quiet cryptdevice=/dev/sda4:Harbinger root=/dev/mapper/Harbinger-rootvol
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux.img
}
menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-de69fec6-e3af-45fd-9bb7-6b9c2207fce7' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod cryptodisk luks gcry_rijndael gcry_rijndael gcry_sha512 lvm
insmod ext2
set root='lvmid/sFSh64-7UnS-97Ql-qoNj-bdZ7-Jwy0-lnX1if/hw10MN-DStk-Fzjl-fBBr-B0nV-OLFy-nF8ZZ2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint'lvmid/sFSh64-7UnS-97Ql-qoNj-bdZ7-Jwy0-lnX1if/hw10MN-DStk-Fzjl-fBBr-B0nV-OLFy-nF8ZZ2' de69fec6-e3af-45fd-9bb7-6b9c2207fce7
else
search --no-floppy --fs-uuid --set=root de69fec6-e3af-45fd-9bb7-6b9c2207fce7
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=de69fec6-e3af-45fd-9bb7-6b9c2207fce7 rw quiet cryptdevice=/dev/sda4:Harbinger root=/dev/mapper/Harbinger-rootvol
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux-fallback.img
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
### BEGIN /etc/grub.d/60_memtest86+ ###
### END /etc/grub.d/60_memtest86+ ###
(5) blkid outputs
# blkid /dev/sda4
/dev/sda4: UUID="510965c3-1534-4931-90e7-214a778c45ca" TYPE="crypto_LUKS" PARTUUID="d59f8008-ede8-41d3-a4c6-a6c44dce498d"
# blkid /dev/mapper/Harbinger-rootvol
/dev/mapper/Harbinger-rootvol: UUID="de69fec6-e3af-45fd-9bb7-6b9c2207fce7" TYPE="ext4"
Edit: Note that the UUID displayed when grub gives an error and drops to a rescue terminal on bootup matches neither the visible UUID nor the hidden UUID for my root volume (for quick reference the UUID displayed by the grub error is a1ab5dcd-190a-4b15-9861-277a875d1149)
Last edited by Olorin (2014-12-30 04:27:37)
Offline
I am not sure why you would want to avoid refind. It's great!
It makes booting USBs CDs or dual booting very simple. It also has the timeout option of "-1" where it boots a default OS unless you press a key whilst the computer is starting up.
I have my Macbook Pro (8,1) setup to boot Arch Linux's grub by default (which is set to short hidden timeout, useful to boot grub just in case I want to edit kernel parameters), but if I want to boot a USB/CD, Ubuntu or OS X I just tap esc whilst booting.
Refind is super easy to install. I advise installing refind whilst booted into OS X by running the downloaded install.sh
Also refind is easy to autodetect installs or add your own. See http://www.rodsbooks.com/refind for a great amount of info
FYI: I would advise to adjust your /etc/mkinitcpio to include at least as this is required on many macbooks (maybe not yours, I don't know)
modules="ahci libahci sd_mod"
My /etc/mkinitcpio.conf is:
MODULES="intel_agp i915 ahci libahci sd_mod ext4"
BINARIES=""
FILES="/etc/modprobe.d/modprobe.conf"
HOOKS="base autodetect plymouth systemd uresume"
Offline
Quite frankly, I admit that I have been attempting to walk a path that does not include rEFInd because, while installing rEFInd from OS X is not difficult, I am still rather confused about how to setup grub underneath it such that rEFInd will detect my encrypted arch partition. Particularly, for example, I have been using this MacBook 9,2 wiki, since my machine is a MacBook 9,2, but while setting up grub the author has a separate boot partition for arch and yet seems to install grub to the efi partition (in which case why bother with an arch boot partition?). In light of your response, let me reformulate my question. Let us suppose that I install rEFInd from OS X and then do a fresh install of arch. Why is it that in the wiki I linked to above the arch boot partition is not where grub is being installed to? What purpose is served by having an arch boot partition in that case, and why does a MacBook 9,2 not require one to run grub-mkconfig?
Offline
I still do not know what the problem was with what I did previously, but I started over and I have now gotten everything to work. My setup is a macbook Pro 9,2 dual booting OS X 10.10 yosemite and arch linux. Arch is encrypted using LVM on LUKS via dm-crypt, and OS X is encrypted via firevault 2. For those who may in the future find this post and want to reproduce this setup, here is a sketch of the approach:
+ Install OS X (do not encrypt with firevault yet - doing so will upset disk utility when you try to partition your disk)
+ Resize the main OS X partition to make space for your arch partitions
+ From OS X, install rEFInd as your boot manager
+ Use Gparted or CLI partition tool of your choice to use the free space you just created to make an arch boot partition and the main arch partition you will be encrypting with LUKS
+ Boot into arch live CD and follow the beginner's guide (or installation guide for those more comfortable with installing arch) until you get to the section where you are creating and mounting filesystems
+ Switch over to the LVM on LUKS section of the dm-crypt full system encryption wiki and follow it until you reach the "Configuring mkinitcpio" section
+ Switch back to beginner's guide and follow until you get to "Create an initial ramdisk environment" section
+ Confer with LVM on LUKS section of dm-crypt wiki and alter hooks in mkinitcpio.conf appropriately and then regenerate the initramfs image
+ Switch to the "Install Bootloader" section of the macbook pro 9,2 wiki and install grub as your bootloader with the wiki as your guide
+ Set your kernel parameters in /etc/default/grub according to dm-crypt wiki
+ Switch back to and follow the beginner's guide until you are done!
+ Boot into OS X and turn on firevault
My thanks to Fallon911 and CarlID for your suggestions and help.
Last edited by Olorin (2015-01-01 05:26:18)
Offline