Storage Usage Management #
Running baobab (GNOME disk analyzer) as root #
tl;dr #
sudo -E baobab
Details #
When launched from the menu, the Disk Analyzer process run under the current user and does not have access to some system dirs. So, it fails to calculate space usage in these directories.
In Fedora37, we can run it simply with:
sudo baobab
And it would work as expected. Howerver, in Debian, when running this way, it baobab crashes with “segmentation fault” when we select the drive/destination.
The error could be caused by the GTK app’s inability to read some desktop envvars. After googling, we found a guide on running GUI application as root on the ArchWiki page here.
Where one of the suggested ways for running a GUI app as root was to pass the current envvars to the sudo command:
sudo -E baobab
This fixes the issue on Debian 12.
Bonus: It also passes the current theme to the GUI app. I.e., if the desktop is set to use the dark mode, without the -E option baobab still launches using the light mode. With the -E option, it launches in the dark mode.