Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disk widgets won't display anything on Void Linux with an encrypted disk #419

Closed
Bumbadawg opened this issue Feb 19, 2021 · 14 comments
Closed
Labels
bug Something isn't working the way that is expected.

Comments

@Bumbadawg
Copy link

Describe the bug

Disk widgets won't display anything on Void Linux.

bottom version

bottom 0.5.7

Installation method

Btm either installed through package manager or through cargo.

Operating system, OS version, and architecture

  • Linux (x86_64, i686, aarch64) Void Linux

Terminal (i.e. urxvt, kitty, etc.)

didn't impact.

Shell (i.e. zsh, bash, etc.)

zsh

Rust version

1.48

@Bumbadawg Bumbadawg added the bug Something isn't working the way that is expected. label Feb 19, 2021
@ClementTsang
Copy link
Owner

Hmm... I'll take a look in a while.

@ClementTsang
Copy link
Owner

ClementTsang commented Feb 23, 2021

@Bumbadawg well this is weird - I tried installing void onto a VM, then installed bottom via cargo and:

image

Disk seems fine for me.

The only difference I can think of is that I used rust 1.50, but I really don't think that would have caused it to magically work for me...

@jubelbube
Copy link

Hello,
I have the same problem while using a NVMe drive and LVM on LUKS
bottom 0.5.7
installed via xbps
Void Linux (musl)
terminal: st
shell: mksh / bash
rustc 1.48.0

@ClementTsang
Copy link
Owner

Tried running it on my VM again, this time dropped to rustc 1.48 and tried both musl and gnu. Also tried installing via xbps.

image

In all cases, I just can't seem to replicate either of your findings, which makes trying to fix the problem (whatever it is) basically impossible for me... so I might need some help.

If any of you two (or anyone else with this issue who sees this thread) can try to do the following for me:

  1. Clone heim at https://github.com/heim-rs/heim
  2. cd into the repo, then cd into examples/
  3. cargo run --example disk_usage, report back what your output.

When I run it on my machine, I get something like:

Device            Total, Mb  Used, Mb   Free, Mb   Type       Mount
/dev/nvme0n1p2    105152     58064      41702      ext4       /
/dev/nvme0n1p3    396779     207342     169210     ext4       /home
/dev/sda2         100        72         28         vfat       /boot

If you get an empty output or some error, then please let me know as well.

If it does work, then could you also try running one of the nightly versions and see if that works?

I know this is asking a lot, but it'll help a lot in narrowing down the issue.

Thanks!

@jubelbube
Copy link

jubelbube commented Feb 24, 2021

ok, I went through the steps, this is what I get:
sudo cargo run --example disk_usage

Device Total, Mb Used, Mb Free, Mb Type Mount
/dev/mapper/voidvg-root 52576 6680 43194 ext4 /
/dev/mapper/voidvg-home 31568 1427 28513 ext4 /home
/dev/nvme0n1p1 535 0 535 vfat /boot/efi

Next will try the nightly versions (later today)
YET: Out of curiosity I tried sudo btm and that works. So it might have to do with permission
or users being in certain groups.

Thanks for your help to this point!

extracted bottom_x86_64-unknown-linux-musl.tar.gz
./btm
No Disks found
sudo ./btm --> gives the disk info like sudo cargo run --example disk_usage did.

@ClementTsang
Copy link
Owner

Huh, weird that heim worked without sudo but bottom had issues...

That definitely does help a bit though, thanks a ton!

@jubelbube
Copy link

Sorry, I was wrong, I ran that with sudo as well. Edited above.

@ClementTsang
Copy link
Owner

Gotcha. I can probably try to see if there's any workarounds when I have some time, then.

@jubelbube
Copy link

ok, I finished my "work": nightly tested and post edited.
Thanks again

@Bumbadawg
Copy link
Author

Bumbadawg commented Feb 24, 2021

I use LVM+LUKS as well.
Updated to Rustc 1.50 didn't change the outcome.

Disk Example code worked for listing the LVM disks but then fails and exit on this error (before even listing the regular disks.

Error: Error { source: Os { code: 13, kind: PermissionDenied, message: "Permission denied" },
context: Some(Ffi { func: "statvfs" }) }

And... "sudo btm" works for the disks.. Although no read/write speed is harvested (N/A) for the LVMs.
In VoidLinux, this is possibly related to user groups and rights. For instance, by default you can't mount a phone without changing your user to the adequate group.

@ClementTsang
Copy link
Owner

ClementTsang commented Feb 24, 2021

Alright, thanks, I'll try to tackle this sometime this week now that it's more clear what the issue is.

EDIT: Yeah, LUKS was the thing that I needed to replicate this problem. Thanks for all the help!

EDIT 2: Just for curiosity's sake, I tested full-disk encryption on a PopOS VM, and it worked fine there. So this seems to be a thing mostly specific to Void (or distros with a similar behaviour to it in regards to user permissions).

@ClementTsang ClementTsang changed the title Disk widgets won't display anything on Void Linux. Disk widgets won't display anything on Void Linux with an encrypted disk Feb 24, 2021
@ClementTsang
Copy link
Owner

ClementTsang commented Feb 25, 2021

Both the I/O being missing and the missing disks issue should be fixed. There might be some disks that aren't showing usage in the used/free/total areas, that's normal.

If possible try out a nightly build/clone the repo and tell me if it works for you.

@jubelbube
Copy link

I downloaded bottom_x86_64-unknown-linux-musl.tar.gz
and also from GIT git clone https://github.com/ClementTsang/bottom which compiles ok.
Looks ok now, showing disk info without root privileges:
both logicial volume (root and home) with used/free/total/read/write
EFI boot partition (/boot/efi) used/free/total show N/A, no I/O output (which all is no problem for me)
Thanks for your efforts!

@Bumbadawg
Copy link
Author

We can now enjoy a fully-stacked rust bottom ! Thanks @ClementTsang you rock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working the way that is expected.
Projects
None yet
Development

No branches or pull requests

3 participants