• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

“systemd-udevd: Cannot Allocate Memory” and “A start job is running for dev-mapper-\x2droot.device” – CentOS/RHEL 7 booting issue

by admin

The Problem

System cannot proceed with the boot process, stuck with an error messages:

systemd-udevd[369]: fork of '/bin/sh -c '>/tmp/.lvm_scan-sdc;'' failed: Cannot allocate memory
A start job is running for dev-mapper-\x2droot.device

The Solution

If the systemd unit called lvmetad is enabled and running, the metadata is cached which reduces disk scanning and it provides LVM commands with VG metadata and PV state. LVM commands will then avoid reading the information from disks. If there are any changes in the underlying Volume groups and Physical volumes, the LVM metadata cache may not have the information about the changes in the disks which can cause this issue to stuck on LVM commands such as lvm_scan-sd*.

Another factor would be that during this scan, memory allocation may fail due to incorrect or inappropriate settings for kernel parameter vm.nr_hugepages. Huge pages can be configured to allocate and dedicate a part of memory that cannot be used by the OS.

1. Boot the system to Rescue mode using Rescue disk.

CentOS / RHEL 7 : How to boot into rescue mode from installation DVD/ISO

2. Ensure that huge pages setting in /etc/sysctl.conf is the recommended value to avoid the error “Cannot allocate memory”.

3. You can disable huge page setting in /etc/systcl.conf to see if this was causing the issue. Edit /etc/sysctl.conf and ensure vm.nr_hugepages is not existing or replace it to #vm.nr_hugepages =.

4. Disable lvmetad:

# systemctl disable lvm2-lvmetad
# systemctl disable lvm2-lvmetad.socket

5. Edit /etc/lvm/lvm.conf and replace the following line:

From:

use_lvmetad = 1 to use_lvmetad = 0

6. Rebuild initramfs to adapt the changes for the specific kernel:

# cp /boot/initramfs-[kernel version].img /root
# cd /boot
# dracut -f -v initramfs-[kernel].img [kernel]

For example:

# dracut -f -v initramfs-3.10.0-514.el7.x86_64.img 3.10.0-514.el7.x86_64

7. Reboot the system for the changes to take effect:

# shutdown -r now

Filed Under: CentOS/RHEL, CentOS/RHEL 7

Some more articles you might also be interested in …

  1. How to Disable VNC Server from Xinetd in CentOS/RHEL 7
  2. How to Configure Password Expiration and Complexity Requirements in CentOS/RHEL
  3. How to debug systemd boot process in CentOS/RHEL 7 and 8
  4. fdisk: Unable to write /dev/sdg: Bad file descriptor – error while formatting USB disk
  5. How to Switch Password Algorithm on CentOS/RHEL
  6. “-bash: firewall: command not found” – How to resolve in CentOS/RHEL 7
  7. “iscsiadm” Discovery TimeOut With Two Or More Network Interfaces in CentOS/RHEL
  8. Choosing SSSD or Winbind & Samba for Active Directory Integration in CentOS/RHEL
  9. User Account “systemd-bus-proxy”
  10. “You must wait longer to change your password” – error while changing password in CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • fprintd-delete Command Examples in Linux
  • fprintd-delete: command not found
  • foreman: command not found
  • foreman Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright