弹性云linux系统升级系统盘后扩容根分区

红色为您要键入的指令,绿色为需要注意的内容,蓝色为说明

特别提醒:删除分区后一定要先建立分区再保存,删除后点了保存会导致数据丢失,如果对linux不熟悉的,建议提交维护工单我司手工处理,费用30元。该操作有风险,为避免误操作导致数据丢失,操作前请对您的重要数据进行备份!
相关连接:
弹性云window系统盘扩容后将未分配空间合并扩容到C盘
Linux云主机(VPS)升级硬盘以后HOME分区扩容操作流程

[root@ebs ~]#yum -y install gdisk        //安装分区工具

[root@ebs ~]#gdisk /dev/vda        //操作根分区磁盘

Command (? for help): p    //查看分区

Disk /dev/vda: 104857600 sectors, 50.0 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): B7172F0B-2C30-4535-981D-F0ED8B4A6065

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 104857566

Partitions will be aligned on 2048-sector boundaries

Total free space is 41945021 sectors (20.0 GiB)


Number  Start (sector)    End (sector)  Size       Code  Name

   1            2048        62914559   30.0 GiB    8300  Linux filesystem    //注意这个值

Command (? for help): d        //删除分区

Using 1


Command (? for help): 1

b       back up GPT data to a file

c       change a partition's name

d       delete a partition

i       show detailed information on a partition

l       list known partition types

n       add a new partition

o       create a new empty GUID partition table (GPT)

p       print the partition table

q       quit without saving changes

r       recovery and transformation options (experts only)

s       sort partitions

t       change a partition's type code

v       verify disk

w       write table to disk and exit

x       extra functionality (experts only)

?       print this menu


Command (? for help): n

Partition number (1-128, default 1): 1

First sector (34-104857566, default = 2048) or {+-}size{KMGTP}: 2048   //刚才记录的

Last sector (2048-104857566, default = 104857566) or {+-}size{KMGTP}:   //直接回车

Current type is 'Linux filesystem'

Hex code or GUID (L to show codes, Enter = 8300):            //直接回车

Changed type of partition to 'Linux filesystem'


Command (? for help): w


Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

PARTITIONS!!


Do you want to proceed? (Y/N): y

OK; writing new GUID partition table (GPT) to /dev/vda.

Warning: The kernel is still using the old partition table.

The new table will be used at the next reboot.

The operation has completed successfully.


[root@ebs ~]#reboot                        //重启让分区生效

[root@ebs ~]#resize2fs -f /dev/vda1                 //开始扩容根分区

resize2fs -f /dev/vda1

resize2fs 1.41.12 (17-May-2010)

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

old desc_blocks = 2, new_desc_blocks = 4

Performing an on-line resize of /dev/vda1 to 13106939 (4k) blocks.

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


[root@ebs ~]#df -vh                            //完成,查看新的根分区大小




编辑:西部数码
日期:2015-03-31

收藏 】 【 打印 】   
您可对文档进行评分哟~

勾选遇到的问题提交给我们,收到反馈后保证及时修正更新!

提交反馈需要先登陆会员帐号

上一篇:国家互联网应急中心通知被HOLD域名申请解封流程
下一篇:FTP上传大文件时连接重置或者中断,重新连接上传也出现同样情况处理办法
若文档内容对您没有帮助,不能解决问题? 您还可以 咨询在线客服提交工单搜索常见问题 ,我们将竭诚为您服务。
  >> 相关文章
 
分享至: