Disk quota management Introduction With multi users systems, administrators must protect against users filling the disk. This happens because some users love to keep too much, or simply because they have runaway programs which goes and fill the disk. It is possible to limit the amount of files and direc- tories and the amount of disk space used by a user. 11.. SSoommee ccoonncceeppttss 11..11.. PPeerr ddeevviiccee//ppaarrttiittiioonn ccoonnttrrooll Disk quotas are managed partition per partition. There is no relation between the disk quota setup for each partition. Further, you may enable disk quota on some partitions while disabling it one others. 11..22.. UUsseerr aanndd ggrroouupp qquuoottaass You may control disk quota user per user. You can also work at the group level. Both quotas are setup completely independently. A group with a hundred of users may have a disk space quota of much less than the total of all disk space quota of its users. When a file is created by a user, it belong to that user and to some group. The disk quota record of the user is updated and the disk quota record of the group is updated. A user may have plenty of available disk quota, but the group may be out of quota. Because of that the user won't be able to use more disk space. 11..33.. GGrroouupp qquuoottaass aanndd MMeemmbbeerrss ddeeffaauulltt qquuoottaass _L_i_n_u_x_c_o_n_f lets you manage quota with great flexibility. While you can configure the quota limits user per user, most administrators will choose to operate more globally. Further, Linuxconf lets you partially fill quota specifications. This lets you used some defaults for a user and override only a single specification (maximum file allowed for example) 11..44.. DDiisskk qquuoottaa iinnffoorrmmaattiioonn You can control to aspect with disk quotas: The number of files and directories owned by a user (or group) and the amount of disk space own. Both information is controlled separately. It is possible to have no limit on one while enforcing some limits on the other. Each aspect is controlled by three parameters: +o _S_o_f_t _l_i_m_i_t The soft limit is a proposed operational limit. The user/group may exceed this limit, but for a limited amount of time. +o _H_a_r_d _l_i_m_i_t This limit can't be exceed. +o _G_r_a_c_e _p_e_r_i_o_d This is the amount of time the user/group may exceed the soft limit. It default to 7 days. It is expressed in days:hhours:minutes:seconds formats. 11..55.. PPoossssiibbllee vvaalluueess ffoorr aa lliimmiitt A given limit may have three values: +o _0 This means no limits +o _-_1 This means unspecified. The effective value is inherit from the defaults. +o _S_o_m_e _v_a_l_u_e _g_r_e_a_t_e_r _t_h_a_n _0 This is a limit. For disk space, this is expressed in kilobytes. This is true whatever the block size used on the disk. Linuxconf will translate the kilobytes to fit the disk subsystem requirements. 11..66.. EEffffeeccttiivvee qquuoottaass ffoorr uusseerrss Disk quotas for a user are influenced by three setups: +o _T_h_e _u_s_e_r _r_e_c_o_r_d_s Those records are visible in the user account dialog. There is one record per partition with user quota enabled. +o _T_h_e _d_e_f_a_u_l_t_s _f_o_r _g_r_o_u_p _m_e_m_b_e_r_s Don't mix this with group quotas. You can setup default values for disk quota which apply directly to the member of the group. You modify these defaults right in the group account dialog. There is one record per partition with user quota enabled. +o _G_e_n_e_r_a_l _d_e_f_a_u_l_t _v_a_l_u_e_s One record per partition provides the ultimate defaults. Many will want to only play with this record and let the users inherit these values. 11..77.. EEffffeeccttiivvee qquuoottaass ffoorr ggrroouuppss Disk quotas for a group are influenced by two setups: +o _T_h_e _g_r_o_u_p _r_e_c_o_r_d_s Those records are visible in the group account dialog. There is one record per partition with group quota enabled. +o _G_e_n_e_r_a_l _d_e_f_a_u_l_t _v_a_l_u_e_s One record per partition provides the ultimate defaults. Many will want to only play with this record and let the groups inherit these values. 22.. EEnnaabblliinngg ddiisskk qquuoottaa You have to enable disk quota on each partition where you want this level of control. This is done in the "File-system configurator". Pick the menu "Access local drive" and then pick each partition where you want to enable disk quotas. In the dialog, you will find a check box for user quotas and another for group quotas. Again, those quotas (user and group) are completely independent and may be enabled separately. 33.. RReellaatteedd ccoommmmaannddss Here are the different commands you may want to use to manipulate disk quotas: +o _q_u_o_t_a_o_n_,_q_u_o_t_a_o_f_f This lets you turn on and off quota on a partition +o _r_e_p_q_u_o_t_a This prints a status report for the different user of group. +o _q_u_o_t_a_c_h_e_c_k This walks a partition and update the status of each group and user. This command is normally run right after an fsck at boot time. +o _e_d_q_u_o_t_a This is a bare bone quota management utility. It allows you to edit the user record or group record directly. _D_O _N_O_T _U_S_E _T_H_I_S. It has no concept of defaults and any change you do with it may be overwritten by linuxconf.