当前位置:网站首页>Basic management of system storage -- mounts, partitions, user quotas
Basic management of system storage -- mounts, partitions, user quotas
2022-08-02 17:34:00 【linyxg】
添加虚拟机硬盘
- linux系统下
设备查看
查看磁盘分区情况:fdisk
查看设备的使用情况:lsblk
View device management methods and devicesid:blkid(processed equipment)
查看正在被系统挂载的设备:df -h (统计2的n次方1G=1024M)
View the devices recognized by the system:/proc/partitions
Temporary mount of the device
在系统中有设备id的设备是可以被系统使用的
View the mount information of all devices:mount
临时挂载命令:mount 设备名称 挂载点Convert mount parameters from read-write to read-only
读写挂载:mount -o rw /dev/vda1 /boot/
Remount and activate read-only parameters:mount -o remount,ro /boot/appears when uninstallingbusy,Solution for the device being used
See what programs your device is running:fuser -v(显示详细信息)m(显示进程) 进程号
End the device process:kill -9 进程号 或 fuser -vmk 进程号 (k结束进程)
Then uninstall it successfully:umount 设备名称|挂载点
Remount and mount read-only:mount-o rw +挂载点(Adding a mount point is more accurate)
Permanent mount of the device
查看帮助:man 5 fstab
设备挂载策略文件: vim /etc/fstab (This file does not take effect immediately after it is written)
重新读取etc/fstab文件:mount-a当/etc/fstabWhen a file writing error causes startup to fail
(1)按照提示在操作界面输入超级用户密码,后回车
(2)Edit the mount policy file: vim /etc/fstab ,注释错误行
(3)重启系统即可
分区方法
- 分区的两种方式
分区方式 | 位数 | The size of the partition table | 支付分区个数 | The size of a single partition is supported |
---|---|---|---|---|
legacy (MBR) | 32 | 64byte | 主分区4个,所有分区16个 | 2.2 TB |
UEFI(GPT) | 64 | 128byte | 理论上无限制,windows 128 | 8 ZIB |
- MBR分区方式
- 主分区:A partition that records partition information and can be used directly
- 扩展分区:The partition of the primary partition record,不可以直接使用,Just a container for logical partitions
- 逻辑分区:扩展分区之上划分的分区叫做逻辑分区
- 1 . Interactive division:
fdisk Parameter function under command:
参数命令 | 功能 |
---|---|
m | 获取帮助 |
g | 设定分区方式为GPT |
o | 设定分区方式为MBR |
d | 删除 |
l | 列出所有分区类型 |
n | 新建 |
p | 显示分区表 |
t | 修改分区类型 |
w | 保存更改 |
q | 不保存退出 |
MBR/GPTinteractive partition:fdisk /dev/sdc
Partition mode conversion:
在RHEL8中可以直接使用fdisk /dev/sdc
输入命令:g(g表示把 /dev/sdc设备的分区方式调整为GPT)
Synchronize the partition table to the system:udevadm settle
格式化设备为xfs文件系统:mkfs.xfs -K /dev/vdb -fnon-interactive partition
缺点:Determine the size of the partition by calculation
设置分区方式:parted /dev/vdb mklabel msdos(gpt)
划分主分区:parted /dev/vdb mkpart primary 1 100
删除分区:parted /dev/vdb rm 1
Synchronize the partition table to the system:udevadm settle
- Partitioned devices cannot be mounted,To mount the filesystem
格式化设备为xfs文件系统,相当于在/dev/vdb上安装设备管理软件:mkfs.xfs -K /dev/vdb (-K不丢弃空数据块)
常用文件系统对比
查看帮忙命令:man 5 fs
文件系统 | FAT16 | FAT32 | NTFS | EXT3 | EXT4 | XTS |
---|---|---|---|---|---|---|
最大卷 | 2GB | 4GB | 256TB | 32TB | 1EB | 16EB |
最大单个文件 | 4GB | 8TB | 16TB | 2TB | 16TB | 8EB |
最大文件个数 | 65536 | 4177920 | 4294967295 | 32000个子目录 | 无限子目录 | |
代表系统 | DOS Win95 | Win98 | Win2000以后 | RHEL5 | RHEL6 | RHEL7~ |
删除设备
- Make sure the device is used in the system,Otherwise the system is likely to crash
Delete the data on the device(Delete the partition ID): dd if=/dev/zero of=/dev/vdc bs=1M count=1
磁盘配额
设定用户能写入指定设备的最大额度
- 设定方法
- 激活磁盘配额(默认没有)
- 设定用户配额:edquota -u lyx(用户名)
永久开启配额
编辑文件:vim /etc/fstab(开机自动激活)Permanently turn off quotas
删除/etc/fstab文件里添加的usrquota参数
卸载设备:umount /mnt
边栏推荐
猜你喜欢
随机推荐
【学习笔记之菜Dog学C】自定义类型详解(结构体+枚举+联合)
【Untitled】
初入c语言
Qt | 事件系统 QEvent
MySQL 视图(详解)
【个人总结】2022.7月结
Getting Started with MySQL Syntax
Qt | 模态对话框和非模态对话框 QDialog
China's garment industry has formed a complete industrial system
XGBoost 和随机森林在表格数据上优于深度学习?
做好私域流量!全民拼购就可以了。
How to check the WeChat applet server domain name and modify it
"No title"
codeforces k-Tree (dp still won't work)
Drag and Drop in H5
PAT tree DP (memory search) class a, 1079, 1090, 1106
SQL查询数据以及排序
祝蔡徐坤生日快乐!
PAT Grade A 1143 Lowest Common Ancestor
线程安全问题以及其解决方法