I have an Amazon EC2 instance which I am using as a NFS file server.
It's using a 5x1TB volume RAID0 array.
The system is very I/O intensive and files are being written/copied/deleted through the NFS share all the time.
Quite often, I notice that there's a BIG discrepancy between the disk space used and the available free space. (I am checking while the system is idle and no files are being written to the file share/system).
My only "Fix" for this is to shutdown the instance and restart it (reboot doesn't work and just hangs the machine).
When it restarts, it runs fsck and I can see in the system log (many) "unreferenced " Inodes being cleaned up (this is not the entire log):
25.110924] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291727
[ 25.114687] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291723
[ 25.118610] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291703
[ 25.135184] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291722
[ 25.140005] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291725
[ 25.144013] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291705
[ 25.148008] EXT4-fs (dm-1): 735 orphan inodes deleted
[ 25.150286] EXT4-fs (dm-1): recovery complete
[ 26.126887] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: (null)
[ OK ]
I can't find any solution for this anywhere online. Does anyone know what's causing this or how to prevent it? Or maybe fix it without unmounting the drive ?
Some more info:
Version information:
Linux version 3.10.42-52.145.amzn1.x86_64 (mockbuild@gobi-build-64003) (gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC) ) #1 SMP Tue Jun 10 23:46:43 UTC 2014
RAID0 array mount on /etc/fstab as follows:
/dev/vg0/data /data ext4 defaults,auto,noatime,noexec 0 0
/etc/mdadm.conf:
DEVICE /dev/xvdk /dev/xvdj /dev/xvdi /dev/xvdh /dev/xvdg
ARRAY /dev/md0 metadata=1.2 name=ip-172-31-10-215:0 UUID=4c4fb472:e0540788:69a83d01:a75a8a3e
/etc/exports:
/data *(rw,sync)
Clients mount the NFS share as follows:
x.x.x.x:/data /mnt/fileserver nfs defaults 0 0