用parted调整分区大小
来源:互联网 发布:淘宝授权管理在哪里 编辑:程序博客网 时间:2024/05/22 12:03
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 hard drive in this system.
# partedGNU Parted 2.3Using /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/sdb
It 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: 500GBSector size (logical/physical): 512B/4096BPartition Table: msdosNumber Start End Size Type File system Flags 1 1049kB 106MB 105MB primary fat16 diag 2 106MB 15.8GB 15.7GB primary ntfs boot 3 15.8GB 266GB 251GB primary ntfs 4 266GB 500GB 234GB extended 5 266GB 269GB 2682MB logical ext4 7 269GB 270GB 524MB logical ext4 8 270GB 366GB 96.8GB logical lvm 6 366GB 370GB 3999MB logical linux-swap(v1) 9 370GB 500GB 130GB logical ext4
Resize Partition from One Size to Another Using resize
Using resize parted command, you can increase or decrease the partition size of a partition as shown in the example below.
(parted) resize 9WARNING: 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 manipulate partition tables, whenever possible.Support for performing most operations on most types of file systemswill be removed in an upcoming release.Start? [373GB]? 373GBEnd? [500GB]? 450GB
As 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 reduced from 127GB to 77GB. Verify that the partition is resized properly using the print command as shown below.
(parted) printModel: ATA WDC WD5000BPVT-7 (scsi)Disk /dev/sda: 500GBSector size (logical/physical): 512B/4096BPartition Table: msdosNumber Start End Size Type File system Flags 1 1049kB 106MB 105MB primary fat16 diag 2 106MB 15.8GB 15.7GB primary ntfs boot 3 15.8GB 266GB 251GB primary ntfs 4 266GB 500GB 234GB extended 5 266GB 316GB 50.0GB logical ext4 6 316GB 324GB 7999MB logical linux-swap(v1) 7 324GB 344GB 20.0GB logical ext4 8 344GB 364GB 20.0GB logical 9 373GB 450GB 77.3GB logical fat32 lba
Parted allows you to type unambiguous abbreviation for commands like “p” for print, “sel” for select,etc.
- 用parted调整分区大小
- 用 Ubuntu Livecd 调整分区大小
- 用gparted 调整 分区大小 (linux)
- LVM调整分区大小
- linux调整分区大小
- 调整swap分区大小
- linux分区大小调整
- 调整swap分区大小
- 树莓派调整分区大小
- 树莓派调整分区大小
- linux 调整分区大小
- Parted分区
- parted分区
- Parted分区
- 分区大小调整完全手册
- 分区大小调整完全手册
- AIX下调整分区大小
- 调整 / 分区的大小 LVM
- Objective-C中NSDictionary和NSMutableDictionary的基本用法
- LINQ体验(5)——LINQ to SQL语句之Select/Distinct和Count/Sum/Min/Max/Avg
- Eclipse入门常用快捷键
- UITableView总结
- oracle基本文件之联机重做日志文件
- 用parted调整分区大小
- 常用时间转换方法
- 成员在类中的偏移量 & 类成员指针
- 【算法】矩阵快速求幂
- Oracle10g删除,卸载步骤
- Linux PATH 变量
- 党报评埃及局势:发展中国家应警惕“民主陷阱”
- MFC中菜单的一些操作
- oracle 删除