Frederic Payet - Availability Services wrote:
Hi gurus,
When creating some small files an ZFS directory, used blocks number is
not what could be espected:

hinano# zfs list
NAME                   USED  AVAIL  REFER  MOUNTPOINT
pool2                  702K  16.5G  26.5K  /pool2
pool2/new              604K  16.5G    34K  /pool2/new
pool2/new/fs2          570K  16.5G   286K  /pool2/new/fs2
pool2/new/fs2/subfs2   284K  16.5G   284K  /pool2/new/fs2/subfs2


hinano# pwd
/pool2/new/fred

hinano# zfs get all pool2/new
NAME             PROPERTY       VALUE                      SOURCE
pool2/new type filesystem - pool2/new creation Tue Mar 20 13:27 2007 - pool2/new used 603K - pool2/new available 16.5G - pool2/new referenced 33.5K - pool2/new compressratio 1.00x - pool2/new mounted yes - pool2/new quota none default pool2/new reservation none default pool2/new recordsize 128K default pool2/new mountpoint /pool2/new default pool2/new sharenfs off default pool2/new checksum on default pool2/new compression off default pool2/new atime on default pool2/new devices on default pool2/new exec on default pool2/new setuid on default pool2/new readonly off default pool2/new zoned off default pool2/new snapdir hidden default pool2/new aclmode groupmask default pool2/new aclinherit secure default hinano# mkfile 9 file9bytes
hinano# mkfile 520 file520bytes
hinano# mkfile 1025 file1025bytes
hinano# mkfile 1023 file1023bytes
hinano# mkfile 10 file10bytes

hinano# ls -ls
total 14
  3 -rw------T   1 root     root        1023 Apr  4 13:34 file1023bytes
  4 -rw------T   1 root     root        1025 Apr  4 13:34 file1025bytes
  1 -rw------T   1 root     root          10 Apr  4 13:38 file10bytes
  3 -rw------T   1 root     root         520 Apr  4 13:33 file520bytes
  2 -rw------T   1 root     root           9 Apr  4 13:33 file9bytes

After 2 seconds :
hinano# ls -ls
total 13
  3 -rw------T   1 root     root        1023 Apr  4 13:34 file1023bytes
  4 -rw------T   1 root     root        1025 Apr  4 13:34 file1025bytes
  2 -rw------T   1 root     root          10 Apr  4 13:38 file10bytes
  3 -rw------T   1 root     root         520 Apr  4 13:33 file520bytes
  2 -rw------T   1 root     root           9 Apr  4 13:33 file9bytes

2 questions :
- Could somebody explain why a file of 9 bytes takes 2 512b blocks ?

One block for the znode (the meta-data), one block for the data.

- Why the block number of file10bytes has changes after a while doing
 nothing more than 'ls -ls'

The block count reflects the actual allocated storage on disk.  The
first time you did an 'ls' the data block had not yet been allocated
(i.e., the data was still "in transit" to the disk).


Please reply me directly as I'm not in this alias .

Best,
fred




_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to