Skip to content

Why lsof scan the whole filesystem #341

@yuanjianpeng

Description

@yuanjianpeng

I mount sdc to /mnt/sdc which is btrfs filesystem with subvolume,
When umount, it's busy, so I use the command lsof -x f +D /mnt/sdc to inspect which program using sdc.

But lsof command hang for too long, it scan the whole /mnt/sdc filesystem which has millions of files.
As my knowledge, lsof just need scan /proc/*/fd, to filter paths that belong to /mnt/sdc, why scan the filesystem ?

is there any option to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions