in reply to Re: imitation block device in linux
in thread imitation block device in linux

If the OP wants to take that road then the O'Reilly book Linux Device Drivers is available. The text is under a liberal open source licence, so you can read it online for free.

Another approach would be to create a FUSE filing system, and create an artificial block device or mountable file-system image inside.

Having said that, I doubt that the OP really needs to write a block device.

Replies are listed 'Best First'.
Re^3: imitation block device in linux
by butchie3980 (Acolyte) on Mar 19, 2011 at 08:32 UTC
    Yeah, I'm trying to imitate a block device, one that can be accessed by programs like dd, or even mounted with the mount command. My intention is to intercept read/write/seek operations and manage the data as it goes back and forth (logging, encryption, etc). I was hoping to stay with perl, but it looks like I might have to spend some learning curve on C?
      I'm trying to imitate a block device, one that can be accessed by programs like dd

      Have you thought of making a ramdisk... it essentially makes a little disk device in your ram memory, which you can treat exactly like a disk.

      Google for ramdisk linux for many guides.

      UPDATE: I forgot to mention a loopback filesystem, where you can mount a file with the -o loop option and it acts like a disk device also.


      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku ................... flash japh