Product SiteDocumentation Site

2.2.2. Exercise 2

Make an XFS filesystem to contain many small files per directory
  1. Create the filesystem.
    # mkfs -t xfs -f -b size=512 -n size=4096 /dev/sda4
    meta-data=/dev/sda4              isize=256    agcount=16, agsize=3692941 blks
             =                       sectsz=512   attr=0
    data     =                       bsize=512    blocks=59087056, imaxpct=25
             =                       sunit=0      swidth=0 blks, unwritten=1
    naming   =version 2              bsize=4096
    log      =internal log           bsize=512    blocks=28851, version=1
             =                       sectsz=512   sunit=0 blks
    realtime =none                   extsz=65536  blocks=0, rtextents=0
    # mount /dev/sda4 /mnt
    # cd /mnt
    # for file in `seq 0 1000`; do echo $file > $file; done
    # du -k
    537     .
    
  2. Try the same test with a default block size of 4KB and verify the savings for yourself.