expand linux partition to new size

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了expand linux partition to new size相关的知识,希望对你有一定的参考价值。

Ext4 filesystem supports online (that is, without unmounting) resizing with resize2fs command.
First, you have to resize the partition itself with partition editor (parted):

parted /dev/sdb

GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type ‘help‘ to view a list of commands.
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 5498GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 1049kB 3298GB 3298GB ext4

Now, use resizepart command and give partition number as its parameter (in our case, 1). When asked for new size, enter -1 (means use all space up to the last available sector on disk):

(parted) resizepart 1
Partition /dev/sdb1 is being used. Are you sure you want to continue?
Yes/No? y
End? [3298GB]? -1
(parted) q
Information: You may need to update /etc/fstab.

Now you can call the resize2fs command. No need to input anything, it will automatically grow the filesystem to the new partition size:

resize2fs -p /dev/sdb1

以上是关于expand linux partition to new size的主要内容,如果未能解决你的问题,请参考以下文章

definition to expand macro then apply to pragma message

Linux开机报错 or type Contro-D to continue

RestTemplate的异常 Not enough variables available to expand

How to Remove Table Partitioning in SQL Server

How To Convert A Partitioned Table To A Non-Partitioned Table Using DataPump In 11g (Doc ID 1276049.

应该是partition to image 备份下系统的 不小心选择了 to partition D盘,然后很快的把电脑重启了,