You are not logged in.
Pages: 1
Hello everyone,
I'm installing ArchLinux another time (I've been using it with different configurations for years) but this time I want to build this system:
To build it I've configured all the partitions from my current installation, so the drive letters are moved:
#Three hard drives: sdb with 320GB and sdc and sdd with 250GB. Goal: RAID 10 with encrypted data and Xen kernel
gdisk -l /dev/sdc | grep "sectors," # get sectors count
gdisk /dev/sdb
o
Y
n
1
2048
488397134 #(sectors count)+2048
fd00
n
2
+512M
ef00
n
3
+2G
8300
w
Y
gdisk /dev/sdc
o
Y
n
1
2048
488397134 #41943040
fd00
w
Y
gdisk /dev/sdd
o
Y
n
1
2048
488397134
fd00
w
Y
mkfs.fat -F32 /dev/sdb2 #partition the efi as fat 32
mkfs.ext4 /dev/sdb3 #partition the boot as ext4
mdadm --create /dev/md0 --level=10 --raid-devices=3 /dev/sdb1 /dev/sdc /dev/sdd
yes
#If need to mount again, mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb /dev/sdc
cryptsetup luksFormat /dev/md0
YES
password
password
cryptsetup open --type luks /dev/md0 LUKS
vgcreate LVM /dev/mapper/LUKS
lvcreate -L 16G LVM -n swap
lvcreate -L 100G LVM -n arch
lvcreate -l 100%FREE LVM -n home
mkfs.ext4 /dev/LVM/arch
mkfs.ext4 /dev/LVM/home
mkswap /dev/LVM/swap
# Summary:
# /dev/sdb2 -> /boot/efi
# /dev/sdb3 -> /boot
# /dev/LVM/arch -> /
# /dev/LVM/home -> /home
# /dev/LVM/swap -> swaponAnd to perform the installation, I've run these commands:
cryptsetup open --type luks /dev/md0 LUKS
password
mount /dev/LVM/arch /mnt
mkdir /mnt/boot /mnt/home
mount /dev/LVM/home /mnt/home
mount /dev/sdb3 /mnt/boot
mkdir /mnt/boot/efi
mount /dev/sdb2 /mnt/boot/efi
swapon /dev/LVM/swap
pacstrap /mnt base base-devel
genfstab -U -p /mnt >> /mnt/etc/fstab
arch-chroot /mnt /usr/bin/pacman -S --noconfirm grub efibootmgr intel-ucode
cat /mnt/etc/mkinitcpio.conf | sed -r 's/(^HOOKS=".*)"$/\1 mdadm_udev keymap encrypt lvm2"/g' > /mnt/etc/mkinitcpio.conf #add encrypt and lvm2 in HOOKS
arch-chroot /mnt /usr/bin/mkinitcpio -p linux
head -n 3 /mnt/etc/default/grub > /tmp/beginGrub
tail -n 43 /mnt/etc/default/grub > /tmp/endGrub
cp /tmp/beginGrub /mnt/etc/default/grub
echo "GRUB_CMDLINE_LINUX_DEFAULT=\"quiet md=0,/dev/sda1,/dev/sdb,/dev/sdc cryptdevice=/dev/md0:LVM root=/dev/mapper/LVM-arch\"" >> /mnt/etc/default/grub
cat /tmp/endGrub >> /mnt/etc/default/grub
arch-chroot /mnt /usr/bin/grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=XenServer
arch-chroot /mnt /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg
arch-chroot /mnt /usr/bin/passwd
password
password
cd
umount -R /mntIf you are trying to test in Qemu (as me) and don't want to add EFI support, I use this commands to install the BIOS boot partition (suposing sdb is now sda inside qemu):
gdisk /dev/sda
n
+1M
ef002
w
Y
#Bios boot partition will be created
arch-chroot . usr/bin/grub-install --target=i386-pc --recheck /dev/sdaAnd that would work if the GRUB recognized my RAID as /dev/md0, but it doesn't. Instead, my RAID10 appears as /dev/md127 and if I change my grub configuration to /dev/md127 it works. My only question is how do I configure my RAID in GRUB to be detected as md0? I don't understand that md127 so I don't feel confortable with it...
Offline
mdadm.conf
Offline
mdadm.conf
mdadm.conf is placed in etc, which is inside root. I think I need to perform that configuration from the GRUB files, because the etc folder is not accessible at boot time. Am I confused?
Offline
This 'md=0,/dev/sda1,/dev/sdb,/dev/sdc' will only work with metadata version 0 or 0.9 I believe[1], at most it might work with metadata version 1.0 since the superblock is also at the end of the device[2] but I really doubt it.
As jasonwryan hinted, you will have to include a proper mdadm.conf in the initramfs and not use the md= parameter.
[1] https://www.kernel.org/doc/Documentation/md.txt
[2] https://raid.wiki.kernel.org/index.php/ … ck_formats
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
This 'md=0,/dev/sda1,/dev/sdb,/dev/sdc' will only work with metadata version 0 or 0.9 I believe[1], at most it might work with metadata version 1.0 since the superblock is also at the end of the device[2] but I really doubt it.
As jasonwryan hinted, you will have to include a proper mdadm.conf in the initramfs and not use the md= parameter.
[1] https://www.kernel.org/doc/Documentation/md.txt
[2] https://raid.wiki.kernel.org/index.php/ … ck_formats
So, if I've understood you, the only thing I must do is to configure my RAID array in mdadm.conf and copy it to the initramfs? I didn't know that image was configurable, there are a lot of things I need to learn yet...
Then, commands I would need to make my system work are these:
echo "ARRAY /dev/md0 devices=/dev/sda1,/dev/sdb,/dev/sdc" > /mnt/etc/mdadm.conf
arch-chroot /mnt mkinitcpio -p linuxI'll try them when I get home, but if you know something will fail, I'd appreciate too much if you told me.
Thanks for your answer ![]()
Offline
Most probably you want to read the wiki page on mkinitcpio[1] before you proceed, all the info you need should be there.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
Most probably you want to read the wiki page on mkinitcpio[1] before you proceed, all the info you need should be there.
I ran those two commands and it worked perfectly. I'm now reading that page and finding it very interesting to understand my favorite distro.
Thank you very much for your help ![]()
Offline
Pages: 1