[Tux3] Tux3 command interpreter

Daniel Phillips phillips at phunq.net
Mon Sep 1 13:15:02 PDT 2008


Tux3 now has a command interpreter to aid in debugging, with commands
like:

   tux3 make foodev

that makes a filesystem on device foodev, which can also be a file.  It
normally is a file for me and I make it sparse like this:

   dd if=/dev/zero of=foodev bs=1 count=1 seek=100K

I can see how many blocks tux3 actually used in it by:

   du foodev

less the few blocks that the sparse file has for metatdata and the
little blob of data at the end that dd puts there.  (I don't know how
to make dd truncate without writing, I am not sure it is possible.)

Then:

   echo "hello world!" | tux3 write foodev foo

creates and writes to file foo in foodev.  A subsequent write will
fail with EEXIST, which is maybe not quite what we want.

Finally:

  tux3 read foodev foo

outputs "hello world!".

The following command sequence is particularly interesting:

   tux3 make --blocksize 256 foodev
   echo hello | tux3 write --seek 72057594037927930 foodev foo
   tux3 read --seek 72057594037927930 foodev foo

It writes "hello" into the last few bytes of a 64 Petabyte file, the
largest that Tux3 can create with 256 byte blocks :-)

Using "du foodev" before and after creating and writing to its
filesystem shows that Tux3 only used 8K for the entire filesystem
including the multi-petabyte sparse file, root directory, inode table
and allocation bitmaps.

To build tux3:

   g99 -g -Wall -lpopt buffer.c diskio.c tux3.c -otux3

Regards,

Daniel


_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://tux3.org/cgi-bin/mailman/listinfo/tux3



More information about the Tux3 mailing list