当前位置:网站首页>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
边栏推荐
猜你喜欢

【个人总结】2022.7月结

es6 循环,并终止循环

How to check the WeChat applet server domain name and modify it

Win 10、Win 11 安装 MuJoCo 及 mujoco-py 教程

浅析PM2实用入门指南

祝蔡徐坤生日快乐!

阿里面试败北:5种微服务注册中心如何选型?这几个维度告诉你

IPtables 和binlog

Servlet运行原理_API详解_请求响应构造进阶之路(Servlet_2)

【 Leetcode string, the string transform/hexadecimal conversion 】 HJ1. The length of the string last word HJ2. Calculation of a certain number of characters appear HJ30. String merging processing
随机推荐
【深度学习】关于处理过拟合的一点心得
CNN鲜花分类
IDO预售DAPP系统开发(NFT挖矿)
QT基础第四天(4)qt事件机制:事件基础概念,常见事件机制,事件处理以及事件的重写
Qt | 关于容器类的一些总结
OneFlow源码解析:Op、Kernel与解释器
阿里面试败北:5种微服务注册中心如何选型?这几个维度告诉你
语音直播系统——做好敏感词汇屏蔽打造绿色社交环境
PAT甲级 1143 最低公共祖先
Servlet运行原理_API详解_请求响应构造进阶之路(Servlet_2)
2022 VMware下载安装教程
MySQL 自增主键
程序员开发效率神器汇总!
散列表简述
虚拟现实处理器(SXR2130P)ISO7640FMDW(数字隔离器)说明
PAT Class A 1130 Infix Expressions
Getting Started with MySQL Syntax
phpstudy实现命令行操作
c语言实现三子棋
PAT甲级 1130 中缀表达式