You are here: Home Cheat Sheets Linux Directory Quota

Linux Directory Quota

Quick and dirty Linux directory quota.

This arose out of the need to place a size quota on a directory without having to resort to quota software or manual usage checking. It utilizes Linux virtual filesystem support to do the trick. The following assumes we want a ~100MB quota on a directory.

  • Make a mount point
mkdir -p /mnt/quotadir
  • Create an image file for the virtual file system
dd if=/dev/zero of=/mnt/quota.img bs=1024 count=100000
  • Format the drive
mkfs.ext3 /mnt/quota.img
  • Mount the drive
mount -o loop /mnt/quota.img /mnt/quotadir
  • A permanent fstab entry would be
/mnt/quota.img   /mnt/quota       ext3    loop            1 2
Document Actions

Copyright © 2007-2015 Mario Theodoridis. All rights reserved. Content licensed under AFL.   Impressum   Datenschutz
Content from the underlying Plone CMS is © 2000-2009 by the Plone Foundation