dfrs icon indicating copy to clipboard operation
dfrs copied to clipboard

Feature request : Add the ability to list mounts options

Open Troupal opened this issue 2 years ago • 0 comments

Hi dear dev⋅s !

Can you please add the ability to list mount options (or tell us if you plan to release this feature since the MOUNT structure has the mnt_opts element, which seems to imply that it is planned) as seen in parse_mount() test and like the dfctool do : file : dfrs/src/mount.rs:12 (for the struct → :17) :

#[derive(Clone)]
pub struct Mount {
    pub mnt_fsname: String,
    pub mnt_dir: String,
    pub mnt_type: String,
    pub mnt_opts: String,
    pub mnt_freq: i32,
    pub mnt_passno: i32,
    pub capacity: u64,
    pub free: u64,
    pub used: u64,
    pub statfs: Option<nix::sys::statfs::Statfs>,
}

file : dfrs/src/mount.rs:166 (for the test) :

 #[test]
    fn parse_mounts() {
        let file = r#"sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime,hidepid=2 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=2009144k,nr_inodes=502286,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=402800k,mode=755 0 0
/dev/mapper/vg0-root / ext4 rw,relatime,errors=remount-ro 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
pstore /sys/fs/pstore pstore rw,relatime 0 0
configfs /sys/kernel/config configfs rw,relatime 0 0
tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=805580k 0 0
/dev/mapper/vg0-boot /boot ext4 rw,relatime 0 0
/dev/mapper/vg0-tmp /tmp ext4 rw,relatime 0 0
none /cgroup2 cgroup2 rw,relatime 0 0
"#;

Thank you for this great tool and to contrib to the rustutils'vers :+1:

Troupal avatar Jan 26 '23 17:01 Troupal