dinit -S option

Sorry if this is a red herring, and perhaps I’m doing something wrong,
but the “-S” option on dinit doesn’t seem to be working properly when
building a file system in a file.

If “dinit file” is used, and then “file” is mounted, everything works
properly.

If “dinit -Ssize file” is used, regardlss of whether “size” is smaller
or larger than the existing size of the file, then “file” is corrupted.
The file can be mounted, but “df” shows garbage for the free space and
attempting to copy files on to the mountpoint gives a filesystem corrupt
error.

I was thinking that this worked ok at some point in that past, perhaps
6.1, but maybe I’m doing something wrong. My recollection is that I
used to do:

touch fs
dinit -S32m fs
mount fs /mnt

and it worked fine, but that no longer works. Even if the file is
pre-initialized to 32MB worth of zeroes, it still fails if the -S option
is given. But if the file is pre-initialized and the -S option is
omitted, then the file is generated correctly.

Thanks,

lew

Lewis Donzis <lew@nospam.donzis.com> wrote:

Sorry if this is a red herring, and perhaps I’m doing something wrong,
but the “-S” option on dinit doesn’t seem to be working properly when
building a file system in a file.

The whole “dinit -S” is a known bug (internal PR/11227), but will be
fixed in 6.2.1.

I was thinking that this worked ok at some point in that past, perhaps
6.1, but maybe I’m doing something wrong. My recollection is that I

I don’t think it ever worked (properly). For now, to create a
filesystem-in-a-file, you should be able to pregrow a file yourself
(using something like “dd”), and then just “dinit” it (without the
‘-S’ option). Like this:

dd if=/dev/zero of=/tmp/QNXFS count=2048

2048+0 records in
2048+0 records out

dinit -q /tmp/QNXFS

mount -tqnx4 /tmp/QNXFS /qnx4

df -kP /qnx4

Filesystem 1024-blocks Used Available Capacity Mounted on
/tmp/QNXFS 1024 21 1002 3% /qnx4/