You are not logged in.

#1 2013-09-22 21:31:05

7SLEVIN
Member
Registered: 2011-11-22
Posts: 27
Website

LVM, RAID installation problems

I know there comes up alot when searching for my error messages, but unfortunately I have been unsuccessful in finding relevant fixes.

When trying to install Arch on a server with LVM and RAID1, I encounter the following after trying to boot with GRUB2:

ERROR: device 'lvm/VolGroupArray-lvroot' not found. Skipping fsck.
ERROR: Unable to find root device 'lvm/VolGroupArray-lvroot'.
Your are being dropped to a recovery shell
    Type 'exit' to try and continue booting
sh: can't access tty; job control turned off

Here are my complete install notes, to the dot:

Getting ready
-------------

Stop raid arrays:
# mdadm -S /dev/md{x,y,z}
Erase superblocks:
# mdadm --zero-superblock /dev/sd{a,b}{1,2,3,4}
Wipe disk:
# dd if=/dev/zero of=/dev/sdX bs=1M count=100


GPT Partition Scheme
--------------------

Partition	Mount p.	Size		Type	Raid
----------------------------------------------------
/dev/sda1				2MiB		ef02	
/dev/sda2	/boot		100MiB		fd00	/dev/md1
/dev/sda3	/swap		2048MiB		fd00	/dev/md2
/dev/sda4	/			rest		fd00	/dev/md0 <-- OBS!

# sgdisk --backup=table /dev/sda
# sgdisk --load-backup=table /dev/sdb


RAID
----
(--assume-clean / watch -n .1 cat /proc/mdstat)
(Resource busy? # dmsetup remove_all)

# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sd[ab]4
# mdadm --create /dev/md1 --level=1 --raid-devices=2 --metadata=0.9 /dev/sd[ab]2
# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sd[ab]3

Further info: 
# mdadm --misc --detail /dev/md[012] | less


LVM
---
# pvcreate /dev/md0

# vgcreate VolGroupArray /dev/md0

# lvcreate -L 20G VolGroupArray -n lvroot
# lvcreate -L 15G VolGroupArray -n lvvar
# lvcreate -L 640G VolGroupArray -n lvhome


File system
-----------
# mkfs.ext4 /dev/VolGroupArray/lvroot
# mkfs.ext4 /dev/VolGroupArray/lvvar
# mkfs.ext4 /dev/VolGroupArray/lvhome

# mkfs.ext4 /dev/md1

# mkswap /dev/md2
# swapon /dev/md2

# mount /dev/VolGroupArray/lvroot /mnt
# mkdir /mnt/{home,boot,var}
# mount /dev/md1 /mnt/boot
# mount /dev/VolGroupArray/lvvar /mnt/var
# mount /dev/VolGroupArray/lvhome /mnt/home


Base-system
-----------
Check internet connection!

Select mirror:
# vi /etc/pacman.d/mirrorlist

Install:
# pacstrap /mnt base base-devel

Update raid:
# mdadm --examine --scan > /mnt/etc/mdadm.conf

Generate fstab:
# genfstab -p /mnt >> /mnt/etc/fstab

Chroot into system:
# arch-chroot /mnt

Configure locale:
# nano /etc/locale.gen
# locale-gen
# echo LANG=en_US.UTF-8 > /etc/locale.conf

Console font and keymap:
# nano /etc/vconsole.conf
	KEYMAP=no-latin1
	FONT=Lat2-Terminus16
	FONT_MAP=
	
Timezone:
# ln -s /usr/share/zoneinfo/Europe/Copenhagen /etc/localtime

Hardware clock to UTC:
# hwclock --systohc --utc

Hostname:
# echo myhostname > /etc/hostname

Uncomment repos in pacman:
# nano /etc/pacman.conf

Set root pwd:
# passwd

Add user:
# useradd -m -g users -s /bin/bash markus
# passwd markus


mkinitcpio.conf
---------------
MODULES=(... dm-mod raid1 ...)
HOOKS=(... mdadm lvm2 filesystems...)

Re-generate the initramfs image:
# mkinitcpio -p linux


GRUB2
-----
# pacman-db-upgrade
# pacman -Syy
# pacman -S grub-bios

# grub-install --target=i386-pc --recheck /dev/sda
# grub-install --target=i386-pc --recheck /dev/sdb

# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
# grub-mkconfig -o /boot/grub/grub.cfg

Modify menu.cfg:
# nano /boot/grub/grub.cfg > (inside the menu entries)
	insmod lvm
	// insmod raid (created a missing raid.mod warning)
	set raid=(md1)
	//set root=lvm/VolGroupArray-lvroot (no effect)
	
	
Finito
------
# exit
# umount /mnt/{boot,var,home,}
# reboot
Pray!


Mount into LVM
--------------
Info with pvs / # lvdisplay /dev/VolGroupArray 
# vgscan --mknodes
# lvchange -a y /dev/VolGroupArray/lvroot
# mount /dev/VolGroupArray/lvroot /mnt

I have tried with the `mdadm_udev` hook.
I have tried modifing the global_filters in lvm.conf (described here: https://bbs.archlinux.org/viewtopic.php … 6#p801706)
Playing around in the menu.cfg, finding out that the generated one worked just as fine (not fine).


Thanks for the help!

Offline

#2 2013-09-22 22:20:36

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,139

Re: LVM, RAID installation problems

You should never run pacman -Sy or pacman -Syy followed by pacman -S <package> as this is effectively a partial upgrade. pacman -S <package> (without updating the databases) is safe. pacman -Syyu <package> (which also does a full system upgrade) is safe.

Also grub-bios is now provided by grub.

Why do you install grub to 2 separate devices? (EDIT: I guess because this is RAID? I don't know anything about that so ignore this.)

I don't think you need insmod lvm in grub.cfg as you are using the initramfs hook.

Shouldn't you be passing the root specification to the kernel rather than grub?

Last edited by cfr (2013-09-22 22:23:00)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Online

#3 2013-09-23 16:35:28

7SLEVIN
Member
Registered: 2011-11-22
Posts: 27
Website

Re: LVM, RAID installation problems

Thanks for the pointers! I guess my notes are getting out dated.

Not sure I understand where you mean I pass grub rather than root?

Offline

#4 2013-09-23 21:07:51

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,139

Re: LVM, RAID installation problems

Well you have

//set root=lvm/VolGroupArray-lvroot (no effect)

I'm not sure about the "//" but anyway, that seems otherwise to be passing that parameter to grub - not the kernel. But don't you want to direct grub to /boot and the kernel to your root partition?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Online

#5 2013-09-23 21:16:59

7SLEVIN
Member
Registered: 2011-11-22
Posts: 27
Website

Re: LVM, RAID installation problems

That's supposed to be a comment, though not that logical as the syntax is `#`. Sorry about that.

That sound logical! Could you help me get that down in words? I don't trust myself with the menu.cfg any more.

Offline

#6 2013-09-24 00:35:48

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,139

Re: LVM, RAID installation problems

Have you tried editing /etc/default/grub and auto-generating grub.cfg? That's not how I do it but it is the recommended approach.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Online

#7 2013-09-24 12:10:25

7SLEVIN
Member
Registered: 2011-11-22
Posts: 27
Website

Re: LVM, RAID installation problems

No, that I have not tried. Get back to you as soon I do!

Right now I have a project due, so I'll to fall back to a more standard setup. In any case it might be some time til I get back. Should I delete the thread and repost when it's time or just leave it?

Offline

Board footer

Powered by FluxBB