Menu

#46 find ignores device

general
open
nobody
None
5
2017-02-01
2016-11-02
Hubbitus
No

./sfk181-linux-64.exe find -pat test -file /dev/mapper/astra-root
returns nothing, but grep -a find many matches.

Futhermore hexfind command trying replace something in strange way:
./sfk181-linux-64.exe hexfind -pat investSearchPatternQwertyQaz -file /dev/mapper/astra-root error: incomplete replacement pattern: investSearchPatternQwertyQaz note : patterns must look like "/from/to/" or "_from_to_" note : with three times a delimiter character like / or _ note : if "investSearchPatternQwertyQaz" is a single filename, specify it as first parameter. note : say -dir ... -file ... to specify multiple target files. 1 errors occurred.

Discussion

  • stahlworks

    stahlworks - 2016-11-02

    I don't know what this device is, but for example

     sfk list -size /dev/mapper/
    

    may only tell "non-regular files skipped",
    so SFK is unable to open device files in this folder for reading.

    Other devices like /dev/urandom may fail because sfk tries
    to determine the file size first, which always returns 0 in these cases.

    SFK is intended primarily for normal files, but not for device files.

    The hexfind requires to write a delimiter like / around patterns, opposed to the find command.
    So use instead

    sfk hexfind myfile.txt -pat "/test/"
    
     
    • Hubbitus

      Hubbitus - 2017-01-31

      Is there option to insist search in devices for find?

       
  • stahlworks

    stahlworks - 2017-02-01

    I have never seen a /dev/mapper/astra-root on any linux.
    I've only seen a /dev/mapper/control, and trying

    grep -a test /dev/mapper/control
    

    produced

    grep: /dev/mapper/control: Invalid argument
    

    furthermore,

    cat /dev/mapper/control >/tmp/out.dat
    

    produced

    cat: /dev/mapper/control: Invalid argument
    

    Do not use find but xhexfind directly on the file like

    sfk xhexfind /dev/mapper/astra-root "_mytext_"
    

    as this will definitely try to open the file, which may still fail.
    There is no special option as I don't know what that option could do any different.

     
    • Hubbitus

      Hubbitus - 2017-05-06

      I have never seen a /dev/mapper/astra-root on any linux.

      It is just LVM2 device!
      You may just try on /dev/sda or /dev/vda or so on.

       

      Last edit: Hubbitus 2017-05-06

Log in to post a comment.