首页
留言板
推荐
Allen知识库
Search
1
VMware vSphere系列教程-部署DC/DHCP/DNS(五)
21 阅读
2
最强链路监控系统推荐Pinpoint
21 阅读
3
PC新时代开启! DDR5内存标准正式发布
19 阅读
4
Ansible系列教程-常用模块(二)
13 阅读
5
将物理机迁移到VMware虚拟机(P2V)
13 阅读
VMware
vCloud
Horizon
vSphere
NSX
运维相关
Docker
Network
Zabbix
Ansible
Python
Microsoft
Mysql
Linux
Windows Server
登录
/
注册
Search
标签搜索
ansible
docker
zabbix
chatgpt
windows模板
linux模板
模板
k3
lede
openwrt
docker网络配置
清理微信好友
python清理微信好友
grafana
监控交换机
实施教程
ansible安装
ubuntu
acrh17路由固件
访问宽带猫
Allen
累计撰写
134
篇文章
累计收到
0
条评论
首页
栏目
VMware
vCloud
Horizon
vSphere
NSX
运维相关
Docker
Network
Zabbix
Ansible
Python
Microsoft
Mysql
Linux
Windows Server
页面
留言板
推荐
Allen知识库
搜索到
1
篇与
的结果
2018-08-13
Centos7扩展磁盘空间(LVM管理)
查看磁盘情况fdisk -l /dev/sdaDisk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x00063fa6 Device Boot Start End Blocks Id System /dev/sda1 * 2048 1026047 512000 83 Linux /dev/sda2 1026048 20971519 9972736 8e Linux LVM /dev/sda3 20971520 41943039 10485760 8e Linux LVM 现在,磁盘大小为 21.5 GB。磁盘占用情况为:df -hFilesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 19G 8.1G 11G 44% / devtmpfs 482M 0 482M 0% /dev tmpfs 497M 88K 497M 1% /dev/shm tmpfs 497M 7.0M 490M 2% /run tmpfs 497M 0 497M 0% /sys/fs/cgroup /dev/sda1 497M 157M 341M 32% /boot Share 103G 36G 67G 35% /media/sf_Share tmpfs 100M 4.0K 100M 1% /run/user/42 tmpfs 100M 12K 100M 1% /run/user/0 下面调整虚拟机操作系统的文件系统,使之识别新增的空间 1.创建新的分区# fdisk /dev/sda n {new partition} p {primary partition} 3 {partition number} [这时会提示修改大小,选择默认直接回车即可] t {change partition id} 3 {partition number} 8e {Linux LVM partition} 如果中间有设置大小之类的提示,就直接回车。PS:经实际测试,无此提示,但还是要重启系统,看看是否已识别该磁盘空间。WARNING: Re-reading the partition table failed with error 16: 设备或资源忙. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) 就重启一下系统。2.查看新增加的sda3是否标记为LVM,如果没有需要reboot PS:经实际测试,sda3已经是LVM了,但系统还是不识别该磁盘空间。 3.调整LVM大小查看Volume Group名称vgdisplay --- Volume group --- VG Name centos System ID Format lvm2 4.为新分配的空间创建一个新的物理卷pvcreate /dev/sda35.使用新的物理卷来扩展 LVM 的 VolGroupvgextend centos /dev/sda3 No physical volume label read from /dev/sda3 Writing physical volume data to disk "/dev/sda3" Physical volume "/dev/sda3" successfully created Volume group "vg_aimin" successfully extended 6.扩展 LVM 的逻辑卷 centos-root 先查看逻辑卷:lvdisplay --- Logical volume --- LV Path /dev/centos/root LV Name root VG Name centos lvextend /dev/centos/root /dev/sda37.调整逻辑卷的大小xfs_growfs /dev/centos/rootPS:不知道是调整还是同步,经实际测试需要用xfs_growfs命令,而非resize2fs命令8.查看结果lvscanACTIVE '/dev/centos/root' [18.46 GiB] inherit ACTIVE '/dev/centos/swap' [1.00 GiB] inherit
2018年08月13日
2 阅读
0 评论
0 点赞