Lorax Disk Image --> USB

General support questions
Post Reply
squirrel
Posts: 5
Joined: 2017/09/30 01:28:31

Lorax Disk Image --> USB

Post by squirrel » 2018/10/22 01:30:19

I'm trying to build a clone-able image of CentOS 7.x, starting with Lorax (livemedia-creator) to create the partitioned disk image via QEMU/KVM. I use the following command to create the image:

Code: Select all

livemedia-creator --make-disk --iso iso/CentOS-7-x86_64-Everything-1804.iso --ks ks/centos7-minimal.ks --logfile log/lorax.log --tmp tmp --resultdir result --image-name=centos.img --ram=2048 --vcpus=2
The ISO image used is that provided by CentOS mirrors, and the kickstarter is attached (with an extra *.txt extension so that it can be uploaded here). The partition relevant portions of the kickstart file are as follows:

Code: Select all

bootloader --location=mbr
zerombr
clearpart --all
part /boot --fstype="xfs" --size=128
part pv.01 --size=1408
volgroup centos pv.01
logvol / --fstype="ext4" --percent=100 --grow --name=root --vgname=centos
(I'm sure there are more elegant ways to perform the above, but this is what I have :) ). The partitioned image is created successfully, and can be started with QEMU/KVM once the kickstart installation is completed (in this case, the result is in result/centos.img):

Code: Select all

virt-install --name=centos-vm --vcpus=2 --memory=2048 --disk=result/centos.img --boot hd
virsh start centos-vm
However, if I dd this image into a USB drive, I can't get the image to fully boot. The DD command is as follows (where <n> is the USB drive to use):

Code: Select all

dd if=result/centos.img of=/dev/sd<n> status=progress
The USB drive boots to GRUB, which is promising (image attached). Since QEMU/KVM installs with the console routed to TTY, I remove the "console=ttyS0" kernel boot argument and boot with Ctrl+X. Eventually, the boot times out to dracut shell with the warning that:

Code: Select all

Warning: /dev/centos/root does not exist
Warning: /dev/mapper/centos-root does not exist
Here's where things, at least to me, seem odd - in the dracut shell, it can't seem to find any of the relevant volume groups:

Code: Select all

dracut:/# lvm vgscan
   Reading all physical volumes. This may take a while...
dracut:/# lvm vgdisplay
dracut:/# lvm vgchange -ay
dracut:/# blkid
/dev/sdb: TYPE="isw_raid_member"
/dev/sdc: TYPE="isw_raid_member"
(The two above, /dev/sdb and /dev/sdc, are the RAIDs on the physical machine already). If I list the 'sd' devices, the OS is certainly aware of more devices:

Code: Select all

dracut:/# ls /dev/sd*
/dev/sda   /dev/sda2   /dev/sdc   /dev/sdd1
/dev/sda1  /dev/sdb    /dev/sdd   /dev/sdd2
This would lead me to believe that in the minimal kickstart, maybe some package is missing that allows for USB booting? If so... which one? :?:

Edit: To clarify, I've attempted this with different USB drives (even different standards... 2.0, 3.0, 3.1, etc.) and different target machines (Supermicro, HP, etc.).

Edit Edit: Perhaps it isn't a package issue, and something about the QEMU/KVM emulated hardware being different than what is being run on from USB?
Attachments
Screenshot from 2018-10-21 21-10-49.png
Screenshot from 2018-10-21 21-10-49.png (16.67 KiB) Viewed 747 times
centos7-minimal.ks.txt
(1.42 KiB) Downloaded 52 times

Post Reply