Jetson-AGX-Xavier的普通用户进行存储配额
Jetson-AGX-Xavier的emmc存储空间总额只有28G(整个emmc大小为32G),当存储用完后,重新上电会导致系统起不来。为了防止它,可对登录用户的可使用空间进行限额。当已使用空间达到上限后,就不会再允许继续写入。
1. 安装quota工具
sudo apt-get install quota
2. 修改/etc/fstab文件,在/dev/root行的defaults后面添加usrquota和grpquota
# /etc/fstab: static file system information.
#
# These are the filesystems that are always mounted on boot, you can
# override any of these by copying the appropriate line from this file into
# /etc/fstab and tweaking it as you see fit. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/root / ext4 defaults,usrquota,grpquota 0 1
/dev/nvme0n1p1 /home ext4 defaults 0 1
3. 重启设备
4. 进入到根目录,输入sudo quotacheck -avugfm
对存储进行扫描,并生成aquota.group & aquota.user
5. 打开配额 sudo quotaon -avug
6. 对用户进行配额,输入sudo edquota -u nvidia
,对nvidia用户进行配额(vim操作),其中修改前面的soft和hard(单位KB),当达到hard的大小时,将不准写入。
Disk quotas for user nvidia (uid 1000):
Filesystem blocks soft hard inodes soft hard
/dev/mmcblk0p1 2600004 2400000 2600000 16938 0 0