Expand Linux Partition to new size

Source: Internet
Author: User

EXT4 filesystem supports online (that's, without unmounting) resizing with resize2fs command.
First, you had 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 it parameter (in our case, 1). When asked for new size, enter-1 (means with all space up to the last available sector on disk):

(parted) Resizepart 1
PARTITION/DEV/SDB1 is being used. Is you sure want to continue?
Yes/no? Y
End? [3298GB]? -1
(parted) Q
Information:you need to Update/etc/fstab.

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

Resize2fs-p/DEV/SDB1

Expand Linux Partition to new size

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.