> I created a block device on an ext2 partition. I ran mkreiserfs on that 
> device. What is the size of this device that I have created?
That depends on how you created it. If you used mknod and created a block
special, the data for the device will be stored on a physical partition,
and the size of the device will be equal to that of the partition.

If you created an ordinary file using e.g. dd, and attached the loopback
block device to it, then the device's size is equal to that of the
underlying file.

> Once I mount the
> device and use df, the size of the device is greater than that of the ext2 
> partition in which I created the device.
This could happen trivially if the device is a block special and the target
partition is larger than the containing partition.

It can also happen using loopback devices if the partition file is sparse.
This means that large chunks of the file which are full of zeros do not
need to be stored. A file created using
``dd if=/dev/zero of=some_file count=1 seek=100'' will be sparse, for
instance. To check whether a given file is sparse, compare the sizes
given for it by ls and du - du gives the amount of disk allocated,
whereas ls gives the number of bytes which can be read from the file,
so du sizes are smaller than ls sizes for sparse files.

Some old documents recommend the use of sparse files for filesystem images,
in order to save space. However, this is an extremely bad idea on recent
kernels, and can cause a deadlock, which will bring the system to its
knees in a few minutes. I tested this before sending this message, and
it's still a problem on 2.4.18. :)

> /natarajan/reiser.fs  3.7G     33M  3.6G   1% /natarajan/mount
I'd guess from this that you're using a sparse filesystem image file.
You might want to reconsider.

Steven Smith,
[EMAIL PROTECTED]

Attachment: msg01015/pgp00000.pgp
Description: PGP signature

Reply via email to