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

Highlight btrfs subvolumes and mount points; output mount point info #452

Closed
wants to merge 13 commits into from

Conversation

daviessm
Copy link
Contributor

@daviessm daviessm commented Dec 8, 2018

Ref: #434

I don't expect you to pull this straight in; I'm not a Rust developer so a lot of this code probably isn't very Rust-y and will need error handling and fixups.

That said, I've tested locally and it does what I think it should: identifies btrfs subvolumes and highlights them with the ^ character in the first column (list view) and funky colouring. Mount points are also underlined in all views and in list view include an arrow -> pointing to the device name and filesystem type. That would probably be better as an option, of course.

The code for looking up mount points was borrowed from https://github.com/acdha/mountstatus/tree/master/src/get_mounts and expanded to get the fs type and device name. It would be nice to also get the mount options because the mount point alone isn't very useful for btrfs at least. Also, I don't have a non-Linux system to test on so bsd.rs is almost certainly broken.

There's also the case that a directory could be both a mount point and a subvolume - i.e. a btrfs subvolume is mounted at that point. I'd like to highlight that in the colouring somehow but couldn't think of a good way to do it (background and underline maybe). Likewise, first character in list view would be nice to have different for mount points. Perhaps it would be possible to do something funky with colours.

Comments welcome.

@ariasuni
Copy link
Collaborator

I was almost sure I left a comment here a few weeks/months ago, but apparently not… Would you be able to update your code so that it can be merged? That sounds like an interesting feature to have, especially since Btrfs is used a lot nowadays.

@daviessm
Copy link
Contributor Author

Yeah, I've been meaning to do this for ages! I'll send a new PR when I've rebased it (or rewritten it with my improved Rust knowledge).

@daviessm
Copy link
Contributor Author

Superseded by #941

@daviessm daviessm closed this Aug 25, 2021
@daviessm daviessm deleted the mountpoints branch March 18, 2022 19:41
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.

3 participants