阿里云在线升级磁盘

由于阿里云上服务器购买的系统盘太小.又不能关机升级 只能在线升级扩容.先做个笔记

 

 

开始连接到 [email protected] 7.2

Last login: Thu Jan  9 22:07:36 2020 from 192.168.1.205

 

Welcome to Alibaba Cloud Elastic Compute Service !

 

[root@ac-push01 ~]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/vda1        99G   40G   54G  43% /

devtmpfs        7.8G     0  7.8G   0% /dev

tmpfs           7.8G     0  7.8G   0% /dev/shm

tmpfs           7.8G  312K  7.8G   1% /run

tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup

tmpfs           1.6G     0  1.6G   0% /run/user/0

[root@ac-push01 ~]# fdisk  -l

 

Disk /dev/vda: 536.9 GB, 536870912000 bytes, 1048576000 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: 0x0008d73a

 

   Device Boot      Start         End      Blocks   Id  System

/dev/vda1   *        2048   209715166   104856559+  83  Linux

[root@ac-push01 ~]# cd ^C

[root@ac-push01 ~]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/vda1        99G   40G   54G  43% /

devtmpfs        7.8G     0  7.8G   0% /dev

tmpfs           7.8G     0  7.8G   0% /dev/shm

tmpfs           7.8G  312K  7.8G   1% /run

tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup

tmpfs           1.6G     0  1.6G   0% /run/user/0

 [root@ac-push01 ~]# fdisk  -l

 

Disk /dev/vda: 536.9 GB, 536870912000 bytes, 1048576000 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: 0x0008d73a

 

   Device Boot      Start         End      Blocks   Id  System

/dev/vda1   *        2048   209715166   104856559+  83  Linux

[root@ac-push01 ~]# cd /.

./            ../           .autorelabel  .cache/       .local/      

[root@ac-push01 ~]# cd /.local/share/server-

server-manager/   server-publisher/

 

# 关键步骤

 [root@ac-push01 ~]# yum install cloud-utils-growpart yum install xfsprogs -y

Loaded plugins: fastestmirror

base                                                                                                                                                                                                                                                   | 3.6 kB  00:00:00    

epel                                                                                                                                                                                                                                                   | 5.3 kB  00:00:00    

extras                                                                                                                                                                                                                                                 | 2.9 kB  00:00:00    

updates                                                                                                                                                                                                                                                | 2.9 kB  00:00:00    

Loading mirror speeds from cached hostfile

No package install available.

Resolving Dependencies

--> Running transaction check

---> Package cloud-utils-growpart.noarch 0:0.29-5.el7 will be installed

---> Package xfsprogs.x86_64 0:4.5.0-12.el7 will be updated

---> Package xfsprogs.x86_64 0:4.5.0-20.el7 will be an update

---> Package yum.noarch 0:3.4.3-154.el7.centos will be updated

---> Package yum.noarch 0:3.4.3-163.el7.centos will be an update

--> Finished Dependency Resolution

 

Dependencies Resolved

 

==============================================================================================================================================================================================================================================================================

 Package                                                                  Arch                                                       Version                                                                   Repository                                                Size

==============================================================================================================================================================================================================================================================================

Installing:

 cloud-utils-growpart                                                     noarch                                                     0.29-5.el7                                                                base                                                      27 k

Updating:

 xfsprogs                                                                 x86_64                                                     4.5.0-20.el7                                                              base                                                     896 k

 yum                                                                      noarch                                                     3.4.3-163.el7.centos                                                      base                                                     1.2 M

 

Transaction Summary

==============================================================================================================================================================================================================================================================================

Install  1 Package

Upgrade  2 Packages

 

Total download size: 2.1 M

Downloading packages:

Delta RPMs disabled because /usr/bin/applydeltarpm not installed.

(1/3): cloud-utils-growpart-0.29-5.el7.noarch.rpm                                                                                                                                                                                                      |  27 kB  00:00:00    

(2/3): xfsprogs-4.5.0-20.el7.x86_64.rpm                                                                                                                                                                                                                | 896 kB  00:00:00    

(3/3): yum-3.4.3-163.el7.centos.noarch.rpm                                                                                                                                                                                                             | 1.2 MB  00:00:00    

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                                                                                                                          18 MB/s | 2.1 MB  00:00:00    

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Updating   : xfsprogs-4.5.0-20.el7.x86_64                                                                                                                                                                                                                               1/5

/sbin/ldconfig: /usr/local/lib/libzen.so.0 is not a symbolic link

 

/sbin/ldconfig: /usr/local/lib/libglog.so.0 is not a symbolic link

 

  Updating   : yum-3.4.3-163.el7.centos.noarch                                                                                                                                                                                                                            2/5

  Installing : cloud-utils-growpart-0.29-5.el7.noarch                                                                                                                                                                                                                     3/5

  Cleanup    : yum-3.4.3-154.el7.centos.noarch                                                                                                                                                                                                                            4/5

  Cleanup    : xfsprogs-4.5.0-12.el7.x86_64                                                                                                                                                                                                                               5/5

/sbin/ldconfig: /usr/local/lib/libzen.so.0 is not a symbolic link

 

/sbin/ldconfig: /usr/local/lib/libglog.so.0 is not a symbolic link

 

  Verifying  : cloud-utils-growpart-0.29-5.el7.noarch                                                                                                                                                                                                                     1/5

  Verifying  : yum-3.4.3-163.el7.centos.noarch                                                                                                                                                                                                                            2/5

  Verifying  : xfsprogs-4.5.0-20.el7.x86_64                                                                                                                                                                                                                               3/5

  Verifying  : yum-3.4.3-154.el7.centos.noarch                                                                                                                                                                                                                            4/5

  Verifying  : xfsprogs-4.5.0-12.el7.x86_64                                                                                                                                                                                                                               5/5

 

Installed:

  cloud-utils-growpart.noarch 0:0.29-5.el7                                                                                                                                                                                                                                   

 

Updated:

  xfsprogs.x86_64 0:4.5.0-20.el7                                                                                                       yum.noarch 0:3.4.3-163.el7.centos                                                                                                      

 

Complete!

 

[root@ac-push01 ~]# growpart /dev/vda 1

CHANGED: partition=1 start=2048 old: size=209713119 end=209715167 new: size=1048573919 end=1048575967

[root@ac-push01 ~]# resize2fs /dev/vda1

resize2fs 1.42.9 (28-Dec-2013)

Filesystem at /dev/vda1 is mounted on /; on-line resizing required

old_desc_blocks = 7, new_desc_blocks = 32

The filesystem on /dev/vda1 is now 131071739 blocks long.

 

[root@ac-push01 ~]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/vda1       493G   40G  432G   9% /

devtmpfs        7.8G     0  7.8G   0% /dev

tmpfs           7.8G     0  7.8G   0% /dev/shm

tmpfs           7.8G  312K  7.8G   1% /run

tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup

tmpfs           1.6G     0  1.6G   0% /run/user/0

[root@ac-push01 ~]#

发布了300 篇原创文章 · 获赞 25 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/xujiamin0022016/article/details/103957393
今日推荐