Needed to do some smoke testing of a java app that was downloading files. In particular I wanted to simulate it running out of disk.
I didn’t want to spin up a virtual machine, so instead I created a virtual disk and mounted it as an ordinary directory. I’d forgotten which commands to use to create, format, and mount a loop device. Blogging them so I can find them again.
1 2 3 4 5 6
Works a treat, and really easy to play with different disk sizes.