Sample Header Ad - 728x90

Searching a 1T block device for a specific byte sequence at a specified offset

0 votes
0 answers
78 views
I'm performing data recovery after an accident with dd. In the longer term, I'll need to use some recovery tools to try and repair the file system In the meantime, there's an image on the system that I need, which if I can find, I'll be able to use to image a device. The byte sequence is "\x21\x35\x2c\x66\xe4\xe8\x48\xe0\xf9\x4a\x92\x\x7f\x3f\xb7\x6e". I've tried using mmap in Python, but as far as I am aware, mmap.find() doesn't permit block devices from being opened, as I seem to get an error every time I try. I've tried using other tools, such as dd in combination with grep, but it searches at the start of the disk when it'll likely be towards the end. The scanning is taking an incredibly long time. So tl;dr what is the best method to search 1TB of data with the following requirements: * bytestring * at a specified offset * can search the file without trying to open it in one go (like Python's with open) * can read an unmounted block device
Asked by user587941 (1 rep)
Oct 6, 2023, 08:24 PM