I'm trying to make a 40GB ext3 local loopback file system. This loopback filesystem is stored on my NAS which is mounted on a Ubuntu Precise 12.04 x64 machine using NFS. The machine has both read and write permissions on the NAS.
I've created a 40GB file for use by running dd if=/dev/zero of=/media/vps/Ironman.ext3 bs=1024 count=40000000
. The file was successfully created, so I mounted is as a loopback system in /dev/loop0
by running sudo losetup /dev/loop0 /media/vps/Ironman.ext3
.
I'm now trying to format this as a ext3 file system by running sudo mkfs -t ext3 -q /media/vps/Ironman.ext3
. However, whenever I run this command I get the following output:
mke2fs 1.42 (29-Nov-2011)
/media/vps/Ironman.ext3 is not a block special device.
Proceed anyway? (y,n) y
/media/vps/Ironman.ext3: Permission denied while setting up superblock
How can I get around this, and format the loopback device as ext3?
Update 1
I've just tried to format it using the loopback device, as seen below. I am still, however, getting permission denied. You can see in the first set the file was already mounted.
danielsgroves@precise64:/dev$ sudo losetup /dev/loop0
/dev/loop0: [0015]:26378243 (/media/vps/Ironman.ext3)
danielsgroves@precise64:/dev$ sudo mkfs -t ext3 -q /dev/loop0
/dev/loop0: Operation not permitted while setting up superblock
Update 2
With verbose output
danielsgroves@precise64:/dev$ sudo mkfs -t ext3 -v /dev/loop0
mke2fs 1.42 (29-Nov-2011)
fs_types for mke2fs.conf resolution: 'ext3'
/dev/loop0: Operation not permitted while setting up superblock
-v
rather than-q
, to hopefully get more details about what's failing.sudo mke2fs -j -v /dev/loop0
will give you an ext3 file system with defaults otherwise. I just tried it myself (except I used a much smaller image file) and it seems to be working fine for me on Debian Wheezy, which shouldn't be that different.sudo strace -o'/tmp/mkfs.syscalls' mkfs -t ext3 -v /dev/loop0
and then post the last 30-50 lines or so from the file mkfs.syscalls created (and particularly anything around printing the "operation not permitted" error message or anything just before it that resulted in such an error). It should tell exactly what mkfs is doing that is not permitted, which might provide a clue pointing toward a solution.