Surely -samefile will work for this.

On Tue 24 Dec 2024 at 00:41, Chris Dunlop <[email protected]> wrote:

> On Sun, Jan 03, 2016 at 06:32:52PM +0000, James Youngman wrote:
> >> find does not have the ability to find device nodes with given
> >> major/minor number. It should.
> >
> > If I'm going to spend time working on this, I'm going to need a more
> > convincing argument that that's how I should spend my time.
>
> Just to add a voice...
>
> My use case is to search for all the alternate paths to a specific device.
>
> I was quite surprised to discover that find doesn't support searching by
> major:minor, to the naive eye it looks like something that fits directly
> into the existing options that search on the stat structure.
>
> I can of course use multiple tools (e.g. find + awk) to do what I need
> but it would be nice if "find" were able to do this directly.
>
> tl;dr...
>
> Whilst a ATA security erase is in progress on a device (e.g. hdparm
> --security-erase), all other open()s of the device go into an unkillable
> sleep (wchan:blkdev) until the security erase completes - this can take
> many minutes to >24 hours (e.g. 20T HDD).
>
> This means anything that performs device scans will go into an unkillable
> sleep for the duration, e.g. various utilities from LVM2 like "pvs" and
> "lvs". I have regular operations that require such scans and blocking for
> an hour, let alone 24 hours, is problematic.
>
> LVM2 scans /dev, /sys/dev/block and /sys/block for all block devices and
> tries to open them, subject to a configurable "device filter" that can
> filter devices by filesystem path name.
>
> So I need to find all the paths to a specific major:minor to reject those
> paths using the LVM2 device filter.
>
> An alternate "coding required" solution would be for LVM2 to utilise
> major:minor in it's device filter. This in fact would be the best solution
> to this specific problem (other than secure erase not blocking) and I'll
> see if it's possible to have this added to LVM2.
>
> Cheers,
>
> Chris
>

Reply via email to