How can I remove cgroup version 1 mount points such that I only cgroup version 2 in my /sys/fs/
?
Asked
Active
Viewed 1,440 times
1

Evan Carroll
- 30,763
- 48
- 183
- 315
1 Answers
1
One easy way to do it is like this,
mount -t cgroup | cut -f 3 -d ' ' | xargs sudo umount
This will select only the mounts that are part of cgroup
version 1, taking just their mount points and then unmounting them.
Update: You may also want to clean up the remaining relics on tmpsfs
mount at /sys/fs/cgroup
(taken from the answer there),
sudo mount -o remount,rw /sys/fs/cgroup
# Delete the symlinks
sudo find /sys/fs/cgroup -maxdepth 1 -type l -exec rm {} \;
# Delete the empty directories
sudo find /sys/fs/cgroup/ -links 2 -type d -not -path '/sys/fs/cgroup/unified/*' -exec rmdir -v {} \;
sudo mount -o remount,ro /sys/fs/cgroup

Evan Carroll
- 30,763
- 48
- 183
- 315