Hey Andrew, you know what I do?
I do "seekwrite 100000000 > mydisk ; echo y | mke2fs mydisk".
That creates a 100Mb disk. It only takes about 3Mb on disk.
As long as you don't fill the whole thing, you need much less free
disk space than the size you made the loop. In this case you only need
3Mb + whatever data you put on it. Mtools and hfstools correctly
handle this type of "disk".
I think the loopback device gets an "io error" and "ext2fs" then
usually gets into trouble.
Roger.
-----------------------------
#include <stdio.h>
/* #include <fcntl.h> */
#include <unistd.h>
#include <string.h>
char buf[1024];
int main (int argc,char **argv)
{
long long off;
long long tt;
if (strncmp (argv[1],"0x",2) )
sscanf (argv[1],"%Ld",&off);
else
sscanf (argv[1],"%Lx",&off);
if (argc > 3) {
if (strncmp (argv[3],"0x",2) )
sscanf (argv[3],"%Ld",&tt);
else
sscanf (argv[3],"%Lx",&tt);
if (argv[2][0] == '+')
off += tt;
else
off -= tt;
}
if (llseek (1,off-1024,0) < 0)
perror ("seek");
write (1,buf,1024);
exit (0);
}