ClementTsang/bottom · warning · anyhow::Error

missing filesystem type

Error message

missing filesystem type

What it means

Partition::from_str expects a /proc/mounts-style line with at least a device, mount point, and filesystem type. This error fires when the third field (filesystem type) is missing. It can also surface if FileSystem::from_str itself rejects the fs string.

Solutions

  1. Ensure each mounts line has device, mount point, and fs type fields
  2. Check the fs type string is one the library's FileSystem parser recognizes
  3. Update the library if a new filesystem type must be supported
  4. Skip unparseable lines and continue with the remaining entries

Example fix

// before
let p = Partition::from_str(line)?;
// after
match Partition::from_str(line) {
    Ok(p) => parts.push(p),
    Err(e) => log::debug!("skipping mount line {line:?}: {e}"),
}
Defensive patterns

Strategy: validation

Validate before calling

// Check field count and fs type presence first
let fields: Vec<&str> = line.split_whitespace().collect();
let parseable = fields.len() >= 3 && !fields[2].is_empty();

Try / catch

match Partition::from_str(line) {
    Ok(p) => parts.push(p),
    Err(e) => log::debug!("skipping mount line {line:?}: {e}"),
}

Prevention

When it happens

Trigger: Calling Partition::from_str on a line with only 2 fields, or with a third field that FileSystem::from_str cannot interpret.

Common situations: Malformed mount table entries, unknown/novel filesystem identifiers not covered by FileSystem's enum parsing, or truncated input.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of ClementTsang/bottom@b77d317502 (2026-09-07). Data as JSON: /api/errors/ba5260e14da979e7. Report an issue: GitHub.

Appendix: source

Thrown at src/collection/disks/unix/linux/partition.rs:143

        let device = match parts.next() {
            Some("none") => None,
            Some(device) => Some(device.to_string()),
            None => {
                bail!("missing device");
            }
        };

        let mount_point = match parts.next() {
            Some(mount_point) => PathBuf::from(fix_mount_point(mount_point)),
            None => {
                bail!("missing mount point");
            }
        };
        let fs_type = match parts.next() {
            Some(fs) => FileSystem::from_str(fs)?,
            _ => {
                bail!("missing filesystem type");
            }
        };

        Ok(Partition {
            device,
            mount_point,
            fs_type,
        })
    }
}

#[expect(dead_code)]
/// Returns a [`Vec`] containing all partitions.
pub(crate) fn partitions() -> anyhow::Result<Vec<Partition>> {
    const PROC_MOUNTS: &str = "/proc/mounts";

    let mut results = vec![];
    let mut reader = BufReader::new(File::open(PROC_MOUNTS)?);

View on GitHub (pinned to b77d317502)