centos xfs硬盘扩容
最近遇到需要對虛擬機擴容,之前已經擴了一次了,但是沒有做記錄,這次吧過程添加了一下,參考了https://www.cnblogs.com/jamesf/p/4751481.html
1、df -h
2、fdisk? /dev/sda
因為已經擴展了一次,已經把sda3用了,所以比網上的流程要少幾步,不過這個不影響
對新增的硬盤空間做新增分區(硬盤數沒有增加,增加的是空間)
# fdisk? /dev/sda
照著紅色部分輸入,按回車。
?
The number of cylinders for this disk isset to 7832.
There is nothing wrong with that, but thisis larger than 1024,
and could in certain setups cause problemswith:
1) software that runs at boot time (e.g.,old versions of LILO)
2) booting and partitioning software fromother OSs
?? (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n 說明:新增分區
Command action
?? e?? extended
?? p?? primarypartition (1-4)
p
Partition number (1-4): 3 說明:新增分區號(1,2默認已經用了,我這里3已經用了,所以用的4)
First cylinder (2611-7832, default 2611): 默認回車(最小)
Using default value 2611
Last cylinder or +size or +sizeM or +sizeK(2611-7832, default 7832):默認回車(最大)
Using default value 7832
Command (m for help): t 說明:修改分區類型
Partition number (1-4): 3 說明:修改分區類型對應的分區號
Hex code (type L to list codes): 8e 說明:8e是lvm磁盤類型
Changed system type of partition 3 to 8e(Linux LVM)
?Command (m for help): p 說明:打印分區表
?Disk /dev/sda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units = cylinders of 16065 * 512 = 8225280bytes
?? Device Boot????? Start??????? End????? Blocks? Id? System
/dev/sda1?? *?????????? 1???????? 13????? 104391? 83? Linux
/dev/sda2????????????? 14?????? 2610??? 20860402+ 8e? Linux LVM
/dev/sda3??????????? 2611?????? 7832??? 41945715? 8e? Linux LVM
Command (m for help): w 說明:保存退出
The partition table has been altered!
3、reboot
4、df -T /dev/sda1,注意是xfs,所以不能按照不走2種連接中教程走最后一步
5、pvcreate /dev/sda4
6、pvdisplay
7、vgdisplay
8、vgextend? cl /dev/sda4
9、pvdisplay 現在有Free PE了
10、fdisk -l
11、resize2fs /dev/mapper/cl-root
12、查看df -h,擴容成功
總結
以上是生活随笔為你收集整理的centos xfs硬盘扩容的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: U盘里面的文件夹变成文件也打不开文件的寻
- 下一篇: [转载]三、二、一 …… Geronim