Adjust partition size with parted

Source: Internet
Author: User
Adjust partition size using parted, bydefaultitselectsthefirstharddiskdrivethatisavai adjust partition size using parted Select the hard disk to be parted When you execute parted command without any argument, by default it selects the first hard disk drive that is available on your system. in the following example, it picked/dev/sda automatically as it is the first har D drive in this system. # partedGNU Parted 2.3 Using/dev/sdaWelcome to GNU Parted! Type 'help' to view a list of commands. (parted) To choose a different hard disk, use the select command as shown below. (parted) select/dev/sdbIt will throw the following error message when it doesn't find the given hard disk name. error: Error opening/dev/sdb: No medium foundRetry/Cancel? Y Display all Partitions Using print Using the print command, you can view all the available partitions in the selected hard disk. the print command also displays hard disk properties such as model, size, sector size and partition table as shown below. (parted) printModel: ata wdc WD5000BPVT-7 (scsi) Disk/dev/sda: 500 GBSector size (logical/physical): 512B/4096 BPartition Table: msdos Number Start E Nd Size Type File system Flags 1 1049kB 106 MB 105 MB primary fat16 diag 2 106 MB 15.8 GB 15.7 GB primary ntfs boot 3 15.8 GB 266 GB 251 GB primary ntfs 4 266 GB 500 GB 234 GB extended 5 266 GB 269 GB 2682 MB logical ext4 7 269 GB 270 GB 524 MB logical ext4 8 270 GB 366 GB 96.8 GB logical lvm 6 366 GB 370 GB 3999 MB logical linux-swap (v1) 9 370 GB 500 GB 130 GB logical ext4 Resize Partition from One Size to Another Using r Esize Using resize parted command, you can increase or decrease the partition size of a partition as shown in the example below. (parted) resize 9 WARNING: you are attempting to use parted to operate on (resize) a file system. parted's file system manipulation code is not as robust as what you'll find indedicated, file-system-specific packages like e2fsprogs. we recommendyou use parted only to manip Ulate partition tables, whenever possible. Support for parameter Ming most operations on most types of file systemswill be removed in an upcoming release. Start? [373 GB]? 373 GBEnd? [500 GB]? 450 GBAs shown above, parted command will always warn whenever you are attempting to do something dangerous (I. e: rm, resize, mkfs ). the size of partition 9 is actually forced CED from 127 GB to 77 GB. verify that the partition is resized properly using the print command as shown below. (parted) printModel: ata wdc WD5000BPVT-7 (scsi) Disk/dev/sda: 500 GBSector size (logical/physical): 512B/4096 BPartition Table: msdos Number Start End Size Type File system Flags 1 1049kB 106 MB 105 MB primary fat16 diag 2 106 MB 15.8 GB 15.7 GB primary ntfs boot 3 15.8 GB 266 GB 251 GB primary ntfs 4 266 GB 500 GB 234 GB extended 5 266 GB 316 GB 50.0 GB logical ext4 6 316 GB 324 GB 7999 MB logical linux-swap (v1) 7 324 GB 344 GB 20.0 GB logical ext4 8 344 GB 364 GB 20.0 GB logical 9 373 GB 450 GB 77.3 GB logical fat32 lbaParted allows you to type unambiguous abbreviation for commands like "p" print, "sel" for select, etc.
Related Article

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.