Anecdotes from a Linux Systems Administrator. /root

Home About Books Blog Portfolio Archive
17 December 2012

Creating a loopback file system for testing purposes

by Alpha01

Using the all mighty dd tool, this example the block size is 1024 bytes and a total of 5000 blocks:

dd if=/dev/zero of=/tmp/temploopbackimage.img bs=1024 count=5000

Associate the image file to the loopback device

losetup /dev/loop3 /tmp/temploopbackimage.img

Now you should be able to format /dev/loop3

Tags: [ testing ]