0

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!

2 Answers2

0

With a mount table containing

/dev/sda1 / ext4 rw,relatime 0 0
# ...
/dev/sda3 /home ext4 rw,relatime 0 0

an xmobar configuration along these lines should actually work:

Config
  { -- ...
  , template = "... %disku% ..."
  -- ...
  , commands =
    [ -- ...
    , Run DiskU
      [ ( "/",     "Root: <usedp> (<used>/<size>)")
      , ( "/home", "Home: <usedp> (<used>/<size>)")
      ]
      [] 20
    -- ...
    ]
  -- ...
  }
pmf
  • 24,478
  • 2
  • 22
  • 31
  • thanks for your answer!! But this solution not working... The problem is that the Slackware changes `/etc/fstab` mount point of `/dev/sda1` to `/dev/root` in normal mounting and in the bind mounting automatically. Yet that i use bind mode of `"/"` to `"/mnt/hd"` in `"/etc/fstab"`, the device in the file `"/etc/mtab"` stay `"/dev/root"` in this case. It's looks a slackware security policy... – Jiuney Pachevitch Oct 25 '22 at 01:50
0

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!