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

The Geek Diary

CONCEPTS | BASICS | HOWTO

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

‘lxc_cgfs – Device or resource busy – failed to set memory.use_hierarchy to 1; continuing’ – error while starting LXC container

By admin

The Problem

While starting lxc it gives the below error:

lxc-start 1491315722.354 ERROR lxc_cgfs - Device or resource busy - failed to set memory.use_hierarchy to 1; continuing
lxc-start 1491315722.354 ERROR lxc_cgfs - Device or resource busy - failed to set memory.use_hierarchy to 1; continuing
lxc-start 1497957841.930 ERROR lxc_cgfs - Device or resource busy - failed to set memory.use_hierarchy to 1; continuing
lxc-start 1497957841.937 ERROR lxc_cgfs - Device or resource busy - failed to set memory.use_hierarchy to 1; continuing

The Solution

Considering a scenario where we get the Error:Device or resource busy – failed to set memory.use_hierarchy to 1; continuing:

# lxc-start --name CentOS7
lxc-start: cgfs.c: handle_cgroup_settings: 2077 Device or resource busy - failed to set memory.use_hierarchy to 1; continuing
systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ)
Detected virtualization 'lxc'.
Welcome to CentOS Linux Server 7.1!
Failed to insert module 'autofs4'
Set hostname to [CentOS7].
[ OK ] Reached target Remote File Systems.
[ OK ] Created slice Root Slice.
[ OK ] Created slice User and Session Slice.
[ OK ] Created slice System Slice.
[ OK ] Reached target Slices.
[ OK ] Created slice system-getty.slice.

The parameter /cgroup/memory/memory.use_hierarchy is set to 0 causing the issue. Use the below command to check the current value of the parameter.

# cat /proc/mounts | grep -i mem
cgroup /cgroup/memory cgroup rw,relatime,memory 0 0

# ls /cgroup/memory/memory.use_hierarchy
/cgroup/memory/memory.use_hierarchy

# cat /cgroup/memory/memory.use_hierarchy
0

If we try to set the value to 1 it still throws the same error:

# echo 1 > /cgroup/memory/memory.use_hierarchy
-bash: echo: write error: Device or resource busy

In order to get rid of the Error : Device or resource busy – failed to set memory.use_hierarchy to 1; continuing we need to follow the below steps:

  1. Stop the container
  2. Stop cgconfig service
  3. Start cgconfig service
  4. Set the parameter /cgroup/memory/memory.use_hierarchy to 1
  5. Start the container
# lxc-stop --name CentOS7
# /etc/init.d/cgconfig stop
Stopping cgconfig service: [ OK ]
# cat /proc/mounts | grep -i mem
#
# /etc/init.d/cgconfig start
Starting cgconfig service: [ OK ]
# cat /cgroup/memory/memory.use_hierarchy
0
# echo 1 > /cgroup/memory/memory.use_hierarchy
# cat /cgroup/memory/memory.use_hierarchy
1
# lxc-start --name CentOS7
systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ)
Detected virtualization 'lxc'.

Welcome to CentOS Server 7.1!

Failed to insert module 'autofs4'
Set hostname to .
[ OK ] Reached target Remote File Systems.
[ OK ] Created slice Root Slice.

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to set udev rule for setting the disk permission on ASM disks when using multipath on CentOS/RHEL 6
  2. Linux OS Service ‘anacron’
  3. Common Init.ora Parameters and Unix, Linux Kernel Parameters and Relationship Between Them
  4. CentOS/RHEL : Unmounting a Windows Share Fails – “device is busy”
  5. CentOS / RHEL 5 : How to install and configure vsftpd server
  6. How To Check World Wide Port Names (WWPN) of Tape Drives Attached to Linux host
  7. How to Configure SSH to restrict Users/Groups with allow and deny directives
  8. How to Restrict Active Directory Users and Groups to Login to CentOS/RHEL 7 Client
  9. System Log File /var/log/messages Is Getting Deleted or Trimmed Automatically (CentOS/RHEL)
  10. CentOS / RHEL 6 : How to change the verbosity of debug logs during booting

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary