West Digital Linux System upgrade system disk expansion Root partition example

Source: Internet
Author: User
Tags hex code

The following is actually done, the system disk is upgraded successfully, and the root partition

Special reminder: After the deletion of partitions must first set up a partition and then save, delete point after the save will result in data loss, the operation is risky, in order to avoid misoperation causes data loss, before operation, please back up your important data!

[Root@ebs ~] #yum-y install gdisk//install partition tool
[Root@ebs ~] #gdisk/dev/vda//operation root partition disk
Command (? For help): P//view partition
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
Usable sector is 104857566 usable sector
Partitions is aligned on 2048-sector boundaries
Total free spaces is 41945021 sectors (20.0 GiB)

Number Start (sector) end (sector) Size Code Name
1 2048 62914559 30.0 GiB 8300 Linux filesystem//Note this value
Command (? For help): D//delete partition
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
The sector (34-104857566, default = 2048) or {+-}SIZE{KMGTP}: 2048//Just recorded
Last sector (2048-104857566, default = 104857566) or {+-}SIZE{KMGTP}://Direct return
Current type is ' Linux filesystem '
Hex code or GUID (L to show codes, Enter = 8300)://Direct return
Changed type of partition to ' Linux filesystem '

Command (? For help): W

Final checks complete. About to write GPT data. This would OVERWRITE EXISTING
partitions!!

Do your 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 is used at the next reboot.
The operation has completed successfully.

[Root@ebs ~] #reboot//reboot to make zoning effective
[Root@ebs ~] #resize2fs-F/dev/vda1//Start expansion root partition
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 a on-line resize of/dev/vda1 to 13106939 (4k) blocks.
The filesystem on/dev/vda1 is now 13106939 blocks long.

[Root@ebs ~] #df-VH//Complete, view the new root partition 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.