So I've been studying up on the details of the different types of files systems, and have been creating Bootable USBs... A lot... I've been doing this from a Mac, which has been littering anything I plug into it, even after I zero the disk, or do a random overwrite of it, with some metadata files. It got me curious, so I started digging in.

I've been using dd to write the disk's to files, then parsing them in python, to measure (n)-bytes from the beginning, and writing one-liners to parse the output.

Essentially, I want to be able to read the raw data from a disk starting at a specific address, up to a certain address. I'd like to be able to do it from the command line so that I could grep for strings or write different sectors to different files easily. Are there any existing standard tools that do this? (It seems like one of those tasks that there just has to be... but I've been wrong before.)


You can tell dd to read or write portions of a disk. Use the bs parameter to define the block size you want to count in, then skip (when reading) or seek (when writing) to define the starting position and count to define the number of blocks to read. You should also specify iflag=fullblock to avoid surprises with short reads.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.