Linux’s Storage Management

#202204081225 usually treat PATA and SATA disks as if they are SCSI devices.

The naming convention for mounted devices is as follows:

  • /dev/sdx for hard drives
  • /dev/stx and /dev/nstx for SCSI tapes
  • /dev/scdx or /dev/srx for SCSI CD-ROMs and DVD-ROMs

Quota

Note: For Arch Linux users, install quota-tools to have the tools for below.

Linux could enable 202202201324 support for a specific drive by adding the options usrquota and/or grpquota into the file /etc/fstab. Runs quotaon afterwards to turn on the quota on specified file system. Note that it is advised that running these operations on unmount drive.

After mounting the drive, create the quote index by calling quotacheck which will create 2 files: aquota.user and aquota.group using the option -cug. (c as create, u as user, g as group)

Note: Linux kernel version 2.6.x or earlier could have troubles on quota support.

To set quotas for specific user (or group using -g), use the command edquota follow by the username. It will open the text editor which will show the following contents:

Disk quotas for user (uid 21810):
Filesystem    blocks      soft      hard    inodes    soft    hard
/dev/sdc4      97104   1048576   1048576      1242       0       0

We can safely ignore blocks and inodes sections. The soft and hard sections indicate the soft limit and hard limit for blocks and inodes correspondingly.

Hard limit specifies the maximum consumable blocks or inodes, and the kernel will not permit disk operations that could exceed this.

Soft limit specifies the consumed amount of blocks or inodes that will trigger a warning on it. If the user stay on or beyond the soft limit for a certain period (dictated by grace period), it will be treated as a hard limit.

To disable soft and/or hard limit, set it to 0. The grace period could be set by using edquota -t.

Links to this page
#operating-system #linux #hardware