Welcome to the Linux Foundation Forum!

Lab 2.1 Freezer not exists (Solution)

devdorrejo
devdorrejo Posts: 24
edited December 2021 in LFS253 Class Forum

Hello, if someone are using a distro where the freezer directory not exists, you can create it this way:

sudo mkdir /sys/fs/cgroup/freezer
sudo mount -t cgroup -ofreezer freezer /sys/fs/cgroup/freezer

That way no matter the distro you are using you can complete this Lab.

Comments

  • Thanks, this worked perfectly.

  • degido
    degido Posts: 1

    Thanks!!!

  • I know this is an older post and marked resolved, but I was wondering how/if it was intended to be persistent across restarts? The lab seems to imply that /sys/fs/cgroup/freezer/ exists on installation.

    Is there a deb package that is missing and should be there?

  • chrispokorni
    chrispokorni Posts: 2,376

    Hi @robertfreemanday,

    You are correct, on the Ubuntu 20.04 LTS server the .../cgroup/freezer/ directory exists. That is the recommended OS release as presented in lab exercise 1.1 of the lab guide.

    However, as the original post of this discussion suggests, that directory may not be available on all releases and/or distributions. For those scenarios, the suggested workaround may be applied.

    Regards,
    -Chris

  • Thanks for your reply, @chrispokorni !! I know this was an aged thread, but still topical.

    I apologize that I wasn't clear. Is there an Ubuntu package from other versions that would need applied to persist that filesystem setup? The work around does not persist between reboots for my version (22.04.x).

    Thanks!

  • chrispokorni
    chrispokorni Posts: 2,376

    Hi @robertfreemanday,

    On Ubuntu 22.04 the cgroups behave differently, and the lab produces different results that are inconsistent with the ones from Ubuntu 20.04 (the recommended release/version for this course).

    Regards,
    -Chris

  • hricky
    hricky Posts: 16

    Hi,
    I know Ubuntu 20.04 is the recommended release/version for this course, but since Control Group v2 has recently become the default in some distributions, I think it's useful to know how to modify the lab workflow to handle it, without adding the cgroup v1 workaround. So I tested some cgroup v2 approaches on Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-1051-kvm x86_64) and Fedora CoreOS 39.20240225.1.0 (Linux 6.7.5-200.fc39.x86_64). If any of the other students and forum moderators think it would be useful, I can share them here or in another post for further discussion.

  • jbonde
    jbonde Posts: 1
    edited July 4

    Following the "authoritative documentation" by the writer of cgroups v2 , you can adjust the lab as follows:

    /sys/fs/cgroup is the root cgroup, freezer is not a subgroup, but each cgroup (except root) has cgroup.freeze file. There is also no "tasks", replaced by cgroup.procs

    /sys/fs/cgroup$ sudo mkdir mycgroup - mycgroup is now subgroup of root
    /sys/fs/cgroup/mycgroup$ sudo echo $PID > cgroup.procs --$PID is now part of mycgroup
    /sys/fs/cgroup/mycgroup$ sudo echo 1 > cgroup.freeze --$PID is now "FROZEN"
    /sys/fs/cgroup/mycgroup$ sudo echo 0 > cgroup.freeze --$PID is now "THAWED"

  • lurodrig
    lurodrig Posts: 8

    Hello there,

    @jbonde on ubuntu noble (24.04) your solution works like a charm, thanks!

    Sure 20.04 is the recommended release, however is already 4 years old, would it be worth and feasible ti update the lab then?

    Thank you in advance,

    Luis

  • tkrn
    tkrn Posts: 1

    Thanks this was required for a default install of Ubuntu Oracular 24.10 as well.

Categories

Upcoming Training