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

Make disks show info about unmounted disks as well, first effort #1446

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CongLuanTran
Copy link
Contributor

We clone the keys of procfs_disk_stats to create a list of all disks, including unmounted ones, and let's call that unmounted. Then after adding the mounted disks (and at the same time removing those disks from the unmounted), we can iterate over unmounted and add the remaining disks.

Unmounted disks will have "Unknown" file system and empty mount point, except Zram, which has "swap" file system and "[SWAP]" mount point (like lsblk).

@GuillaumeGomez
Copy link
Owner

Not sure if it's really useful but if you're willing to implement it for all sysinfo supported systems, I'm fine with it.


container.push(new_disk(
disk.as_ref(),
mount_point,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this new feature, I think mount_point should become an enum looking like this:

enum MountPoint {
    Path(Path)
    Swap,
    Unmounted,
}

@CongLuanTran
Copy link
Contributor Author

I don't have a Mac (and don't know it's system), so I doubt I can implement for it. But I can try with Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants