Tag Archives: filesystem

LVM: reduce partition size

# umount mountpoint with lvm partition
unmount /data

# check for errors and fix them
fsck -f /dev/sys/data

# resize filesystem to 80Gb
resize2fs /dev/sys/data 80G

# deactivate logical volume
lvchange -an /dev/sys/data

# change size of logical volume
lvreduce --size 191G /dev/sys/data

# create new volume «drbdmaster» in logical group «sys» with size 4Gb
lvcreate -n drbdmaster -L4G sys

# activate volumes
lvchange -ay  /dev/sys/data
lvchange -ay /dev/sys/drbdmaster

# mount data
mount /dev/sys/data

# create filesystem on drbdmaster
mkfs.ext4 /dev/sys/drbdmaster

# mount drbdmaster
mkdir -p /drbd/master
mount /dev/sys/drbdmaster /drbd/master

iozone: fs benchmark

Install iozone(in ubuntu apt-get install iozone3 -y)

Run: iozone -i0 -i2 -s2g -r64k, where:

  • -i0 line read/write (everpresent test)
  • -i2 random read/write (interested in test)
  • -s2g size of test file in gigabytes (may use another postfix k, m) this file should me more then cache size
  • -r64k size of fs block (use 4-64k)
  • -O if you want to see results in operations per second

Example result (in KB):

        File size set to 2097152 KB
        Record Size 64 KB
        Command line used: iozone -i0 -i2 -s2g -r64k
        Output is in Kbytes/sec
        Time Resolution = 0.000001 seconds.
        Processor cache size set to 1024 Kbytes.
        Processor cache line size set to 32 bytes.
        File stride size set to 17 * record size.
                                                            random  random    bkwd   record   stride
              KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
         2097152      64   14485  219053                   5057290   31331

Howto make tests on NFS