Welcome to the Linux Foundation Forum!

Lab 2.1: Error with lscgroup

Hello,

I am encountering an error on Lab 2.1. I am using the ubuntu VM from LF211. (ubuntu version 21.10). As per the lab I have installed cgroup-tools.

When I run the command "sudo lscgroup" I get the error "cgroups can't be listed: Cgroup is not mounted". I checked the mounted disks (mount | grep cgroup) and can see that cgroups are mounted:

(cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)

I don't understand why I am getting an error when I try to list the cgroups. Could someone explain why this is?

Thanks.

Best Answer

  • corey44
    corey44 Posts: 12
    Accepted Answer

    Using the recommended VirtualBox VM solved this.

Answers

  • Hi @corey44,

    The LFS253 class labs have not been tested on VM images used in other classes, such as the LFS211. I would recommend following the provisioning steps presented in the first chapter to set up the lab environment for LFS253.

    Regards,
    -Chris

  • Hi @chrispokorni . I have followed the provisioning steps in Lab 1.1 (Oracle VB), but I am getting this message:

    sudo lscgroup
    cgroups can't be listed: Cgroup is not mounted

    Looking forward to hearing from you.

    Thank you
    Adnan

  • maybe lscgroup not work with cgroup v2, try this

    go for /etc/default/grub

    and add the next line on GRUB_CMDLINE_LINUX_DEFAULT: systemd.unified_cgroup_hierarchy=1

    then do sudo grub2-mkconfig -o /boot/grub2/grub.cfg

    reboot and try again.

  • adnansyed
    adnansyed Posts: 3
    edited December 2021

    @devdorrejo said:
    maybe lscgroup not work with cgroup v2, try this

    go for /etc/default/grub

    and add the next line on GRUB_CMDLINE_LINUX_DEFAULT: systemd.unified_cgroup_hierarchy=1

    then do sudo grub2-mkconfig -o /boot/grub2/grub.cfg

    reboot and try again.

    Thanks @devdorrejo, let me try

  • @adnansyed said:

    @devdorrejo said:
    maybe lscgroup not work with cgroup v2, try this

    go for /etc/default/grub

    and add the next line on GRUB_CMDLINE_LINUX_DEFAULT: systemd.unified_cgroup_hierarchy=1

    then do sudo grub2-mkconfig -o /boot/grub2/grub.cfg

    reboot and try again.

    Thanks @devdorrejo, let me try

    grub2-mkconfig did not work but grub-mkconfig did work.

    I got an error message GRUB_CMDLINE_LINUX_DEFAULT: systemd.unified_cgroup_hierarchy=1: not found

    Thank you for your time.

  • @adnansyed said:

    @adnansyed said:

    @devdorrejo said:
    maybe lscgroup not work with cgroup v2, try this

    go for /etc/default/grub

    and add the next line on GRUB_CMDLINE_LINUX_DEFAULT: systemd.unified_cgroup_hierarchy=1

    then do sudo grub2-mkconfig -o /boot/grub2/grub.cfg

    reboot and try again.

    Thanks @devdorrejo, let me try

    grub2-mkconfig did not work but grub-mkconfig did work.

    I got an error message GRUB_CMDLINE_LINUX_DEFAULT: systemd.unified_cgroup_hierarchy=1: not found

    Thank you for your time.

    can you share you /etc/default/grub, so i can re-share it modified

  • Hi @adnansyed,

    I have tried to reproduce your lscgroup issue, but all steps worked as expected by following Lab 1.1 and Lab 2.1.

    Please provide your host machine OS, VM guest OS, and the content of the /etc/sudoers.d/student file from your guest VM.

    Regards,
    -Chris

Categories

Upcoming Training