haskellxmonadslackwarexmobar

Xmobar DiskU not get the root partition information in Slackware 15


I trying to show the root partition usage in the Xmobar (with XMonad), but not working!! Without any verbose or error message. I don't know if the problem is the way as the Slackware loading the root partition or its way of the xmobar working. Explaining the context: The disk have three partitions: "swap", "/" and "/home"

/dev/sda1 is the /
/dev/sda2 is the swap
/dev/sda3 is the /home

in the Slackware, the system creates a virtual mount point to "/dev/sda1" calling it the "/dev/root" with mount point to "/"

In the Xmobar (.xmobarrc file), any of the options below not work:

- Run DiskU [ ( "/", "<size>" ) ] [] 20
- Run DiskU [ ( "root", "<size>" ) ] [] 20
- Run DiskU [ ( "/dev/root", "<size>" ) ] [] 20
- Run DiskU [ ( "sda1", "<size>" ) ] [] 20
- Run DiskU [ ( "/dev/sda1", "<size>" ) ] [] 20

and calling

- Run DiskU [ ( "/", "<size>" ), ("/home", "<size>") ] [] 20

where "/home" is the "/dev/sda3" partition, works fine to get the information about "/home"

Reading Xmobar sources, i see that the list of the available partition is read from "/etc/mtab". In my case, the "/etc/mtab" have de list of partitions below:

/dev/root / ext4 rw,relatime 0 0
...
/dev/sda3 /home ext4 rw,relatime 0 0

but i don't get the DiskU function works...

Any idea is welcome to solve this problem...

thanks in advance!


Solution

  • The solution:

    Slackware set the mount point of /dev/sda1 to /dev/root automatically in /etc/mtab, but /dev/root is a virtual device and not exists in /dev folder. Xmobar try to access the device /dev/root and not found it.

    The most simple solution is creation of a symbolic link to /dev/root on system startup. In this case, in Slackware, edit the file /etc/rc.d/rc.local and add:

    ln -s /dev/sda1 /dev/root
    

    Problem solved!