LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 07-10-2022, 09:59 AM   #1
husarz
Member
 
Registered: Dec 2016
Location: Poland
Distribution: Fedora/CentOS
Posts: 41

Rep: Reputation: Disabled
manual mdadm with LVM and Fedora Installer


Using Fedora 36 Live USB on legacy machine with BIOS I have setup partition layout by gdisk, same on three separate 500GB drives:

Code:
Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            4095   1024.0 KiB  EF02  BIOS boot partition
   2            4096          618495   300.0 MiB   FD00  Linux RAID
   3          618496        34172927   16.0 GiB    FD00  Linux RAID
   4        34172928       976773134   449.5 GiB   FD00  Linux RAID
then I did setup soft raid with use of mdadm as follows:

Code:
# mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sd[abc]4
# mdadm --create /dev/md1 --level=1 --raid-devices=3 /dev/sd[abc]3
# mdadm --create /dev/md2 --level=1 --raid-devices=3 /dev/sd[abc]2
next I created logical volumes on /dev/md0 (RAID5):

Code:
# pvcreate /dev/md0
# pvcreate /dev/md1
# pvcreate /dev/md2
what gives me:

Code:
# pvdisplay 
  --- Physical volume ---
  PV Name               /dev/md0
  VG Name               VGarray
  PV Size               898.68 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              230062
  Free PE               0
  Allocated PE          230062
  PV UUID               9sGOj2-CeLj-EOhY-Rgv4-baVJ-W2Mo-eR2Ice
   
  "/dev/md1" is a new physical volume of "15.98 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/md1
  VG Name               
  PV Size               15.98 GiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               7LO45Z-sNrU-AXTK-nv4I-7BCy-wQnU-UtGMCC
   
  "/dev/md2" is a new physical volume of "199.00 MiB"
  --- NEW Physical volume ---
  PV Name               /dev/md2
  VG Name               
  PV Size               199.00 MiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               DVnpdm-C9rg-Wu0V-HE7Q-GRnN-B7aG-kZOZ77
then I followed to create volume group:

Code:
# vgcreate VGarray /dev/md0
# vgdisplay 
  --- Volume group ---
  VG Name               VGarray
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <898.68 GiB
  PE Size               4.00 MiB
  Total PE              230062
  Alloc PE / Size       230062 / <898.68 GiB
  Free  PE / Size       0 / 0   
  VG UUID               Ie0G3S-HvEq-2Zia-rpyC-PIww-czUy-Px03TQ
and logical volumes:

Code:
# lvcreate -L 50G vgarray -n lvroot
# lvcreate -L 20G VGarray -n lvvar
# lvcreate -L +100%FREE VGarray -n lvhome
that results in:
Code:
# lvdisplay 
  --- Logical volume ---
  LV Path                /dev/VGarray/lvroot
  LV Name                lvroot
  VG Name                VGarray
  LV UUID                5cuQDv-fuVg-7dVa-EtQ2-jDFS-QTAH-i79qtS
  LV Write Access        read/write
  LV Creation host, time localhost-live, 2022-07-10 09:26:31 -0400
  LV Status              available
  # open                 0
  LV Size                50.00 GiB
  Current LE             12800
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           253:2
   
  --- Logical volume ---
  LV Path                /dev/VGarray/lvvar
  LV Name                lvvar
  VG Name                VGarray
  LV UUID                U3OoH8-vQ4I-eM5P-HBZ8-LP7z-Mo1Q-g189Xr
  LV Write Access        read/write
  LV Creation host, time localhost-live, 2022-07-10 09:27:27 -0400
  LV Status              available
  # open                 0
  LV Size                20.00 GiB
  Current LE             5120
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           253:3
   
  --- Logical volume ---
  LV Path                /dev/VGarray/lvhome
  LV Name                lvhome
  VG Name                VGarray
  LV UUID                vEW9Jp-C5xZ-ce23-iF1L-e2sb-ckHL-g0e6ji
  LV Write Access        read/write
  LV Creation host, time localhost-live, 2022-07-10 09:30:48 -0400
  LV Status              available
  # open                 0
  LV Size                <828.68 GiB
  Current LE             212142
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           253:4
lastly exported raid config to config file:
Code:
# mdadm --examine --scan >> /etc/mdadm.conf

Should I create separate volume groups with logical volumes for boot and swap raid md devices?

When I run Fedora Installer it can only see RAID devices with 0 bytes of free space but none of logical volumes, why?

Last edited by husarz; 07-10-2022 at 10:02 AM. Reason: additionial information added
 
Old 07-30-2022, 03:55 PM   #2
husarz
Member
 
Registered: Dec 2016
Location: Poland
Distribution: Fedora/CentOS
Posts: 41

Original Poster
Rep: Reputation: Disabled
The solution is to just reboot the machine after RAID array and LVM before proceeding with the installation of the OS. During installation choose advanced mode of partitioning, in Fedora 36 installer it is called 'Advanced custom (Blivet-GUI)' to able to configure the storage for the OS.
Looks like it is also good idea to allow finish of RAID array initial synchronization (resync). I did not and in my case it caused to extremely long bootloader installation for about ~20min. Reboot after finished installation boot failed with

Code:
ZSTD-compressed data is corrupt 
-- System halted
error message. Then I had to boot from USB Live. In Live session I found that vmlinuz kernel file checksum differs from Live one. I chroot to my host OS and reinstall kernel packages to get things working.

Last edited by husarz; 07-30-2022 at 03:57 PM. Reason: Provided more details
 
1 members found this post helpful.
  


Reply

Tags
fedora, lvm, mdadm, raid



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to backup MDADM super blocks and other tips I should know about mdadm? road hazard Linux - Newbie 5 08-04-2016 12:21 AM
man -t manual | ps2pdf - > manual.pdf error Amdx2_x64 Linux - General 2 07-01-2011 03:22 AM
MDADM screws up the LVM partitions? Can't mount the LVMs after mdadm stopped alirezan1 Linux - Newbie 3 11-18-2008 04:42 PM
unable to load MDADM module BUT mdadm works?!?!?! alirezan1 Linux - Software 2 09-08-2008 07:58 PM
mdadm says "mdadm: /dev/md1 not identified in config file" when booting FC7 raffeD Linux - Server 1 08-11-2008 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 05:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration