Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
xen, efi, mdraid, grub2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
hydrapolic
Tux's lil' helper
Tux's lil' helper


Joined: 07 Feb 2008
Posts: 112

PostPosted: Fri Jun 28, 2013 4:20 pm    Post subject: xen, efi, mdraid, grub2 Reply with quote

We have an amd64 machine (Intel DH87MC, Core i7) that is able to boot EFI and we want to run Xen hypervisor (dom0) on it. We have 2 disks with 1TB space and we would like raid1 for redundancy. The hypervisor is placed on a partition without LVM. We want to boot XEN by default.

p1 - boot - 500MB (efi boot space)
p2 - root - 10GB
p3 - LVM for the rest (domU)

# we create the partitions, then the raid devices and we format them
parted /dev/sda
mklabel gpt
mkpart ESI fat32 0% 500m
mkpart primary ext4 500m 10500m
mkpart primary ext4 10500m 100%
set 1 boot on
set 3 lvm on
quit

[the same with /dev/sdb]

mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 --metadata=0.90 /dev/sda1 /dev/sdb1
mdadm --create --verbose /dev/md2 --level=1 --raid-devices=2 --metadata=0.90 /dev/sda2 /dev/sdb2
mdadm --create --verbose /dev/md3 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3

mkfs.vfat -F 32 /dev/md1
mkfs.ext4 /dev/md2
pvcreate /dev/md3

# mount in the livecd environment
mount /dev/md2 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/md1 /mnt/gentoo/boot

# xen 4.2.2 in testing, grub 2 also in testing
echo 'app-emulation/xen' >> /etc/portage/package.keywords
echo 'sys-boot/grub' >> /etc/portage/package.keywords
echo 'sys-boot/efibootmgr' >> /etc/portage/package.keywords

# efi USE flag because without it, the installation failed because it was
# unable to create the symlinks.
echo 'app-emulation/xen efi' >> /etc/portage/package.use
echo 'sys-devel/binutils multitarget' >> /etc/portage/package.use

echo 'GRUB_PLATFORMS="efi-64 pc"' >> /etc/portage/make.conf
emerge -av sys-boot/grub:2 sys-fs/mdadm sys-fs/lvm2 app-emulation/xen ...

[compile kernel, install modules]

# grub2-mkconfig uses the kernel names to create boot entries, the configuration
# file is needed to create the Xen entries
cp arch/x86/boot/bzImage /boot/kernel-3.9.8-xen
cp .config /boot/config-3.9.8-xen

# we want to boot Xen by default, let the kernel to assemble md1 and md2 and we limit
# the dom0 memory limit
modify /etc/default/grub:
GRUB_DEFAULT="saved"
GRUB_CMDLINE_LINUX="md=1,/dev/sda1,/dev/sdb1 md=2,/dev/sda2,/dev/sdb2"
GRUB_CMDLINE_XEN="dom0_mem=4G"

# grub2-install creates a gentoo directory with grubx64.efi, however boot/bootx64.efi is the default
# for amd64 (http://en.wikipedia.org/wiki/Extensible_Firmware_Interface)
mkdir -p /boot/efi/boot
grub2-install --target=x86_64-efi --efi-directory=/boot
mv /boot/efi/gentoo/grubx64.efi /boot/efi/boot/bootx64.efi
rm -rf /boot/efi/gentoo

# this creates the configuration with Xen entries
grub2-mkconfig -o /boot/grub2/grub.cfg

# check the entries and pick Xen
grep ^menuentry /boot/grub/grub.cfg | cut -f2 -d"'"
grub2-set-default "Gentoo GNU/Linux, with Xen hypervisor"

# xen created /boot/efi/gentoo/xen-4.2.2.efi, we don't need it
rm -rf /boot/efi/gentoo

# under /boot we have:
config-3.9.8-xen (kernel config)
efi (contains /boot/efi/boot/bootx64.efi - starts grub2)
grub2 (contains grub.cfg, grubenv, x86_64-efi, etc.)
kernel-3.9.8-xen (kernel)
xen-4.2.2.gz (the following created by app-emulation/xen)
xen-4.2.gz
xen-4.gz
xen-syms-4.2.2
xen.gz


Last edited by hydrapolic on Mon Oct 14, 2013 7:15 am; edited 1 time in total
Back to top
View user's profile Send private message
Clad in Sky
l33t
l33t


Joined: 04 May 2007
Posts: 750
Location: Germany

PostPosted: Fri Oct 11, 2013 6:04 pm    Post subject: Reply with quote

Thanks, I guess that will help with getting Gentoo installed on an UEFI laptop.

I've read "mkpart esi ..." before (Wiki.gentoo.org) and just assumed it was a typo.
What does ESI do? man parted and info parted don't show ESI as valid argument for mkpart.
_________________
Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest
Back to top
View user's profile Send private message
hydrapolic
Tux's lil' helper
Tux's lil' helper


Joined: 07 Feb 2008
Posts: 112

PostPosted: Sat Oct 12, 2013 5:41 pm    Post subject: Reply with quote

I took that over from https://wiki.gentoo.org/wiki/UEFI_Gentoo_Quick_Install_Guide and to be honest, I didn't check the man pages before testing this out. You are right, I cannot find any reference to it either (nothing on duckduckgo or google).

I'll be doing a research soon because I need to setup a similar configuration so if I find out what that means (or what the absence of it breaks), I'll post a note here.

Thanks again for pointing that out.
Back to top
View user's profile Send private message
Razzle
n00b
n00b


Joined: 12 Jan 2004
Posts: 49
Location: Berlin, Germany

PostPosted: Thu Dec 19, 2013 2:41 pm    Post subject: Reply with quote

I use a similar setup, however the dom0 fails to detect ACPI properly. This causes the system to boot with only 1 CPU and other problems. I haven't found a solution yet but the Xen guide suggests using the xen efi bootloader instead of grub, which I haven't had time to test yet.
Does ACPI work for you?
Back to top
View user's profile Send private message
hydrapolic
Tux's lil' helper
Tux's lil' helper


Joined: 07 Feb 2008
Posts: 112

PostPosted: Tue Dec 24, 2013 7:53 am    Post subject: Reply with quote

Hello Razzle, I haven't played with ACPI in any way, but all of the CPUs are detected correctly. By "ACPI working" you mean power saving?

Regarding ACPI in dmesg
Code:

[    0.000000] Xen: [mem 0x00000000b854e000-0x00000000b8554fff] ACPI NVS
[    0.000000] Xen: [mem 0x00000000cbaf1000-0x00000000cbb04fff] ACPI data
[    0.000000] Xen: [mem 0x00000000cbb05000-0x00000000cbc72fff] ACPI NVS
[    0.000000] ACPI: RSDP 00000000000f0000 00024 (v02  INTEL)
[    0.000000] ACPI: XSDT 00000000cbaf5078 00074 (v01 INTEL  DH87MC   0000002F AMI  00010013)
[    0.000000] ACPI: FACP 00000000cbb00ef0 0010C (v05 INTEL  DH87MC   0000002F AMI  00010013)
[    0.000000] ACPI: DSDT 00000000cbaf5180 0BD6E (v02 INTEL  DH87MC   0000002F INTL 20091112)
[    0.000000] ACPI: FACS 00000000cbc71080 00040
[    0.000000] ACPI: APIC 00000000cbb01000 00092 (v03 INTEL  DH87MC   0000002F AMI  00010013)
[    0.000000] ACPI: FPDT 00000000cbb01098 00044 (v01 INTEL  DH87MC   0000002F AMI  00010013)
[    0.000000] ACPI: SSDT 00000000cbb010e0 00AD8 (v01 INTEL  DH87MC   0000002F INTL 20051117)
[    0.000000] ACPI: MCFG 00000000cbb01bb8 0003C (v01 INTEL  DH87MC   0000002F MSFT 00000097)
[    0.000000] ACPI: HPET 00000000cbb01bf8 00038 (v01 INTEL  DH87MC   0000002F AMI. 00000005)
[    0.000000] ACPI: SSDT 00000000cbb01c30 0036D (v01 INTEL  DH87MC   0000002F INTL 20091112)
[    0.000000] ACPI: SSDT 00000000cbb01fa0 02EDB (v01 INTEL  DH87MC   0000002F INTL 20091112)
[    0.000000] ACPI: BGRT 00000000cbb04e80 00038 (v00 INTEL  DH87MC   0000002F AMI  00010013)
[    0.000000] ACPI: XMAR 00000000cbb04eb8 000B8 (v01 INTEL  DH87MC   0000002F INTL 00000001)
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] ACPI: PM-Timer IO Port: 0x1808
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x04] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x06] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x05] lapic_id[0x01] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x06] lapic_id[0x03] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x07] lapic_id[0x05] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x08] lapic_id[0x07] enabled)
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] high edge lint[0x1])
[    0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.000000] ACPI: IRQ0 used by override.
[    0.000000] ACPI: IRQ2 used by override.
[    0.000000] ACPI: IRQ9 used by override.
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x8086a701 base: 0xfed00000
[    8.271035] xen: acpi sci 9
[    8.287650] ACPI: Core revision 20130328
[    8.292459] ACPI: All ACPI Tables successfully acquired
[    8.307453] PM: Registering ACPI NVS region [mem 0xb854e000-0xb8554fff] (28672 bytes)
[    8.307457] PM: Registering ACPI NVS region [mem 0xcbb05000-0xcbc72fff] (1499136 bytes)
[    8.308668] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
[    8.308672] ACPI: bus type PCI registered
[    8.328054] ACPI: Added _OSI(Module Device)
[    8.328059] ACPI: Added _OSI(Processor Device)
[    8.328061] ACPI: Added _OSI(3.0 _SCP Extensions)
[    8.328066] ACPI: Added _OSI(Processor Aggregator Device)
[    8.329312] ACPI: EC: Look up EC in DSDT
[    8.330771] ACPI: Executed 1 blocks of module-level executable AML code
[    8.332466] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
[    8.332602] ACPI BIOS Bug: Warning: Incorrect checksum in table [BGRT] - 0xC8, should be 0x82 (20130328/tbutils-324)
[    8.332774] ACPI: SSDT 00000000cbae6c18 003D3 (v01  PmRef  Cpu0Cst 00003001 INTL 20051117)
[    8.333072] ACPI: Dynamic OEM Table Load:
[    8.333074] ACPI: SSDT           (null) 003D3 (v01  PmRef  Cpu0Cst 00003001 INTL 20051117)
[    8.337135] ACPI: SSDT 00000000cbae5d98 00119 (v01  PmRef    ApCst 00003000 INTL 20051117)
[    8.337426] ACPI: Dynamic OEM Table Load:
[    8.337428] ACPI: SSDT           (null) 00119 (v01  PmRef    ApCst 00003000 INTL 20051117)
[    8.342151] ACPI: Interpreter enabled
[    8.342160] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20130328/hwxface-568)
[    8.342166] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20130328/hwxface-568)
[    8.342182] ACPI: (supports S0 S3 S4 S5)
[    8.342184] ACPI: Using IOAPIC for interrupt routing
[    8.342271] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    8.342371] ACPI: No dock devices found.
[    8.353259] ACPI: Power Resource [FN00] (off)
[    8.353387] ACPI: Power Resource [FN01] (off)
[    8.353551] ACPI: Power Resource [FN02] (off)
[    8.353687] ACPI: Power Resource [FN03] (off)
[    8.353810] ACPI: Power Resource [FN04] (off)
[    8.354530] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-3e])
[    8.355652] pci 0000:00:14.0: System wakeup disabled by ACPI
[    8.356225] pci 0000:00:19.0: System wakeup disabled by ACPI
[    8.356540] pci 0000:00:1a.0: System wakeup disabled by ACPI
[    8.356782] pci 0000:00:1c.0: System wakeup disabled by ACPI
[    8.357115] pci 0000:00:1d.0: System wakeup disabled by ACPI
[    8.358252] pci 0000:01:00.0: System wakeup disabled by ACPI
[    8.358670] acpi PNP0A08:00: Requesting ACPI _OSC control (0x1d)
[    8.358799] acpi PNP0A08:00: ACPI _OSC control (0x18) granted
[    8.359456] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 10 *11 12 14 15)
[    8.359497] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    8.359533] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 10 *11 12 14 15)
[    8.359568] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 *10 11 12 14 15)
[    8.359603] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 10 *11 12 14 15)
[    8.359638] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    8.359674] ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 10 11 12 14 15) *0, disabled.
[    8.359710] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 *10 11 12 14 15)
[    8.360025] ACPI: Enabled 5 GPEs in block 00 to 3F
[    8.360032] acpi root: \_SB_.PCI0 notify handler is installed
[    8.360080] Found 1 acpi root devices
[    8.466298] ACPI: bus type ATA registered
[    8.466660] ACPI: bus type USB registered
[    8.467343] PCI: Using ACPI for IRQ routing
[    8.498082] pnp: PnP ACPI init
[    8.498090] ACPI: bus type PNP registered
[    8.498227] system 00:00: Plug and Play ACPI device, IDs PNP0c01 (active)
[    8.498293] pnp 00:01: Plug and Play ACPI device, IDs PNP0200 (active)
[    8.498346] pnp 00:02: Plug and Play ACPI device, IDs INT0800 (active)
[    8.498478] pnp 00:03: Plug and Play ACPI device, IDs PNP0103 (active)
[    8.498587] pnp 00:04: Plug and Play ACPI device, IDs PNP0c04 (active)
[    8.498728] system 00:05: Plug and Play ACPI device, IDs PNP0c02 (active)
[    8.498807] pnp 00:06: Plug and Play ACPI device, IDs PNP0b00 (active)
[    8.498891] system 00:07: Plug and Play ACPI device, IDs INT3f0d PNP0c02 (active)
[    8.499010] system 00:08: Plug and Play ACPI device, IDs PNP0c02 (active)
[    8.499272] pnp 00:09: Plug and Play ACPI device, IDs PNP0501 (active)
[    8.499510] pnp 00:0a: Plug and Play ACPI device, IDs PNP0501 (active)
[    8.499826] pnp 00:0b: Plug and Play ACPI device, IDs PNP0400 (active)
[    8.499934] system 00:0c: Plug and Play ACPI device, IDs PNP0c02 (active)
[    8.500381] system 00:0d: Plug and Play ACPI device, IDs PNP0c02 (active)
[    8.500551] pnp: PnP ACPI: found 14 devices
[    8.500553] ACPI: bus type PNP unregistered
[    8.572808] hpet_acpi_add: no address or irqs in _CRS
[    8.573375] ACPI: Power Button [PWRB]
[    8.573450] ACPI: Power Button [PWRF]
[    8.573595] ACPI: Fan [FAN0] (off)
[    8.573669] ACPI: Fan [FAN1] (off)
[    8.573740] ACPI: Fan [FAN2] (off)
[    8.573809] ACPI: Fan [FAN3] (off)
[    8.573880] ACPI: Fan [FAN4] (off)
[    8.578472] ACPI: Thermal Zone [TZ00] (28 C)
[    8.578679] ACPI: Thermal Zone [TZ01] (30 C)
[   11.171555] acpi device:52: registered as cooling_device13
[   11.171600] ACPI: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
[   15.583033] ACPI Warning: 0x000000000000f040-0x000000000000f05f SystemIO conflicts with Region \_SB_.PCI0.SBUS.SMBI 1 (20130328/utaddress-251)
[   15.583034] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver


And the CPUs:
Code:

[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] smpboot: Allowing 8 CPUs, 0 hotplug CPUs
[    0.000000] setup_percpu: NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:8 nr_node_ids:1
[    0.000000] PERCPU: Embedded 28 pages/cpu @ffff880110000000 s84416 r8192 d22080 u262144
[    0.000000] pcpu-alloc: s84416 r8192 d22080 u262144 alloc=1*2097152
[    0.000000] pcpu-alloc: [0] 0 1 2 3 4 5 6 7
[    8.270892] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[    8.270929]  RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=8.
[    8.271412] Xen: using vcpuop timer interface
[    8.271416] installing Xen timer for CPU 0
[    8.284981] CPU: Physical Processor ID: 0
[    8.284982] CPU: Processor Core ID: 0
[    8.286661] mce: CPU supports 2 MCE banks
[    8.292751] Performance Events: unsupported p6 CPU model 60 no PMU driver, software events only.
[    8.292958] installing Xen timer for CPU 1
[    8.294899] installing Xen timer for CPU 2
[    8.296848] installing Xen timer for CPU 3
[    8.298769] installing Xen timer for CPU 4
[    8.300763] installing Xen timer for CPU 5
[    8.302750] installing Xen timer for CPU 6
[    8.304814] installing Xen timer for CPU 7
[    8.306799] Brought up 8 CPUs
[    8.332774] ACPI: SSDT 00000000cbae6c18 003D3 (v01  PmRef  Cpu0Cst 00003001 INTL 20051117)
[    8.333074] ACPI: SSDT           (null) 003D3 (v01  PmRef  Cpu0Cst 00003001 INTL 20051117)
[   26.065013] microcode: CPU0 sig=0x306c3, pf=0x2, revision=0x9
[   26.109067] microcode: CPU1 sig=0x306c3, pf=0x2, revision=0x9
[   26.109437] microcode: CPU2 sig=0x306c3, pf=0x2, revision=0x9
[   26.109804] microcode: CPU3 sig=0x306c3, pf=0x2, revision=0x9
[   26.110140] microcode: CPU4 sig=0x306c3, pf=0x2, revision=0x9
[   26.110487] microcode: CPU5 sig=0x306c3, pf=0x2, revision=0x9
[   26.110800] microcode: CPU6 sig=0x306c3, pf=0x2, revision=0x9
[   26.111138] microcode: CPU7 sig=0x306c3, pf=0x2, revision=0x9
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum