Posts

Showing posts with the label LVM

LVM Snapshot Causes Boot Failure

If you've created an LVM Snapshot before rebooting your system and found yourself staring at the dracut rescue shell you might be stricken by the same problem as I was.  Executing init U on the dracut commandline resulted in a descriptive error message (that might also be found in the journal/logs) about a missing dm-snapshot kernel module.  I've attempted to troubleshoot the problem for a couple of hours, failing to add the kernel module in the end--as I wasn't able to get to a working kernel.  Ultimately, the only solution was to remove the snapshot Volume, which proved to be more difficult than expected. To remove the snapshot LV, one executes:
dracut #: lvm lvremove vg_name/lv_snapshot_name However, you might be confronted by an error message there as well.  It seems that the volume is locked at that time.  To get around this, simply remove the /etc/lvm/lvm.conf file from the volatile initramfs "filesystem".

dracut #: rm /etc/lvm/lvm.conf dracut #: lvm p…

LVM

Image
lvm table

SystemD and FIFO Sockets in RHEL7

There's a bug with a relevant discussion on systemd's approach to FIFO socket deletion. As of systemd-214 the issue with "stale" sockets was resolved by supplying the `RemoveOnStop` option to its corresponding `.service`. However, at the moment RHEL7 has systemd-208 as the default version; and I am seeing the following errors in `dmesg` output: systemd[1]: systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ) systemd[1]: /usr/lib/systemd/system-generators/anaconda-generator exited with exit status 1. [ +0.056775] systemd[1]: [/usr/lib/systemd/system/lvm2-lvmetad.socket:9] Unknown lvalue 'RemoveOnStop' in section 'Socket' [ +0.000675] systemd[1]: [/usr/lib/systemd/system/dm-event.socket:10] Unknown lvalue 'RemoveOnStop' in section 'Socket' I'm not sure if LVM2 is referencing a feature that's not available in the default systemd version; AFAIK, my configurati…

Expanding LVM Partition in RHEL7

Scenario:  I've created a VM with a RHEL7 guest.  The partition layout is a standard, primary partition for /boot and LVM for the rest--namely, /usr, /var, /home, swap and / (rootfs).  After installing updates and some other packages, the /usr directory began to fill up.

In order to mitigate the situation, I created an additional primary partition with an XFS filesystem, as that is the preferred/default FS in RHEL7.

    # parted /dev/vda mkpart P3 xfs 14G 16G

The above command instructs "parted" to operate on the /dev/vda disk and create primary partition 3 with XFS filesystem starting at 14G and ending at 16G.  
Next, I added the physical partition to LVM with the following command: 

# pvcreate /dev/vda

Then, extend the volume group with the physical partition with: 

    # vgextend rhel /dev/vda3

and 

    # lvextend -L+2G /dev/rhel/usr

Finally, to grow the filesystem I executed 

    # xfs_growfs /dev/rhel/usr

Recover Fedora21 after Removing swap LVM Partition

Image
"God" help you if you make the mistake, as I did today on a newly-installed Fedora21 system, to delete an LVM swap partition without taking the proper precautions before rebooting. If you are in this position, or have been in the past, you've come face to face with the dracut rescue shell and its limited set of "shell" commands. While the rescue shell offers some potentially useful functions (commands), I could not successfully use it to implement any of the advised steps from manual pages and internet forums I came across when searching for a solution to this problem.
The Fedora Wiki page on "How to debug Dracut problems" suggested activating the root and any other logical volumes by executing  # lvm vgscan # lvm vgchange -ay "With the root volume available, you may continue booting the system by exiting the dracut shell" exit Though, in fairness, that resolution was dealing with unlocking an encrypted root volume with an additional …