centos – VPS:升级后如何更新可用硬盘空间?

前端之家收集整理的这篇文章主要介绍了centos – VPS:升级后如何更新可用硬盘空间?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我对OVH上托管的VPS进行了升级,特别是从VPS CLOUD 1升级到VPS CLOUD 2,其中先前的解决方案多了25gb(总共50gb).

在这个VPS上安装了CentOS 7.2.1511

有df -HT的结果

[root@srv ~]# df -HT
File system    Tipo      Dim. Usati Dispon. Uso% Montato su
/dev/vda1      xfs        27G   12G     16G  42% /
devtmpfs       devtmpfs  2,1G     0    2,1G   0% /dev
tmpfs          tmpfs     2,1G   0% /dev/shm
tmpfs          tmpfs     2,1G   18M    2,1G   1% /run
tmpfs          tmpfs     2,1G   0% /sys/fs/cgroup
tmpfs          tmpfs     405M     0    405M   0% /run/user/0

有fdisk -l |的结果grep磁盘

[root@srv ~]# fdisk -l | grep Disk
Disk /dev/vda: 53.7 GB,53687091200 bytes,104857600 sectors
Disk label type: dos

其他磁盘信息:

[root@srv ~]# fdisk -l /dev/vda

Disk /dev/vda: 53.7 GB,104857600 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
Identificativo disco: 0x000af71d

Dispositivo Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048    52428799    26213376   83  Linux

我试过这个:

[root@srv ~]# xfs_growfs /dev/vda1 -D 53.7G
Meta-data=/dev/vda1              isize=256    agcount=13,agsize=524224 blks
         =                       sectsz=512   attr=2,projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=6553344,imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal               bsize=4096   blocks=2560,version=2
         =                       sectsz=512   sunit=0 blks,lazy-count=1
realtime =none                   extsz=4096   blocks=0,rtextents=0
data size 53 too small,old size is 6553344

还有这个:

[root@srv ~]# xfs_growfs -d /dev/vda1 
Meta-data=/dev/vda1              isize=256    agcount=13,projid32bit=1
         =                       crc=0        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=6553344,rtextents=0
data size unchanged,skipping

显然没有成功.

[UPDATE]
part上的pr命令输出

Modello: Device a blocchi Virtio (virtblk)
Disco /dev/vda: 53,7GB
Dimensione del settore (logica/fisica): 512B/512B
Tabella delle partizioni: msdos
Flag del disco: 

Numero  Inizio  Fine    Dimensione  Tipo     File system  Flag
 1      1049kB  26,8GB  26,8GB      primary  xfs          avvio
 2      26,8GB  53,7GB  26,8GB      primary  xfs

如何在不破坏数据的情况下扩展可用磁盘空间?重启服务器不是问题.

xfs_growfs -d / dev / vda1

Capital -D增长到指定大小in filesystem blocks,它不理解’G’.因此它假设你想要53个文件系统块,但是失败了.

小写-d增长到最大尺寸.

如果你想要特定的尺寸,你应该在块中计算它,例如从fdisk输出,最大大小为26213376.然后-D 26213376也将从现在的6553344个块增加到最大值.

原文链接:https://www.f2er.com/centos/373636.html

猜你在找的CentOS相关文章