LV does not automatically activate after rebooting.
Hello.
I have a problem that I can't solve. LV does not automatically activate after OS boot: Code:
# lvscan Code:
# lvdisplay Code:
# systemctl | grep lvm Code:
# systemctl start lvm2-pvscan@9:2 && systemctl enable lvm2-pvscan@9:2 Code:
# lvscan Code:
# systemctl | grep lvm Help me, please, why can LV not be automatically activated and how to make the service `lvm2-pvscan@9:2` autostart? What service runs it? Since basically this service starts up after creating an LVM partition, but something is missing and it does not start automatically. Perhaps a problem in systemd? I included a debug log for LVM and for systemd, but I didn’t find anything to help me in analyzing the problem. Thanks. |
The pvscan is a oneshot service. This means that it is just a command that gets executed doesn't have a daemon that stays running.
It sounds like you need a kernel module loaded or network connection to see the device you are having problems with. I would copy the unit file for /lib/systemd/system/lvm2-pvscan@.service and change the After line to whatever is needed for your system to see the device. Reboot your system, copy /lib/systemd/system/lvm2-pvscan@9:2.service to /etc/systemd/system/ with a new name, make the necessary changes, run systemctl daemon-reload, then systemctl enable what_you_called_it, then systemctl start what_you_called_it. If you see the volume, reboot and make sure it works as intended. |
My initial reaction was "who in their right mind would format a lv as an image file ?" .
That's like dd'ing an entire device to a partition on another disk and trying to mount it - ain't gunna work without some intervention first. A gcow[2] is a file, not a filesystem. I think you need to rethink your setup. |
Quote:
qcow is just the name of my logical volume |
It has a major:minor and needs a pvscan hmmm ... - what does "lsblk -f" return ?.
|
Quote:
Code:
# lsblk -f Code:
pvs Physical Volume Label |
I think tyler2016 is on the right track. LVM typically starts on boot before the fileystem checks. If your other PVs/VGs/LVs are coming up after reboot that suggest it is starting and finding those OK. If it is not finding this one automatically it suggests there is something else starting later in Systemd that makes it available so that the manual pvscan finds it.
I've seen setup on some 3rd party flash cards like those from IODrive (now SanDISK) where it has its own files to activate the card that also allow you to do the start of the LVM structures laid out on that card so it isn't found by init scripts or systemd until later in the boot. What is this particular PV's hardware? Is it different than hardware for other PVs that are being found automatically at boot? |
Quote:
Code:
rsync -avxHAX --exclude=tmp/* --exclude=dev/* --exclude=proc/* --exclude=sys/* --exclude=run/* --exclude=mnt/* --exclude=media/* --exclude=lost+found --exclude=var/backups/* --exclude=var/tmp/* --exclude=var/run/* --exclude=var/log/*.gz --exclude=var/log/*.1 root@{{ hostvars[node_template].ansible_host }}:/ /mnt/md0 |
Ouch. I'd not have done it that way. I'd have used something like Mondo to create a bootable backup of the original setup then used it to install the new one. Do you still have the original to do that from?
If not, had you already done a base install on the new system for the boot setup? Have you examined grub setup? Have you examined lvm.conf? It may be things like disk UUIDs and or other structures aren't appreciated by your new system as they're relevant to the old one. It sounds like you're getting it to boot. You might try to boot into single user, save a copy of lvm.conf then do vgscan and vgimport to create a new one. |
Quote:
|
It was long, difficult and painful, but I found the problem.
By default, the rd.md.uuid sections are specified in /etc/default/grub, for example: Code:
GRUB_CMDLINE_LINUX="audit=1 crashkernel=auto rd.md.uuid=37e1ee29:255a03e4:cfbbe95f:84466f02 rd.md.uuid=e6dcf2cd:6423071d:63fbf6ae:cb16e95f biosdevname=0 net.ifnames=0 rhgb quiet" I did not understand the exact reason for such work, but the main thing is that the problem has been solved, and I will go on to read the manuals :) |
All times are GMT -5. The time now is 03:04 AM. |