linux 操作系统下的convertquota命令介绍和使用案例
convertquota命令介绍
convertquota是Linux系统中用于转换旧格式的用户和组配额文件的命令。它可以将旧格式的quota.user和quota.group文件转换为新格式的aquota.user和aquota.group文件。新格式的配额文件支持32位的uid/gid、为root设置配额、以字节为单位记录使用空间等功能
使用方法
基本语法
bash
convertquota [ -ug ] [ -e | -f ] filesystem
选项
- -u:转换用户配额文件。这是默认选项。
- -g:转换组配额文件。
- -f:从旧格式转换为新格式。这是默认选项。
- -e:从大端字节序转换为小端字节序。
- -V:显示版本信息。
安装部署:
root@meng:~# which convertquota
root@meng:~# convertquota
Command 'convertquota' not found, but can be installed with:
apt install quota
root@meng:~# apt install quota
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
libnet-ldap-perl rpcbind default-mta | mail-transport-agent
The following NEW packages will be installed:
quota
0 upgraded, 1 newly installed, 0 to remove and 224 not upgraded.
Need to get 213 kB of archives.
After this operation, 1249 kB of additional disk space will be used.
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/main amd64 quota amd64 4.06-1build2 [213 kB]
Fetched 213 kB in 2s (123 kB/s)
Preconfiguring packages ...
Selecting previously unselected package quota.
(Reading database ... 75135 files and directories currently installed.)
Preparing to unpack .../quota_4.06-1build2_amd64.deb ...
Unpacking quota (4.06-1build2) ...
Setting up quota (4.06-1build2) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning linux images...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@meng:~# convertquota
convertquota: Bad number of arguments.
convertquota: Utility for converting quota files.
Usage:
convertquota [options] mountpoint
-u, --user convert user quota file
-g, --group convert group quota file
-e, --convert-endian convert quota file to correct endianity
-f, --convert-format oldfmt,newfmt convert from old to VFSv0 quota format
-h, --help show this help text and exit
-V, --version output version information and exit
convertquota: Bugs to jack@suse.cz
命令案例:
转换配额模式
convertquota -u /dev/sda1
convertquota -g /dev/sda1
列出现有配额情况: