Current implementation in user space: ELASTIC QUOTA FILE SYSTEM Amit Gud Aim: The aim of the project is to maximize the use of server hard disk space usage to the users over a network. Overview: A typical network scenario, for example in corporate or college environment, is that a fixed hard quota is allocated for each user, which the user is not allowed to extend in any case. This fixed quota is sometimes quiet insufficient for some of the users. On the other hand there is a class of users who don’t even use 5 – 10 % of their quota. So the idea of the project is to make the quota little flexible and let the users use the disk space ‘as much as they like’ but with an agreement with the OS. In this project the hard quotas for each user is fixed, say 10 Mb, by the normal quota management tool edquota. Now if an user wants to save some 5 Mb file in his quota which is already having 7 Mb filled, the user sites some files, say of 3 Mb, in his already saved 7 Mb and makes them ‘elastic’. Now when he sets 3 Mb of files as elastic, his quota is extended to occupy 6 Mb more of non-elastic files. When an user makes a file elastic, he runs through an agreement with the OS that whenever OS is in need of hard disk space the files which are marked elastic will either be deleted, compressed or moved somewhere else (in a different partition or over a network) depending upon the policies set by the user during making the files elastic. So user marks file elastic saying that, “this file is trivial but I don’t want it to be deleted now.” There is a certain kind of risk involved by making a file elastic, so the user marks elastic only if it he thinks it is trivial. But the advantage is he definitely gets his quota ‘extended.’ Such system instantly optimizes the disk space usage to the users who needs the space but cannot use it, even if it is available, just because it is allocated to some other user which is least interested in using it. EQFS works around with two thresholds, 'User Threshold' and 'Disk threshold'. User threshold defines the total amount of space allocated to the users. Disk threshold defines the amount of space that is to be kept free at any given time. Elastic files are operated on (deleted, compressed or moved) in two cases: when total user usage increases the user threshold or when total available space on disk is less than disk threshold. Both values can be set independently at anytime and both are optional. Design: EQFS is called a file system because it intercepts the Virtual file system (VFS) calls. This interception makes EQFS independent of the underlying file system (ext2, ext3 …). EQFS runs as a thin layer between kernel and VFS layer. A kernel module intercepts the VFS calls. This module registers a character device at some known unused major number and passes or logs the necessary system call information like unlink, rmdir, chown etc. A daemon running in user space reads the device continuously (or on an interval) and acts upon the calls accordingly. For example if a file is renamed, the daemon checks if that file is elastic in the GDBM database; if found, the file is removed from the database. Also for example, if the owner of the file is changed, the database is updated accordingly. EQFS maintains a user space GDBM (GNU Data Base Manager) database of all the elastic files. Making a file elastic includes adding it to this database and increasing the user's quota by the amount equal to the size of the file. This method avoids altering the inode of every file to accommodate the extra attribute – elastic, which would require altering every underlying file system used (ext2, ext3 …) and thus recompiling the kernel during EQFS installation, which is certainly undesirable. The fields in the table are – file path, operation (delete, move, compress), parameter (if move – where to move, if compress – name of the file to be saved), owner and file size. The daemon also periodically checks that whether free disk space is equal to or more than disk threshold and total user usage is less than user threshold. EQFS implements following user commands for adding and removing elastic attribute to the files: mel – make file elastic Syntax: mel