Jason (jcreed) wrote,
Jason
jcreed

Continuing in the vein of ever-so-slightly-obscure but useful facts that I am discovering for various ancillary reasons stemming from trying to re-immerse myself in the C-hacker/unix-weenie mindset, I discovered (thanks to spoons answering a vague question) that you can view any file in your typical linux filesystem as a block device, by using the so-called loop device. I thought you had to muck around with ramdisks (whose sizes are irritatingly are usually configured at kernel load time, requiring a reboot to change them) and dd and stuff.

The executive summary from wikipedia is that (assuming example.img is a disk image) you do this:
losetup /dev/loop0 example.img
mount /dev/loop0 /home/you/dir


and then /home/you/dir is a mounted peephole into example.img. I find this cute, and very much In The Unix Spirit somehow.
Tags: unix
Subscribe

  • (no subject)

    Some further progress cleaning up the https://xkcd.com/1360/ -esque augean stables that is my hard drive. Tomato chicken I made a couple days ago…

  • (no subject)

    Did some personal archaeology. Helped a little with laundry. Threw some chicken, onions, tomato, stock, peppers in the slow cooker and hopefully…

  • (no subject)

    Dinner with akiva and dannel at nuevo portal in carroll gardens. Ate a pile of chicken stew and rice and beans and maduros, good times. I do miss…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 7 comments