Changes

stoney backup: Server set-up

0 bytes added, 16:58, 29 November 2013
/* Quota */
==== Adding a User Quota ====
Set a quota of 1 Gigabyte for the user 4000187 (the values are in kilobytes, so 1048576 kilobyte are 1024 megabytes which corresponds to 1 gigabyte):
xfs_quota -x -c 'limit bhard=1048576k 4000187' /var/backup
Or in bytes:
xfs_quota -x -c 'limit bhard=1073741824 4000187' /var/backup
Read the quota information for the user 4000187:
xfs_quota -x -c 'quota -v -N -u 4000187' /var/backup
/dev/vdb mapper/vg--local--01-var 0 0 1048576 00 [--------] /var/backup
If the user has data in the project, that belongs to him, the result will change:
/dev/vdb mapper/vg--local--01-var 512000 0 1048576 00 [--------] /var/backup
==== Modifiying a User Quota ====
To modify a users quota, you just set a new quota (limit):
xfs_quota -x -c 'limit bhard=1048576k 4000187' /var/backup
Read the quota information for the user 4000187:
xfs_quota -x -c 'quota -v -N -u 4000187' /var/backup
/dev/vdb mapper/vg--local--01-var 0 0 1048576 00 [--------] /var/backup
If the user has data in the project, that belongs to him, the result will change:
/dev/vdb mapper/vg--local--01-var 512000 0 1048576 00 [--------] /var/backup
==== Removing a User Quota ====
Removing a quota for a user:
xfs_quota -x -c 'limit bhard=0 4000187' /var/backup
The following command should give you an empty result:
xfs_quota -x -c 'quota -v -N -u 4000187' /var/backup
=== Project (Directory) Quotas ===
* project_ID: The uid of the online backup account (4000187).
* project_name: The uid of the online backup account (4000187). This could be a human readable name.
* mountpoint: The mountpoint of the xfs-filesystem (/var/backup). See the <code>/etc/fstab</code> entry from above.* directory: The directory of the project (187/4000187), starting from the mountpoint of the xfs-filesystem (/var/backup).
Define a unique project ID for the directory hierarchy in the <code>/etc/projects</code> file (project_ID:mountpoint/directory):
Set Project:
xfs_quota -x -c 'project -s -p /var/backup/187/4000187/home/4000187 4000187' /var/backup
Set Quota (limit) on Project:
xfs_quota -x -c 'limit -p bhard=1048576k 4000187' /var/backup
Check your Quota (limit)
xfs_quota -x -c 'quota -p 4000187' /var/backup
Check the Quota:
* <code>-p</code>: display project quota information.
* <code>-h</code>: human readable format.
xfs_quota -x -c 'quota -v -N -p 4000187' /var/backup
/dev/vdb mapper/vg--local--01-var 0 0 1048576 00 [--------] /var/backup
If you copied data into the project, the output will look something like:
/dev/vdb mapper/vg--local--01-var 512000 0 1048576 00 [--------] /var/backup
To give you an overall view of the whole system:
xfs_quota -x -c report /var/backup
<pre>
User quota on /var/backup (/dev/vdbmapper/vg--local--01-var)
Blocks
User ID Used Soft Hard Warn/Grace
4000187 0 0 1048576 00 [--------]
Project quota on /var/backup (/dev/vdbmapper/vg--local--01-var)
Blocks
Project ID Used Soft Hard Warn/Grace
==== Modifying a Project (Directory) Quota ====
To modify a project (directory) quota, you just set an new quota (limit) on the chosen project:
xfs_quota -x -c 'limit -p bhard=1048576k 4000187' /var/backup
Check your quota (limit)
xfs_quota -x -c 'quota -p 4000187' /var/backup
==== Removing a Project (Directory) Quota ====
Removing a quota from a project:
xfs_quota -x -c 'limit -p bhard=0 4000187' /var/backup
Chreck the results:
xfs_quota -x -c report /var/backup
<pre>
User quota on /var/backup (/dev/vdbmapper/vg--local--01-var)
Blocks
User ID Used Soft Hard Warn/Grace
Bureaucrat, administrator
425
edits