You are not logged in.

#1 2013-12-03 17:22:57

gslang
Member
Registered: 2013-11-26
Posts: 3

How to setup grub2 with arch linux and xen, lvm on luks

OK, so I tried downloading this package from AUR:  https://aur.archlinux.org/packages/xen-git/ , but that has patching problems as noted in the comments.  It looks like the packagebuild sets up all the xen stuff for you, but I can't seem to get the package to install because of the error's while patching.  If anyone can point me in the right direction on what all the extra files in the PKGBUILD are for or how to debug problems with PKGBUILDs not working because of patches.

So next I just tried to compile the latest xen from git://xenbits.xen.org/xen.git (with ./configure, make, make install) and that seemed to go fine, but I'm a bit confused:

1.  Do I have to do any additional configuration for xen when working with arch linux?  On ubuntu I could just compile the source, update grub, and make sure to start the x services at runtime.

2.  How do I set up grub to load xen with this setup?  Right now this is my /boot/grub/grub.cfg:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3:vgStorage"

# 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=5
#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"
~

I've tried throwing in a line like: XEN_HYPERVISOR_CMDLINE="cryptdevice=/dev/sda3:vgStorage", but nothing new shows up on the grub boot menu.

First time trying to set up a non-ubuntu system, please help! smile

Offline

#2 2013-12-04 08:31:12

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: How to setup grub2 with arch linux and xen, lvm on luks

As for XEN.... well you could always try QEMU/KVM or LXC.

----
As for the LVM2-on-LUKS/dm-crypt

My /etc/mkinitcpio.conf looks like this...

MODULES="aesni_intel ata_generic ata_piix nls_cp437 ext4 intel_agp i915 dm-snapshot"
BINARIES=""
FILES=""
HOOKS="base udev autodetect block keymap encrypt lvm2 filesystems keyboard fsck shutdown"

/etc/defaults/grub

GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:root:allow-discards"
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
GRUB_TERMINAL_INPUT=console
GRUB_GFXMODE=auto
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_DISABLE_RECOVERY=true

The running grub config looks like this
/boot/grub/grub.cfg

  9 insmod part_gpt                                                                 
 10 insmod part_msdos 
 53 if loadfont unicode ; then                                                      
 54   set gfxmode=auto                                                              
 55   load_video                                                                    
 56   insmod gfxterm                                                                
 57   set locale_dir=$prefix/locale                                                 
 58   set lang=en_US                                                                
 59   insmod gettext                                                                
 60 fi                                                                              
 61 terminal_input console                                                          
 62 terminal_output gfxterm                                                         
 63 set timeout=3 
 84 menuentry 'Backup, Arch Linux grsec kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-grsec kernel-true-12341234-8080-8080-8080-332200882255' {
 85   load_video                                                                    
 86   set gfxpayload=keep                                                           
 87   insmod gzio                                                                   
 88   insmod part_msdos                                                             
 89   insmod ext2                                                                   
 90   set root='hd1,msdos2'                                                         
 91   if [ x$feature_platform_search_hint = xy ]; then                                                                                                                                                                             
 92     search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2  BBAAEEAA-FFCC-CCFF-FFCC-AABBCCEEBBAA
 93   else                                                                          
 94     search --no-floppy --fs-uuid --set=root BBAAEEAA-FFCC-CCFF-FFCC-AABBCCEEBBAA
 95   fi                                                                            
 96   echo  'Loading Linux grsec kernel ...'                                        
 97   linux /vmlinuz-linux-grsec root=/dev/mapper/VolGroup00-lvroot rw cryptdevice=/dev/sda2:root:allow-discards quiet
 98   echo  'Loading initial ramdisk ...'                                           
 99   initrd  /initramfs-linux-grsec.img                                            
100 } 

Things to note:
Numerical UUID is the UUID of the ROOT partition.
Alphabetical UUIS is the BOOT partition

hd1,msdos2 AND ahci1,msdos2 are how the Grub Bootloader numbers the drives not Linux.
I have my BOOT partition on a USB stick, and it is the Second partition.
So, that would make it, Device 2 and Partition 2
Device numbering starts at 0
Partition numbering starts at 1

Oh, and note that you don't need ":allow-discards" ... at all but certainly if you don't have an SSD. Also note that I included the line numbers so it is very clear that I didn't post the whole thing, but instead what I thought was relevant. Finally, I am loading modules that I don't even need, but what the hell... if it ain't broke, don't fix it tongue

Last edited by hunterthomson (2013-12-04 08:31:45)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

Board footer

Powered by FluxBB