From: Conor Daly (conor.daly at domain oceanfree.net)
Date: Sun 23 Jul 2000 - 00:36:24 IST
On Sat, Jul 22, 2000 at 05:26:39PM +0100 or so it is rumoured hereabouts,
kevin lyda thought...
>
> as an aside, has anyone tried making an fs in a file, mounting it,
> and then copying the file to the mount point? i don't really have a
> machine to test this on. :) actually i doubt it would crash, the
> fs on the file would fill up.
>
[root at domain Hobbiton cdaly]# dd if=/dev/zero of=./test.img bs=1024 count=300
[root at domain Hobbiton cdaly]# mke2fs test.img
./test.img is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
40 inodes, 300 blocks
15 blocks (5.00%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
40 inodes per group
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
[root at domain Hobbiton cdaly]# mount -o loop -t ext2 test.img ./mnt/
[root at domain Hobbiton cdaly]# cp -v ./test.img ./mnt/
./test.img -> ./mnt/test.img
cp: ./mnt/test.img: No space left on device
[root at domain Hobbiton cdaly]# ls mnt/
lost+found test.img
[root at domain Hobbiton cdaly]# ls -l mnt/
total 289
drwxr-xr-x 2 root root 12288 Jul 22 19:32 lost+found
-rw------- 1 root root 280576 Jul 22 19:33 test.img
[root at domain Hobbiton cdaly]# ls -l te*
-rw-r--r-- 1 cdaly cdaly 307200 Jul 22 19:32 test.img
[root at domain Hobbiton cdaly]# mkdir test2
### Now mount the image stored inside the image :-) ###
[root at domain Hobbiton cdaly]# mount -o loop -t ext2 ./mnt/test.img ./test2
[root at domain Hobbiton cdaly]# ls -l test2
total 12
drwxr-xr-x 2 root root 12288 Jul 22 19:32 lost+found
[root at domain Hobbiton cdaly]# umount test2
[root at domain Hobbiton cdaly]# umount mnt/
[root at domain Hobbiton cdaly]# mount -o loop -t ext2 test.img ./mnt/
[root at domain Hobbiton cdaly]# mount -o loop -t ext2 ./mnt/test.img ./test2
[root at domain Hobbiton cdaly]# ls -l test2
total 12
drwxr-xr-x 2 root root 12288 Jul 22 19:32 lost+found
[root at domain Hobbiton cdaly]# ls -l mnt/
total 289
drwxr-xr-x 2 root root 12288 Jul 22 19:32 lost+found
-rw------- 1 root root 280576 Jul 22 19:33 test.img
[root at domain Hobbiton cdaly]#
### Note how the image inside the image doesn't contain the image...
-- Conor Daly <conor.daly at domain oceanfree.net> Domestic Sysadmin :-)
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:06:57 GMT