# parted root@ubuntu:~# parted GNU Parted 3.2 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) help align-check TYPE N check partition N for TYPE(min|opt) alignment help [COMMAND] print general help, or help on COMMAND mklabel,mktable LABEL-TYPE create a new disklabel (partition table) mkpart PART-TYPE [FS-TYPE] START END make a partition name NUMBER NAME name partition NUMBER as NAME print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or a particular partition quit exit program rescue START END rescue a lost partition near START and END resizepart NUMBER END resize partition NUMBER rm NUMBER delete partition NUMBER select DEVICE choose the device to edit disk_set FLAG STATE change the FLAG on selected device disk_toggle [FLAG] toggle the state of FLAG on selected device set NUMBER FLAG STATE change the FLAG on partition NUMBER toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER unit UNIT set the default unit to UNIT version display the version number and copyright information of GNU Parted (parted) print Model: VMware Virtual disk (scsi) Disk /dev/sda: 42.9GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags:
Number Start End Size Type File system Flags 1 1049kB 512MB 511MB primary ext2 boot 2 513MB 32.2GB 31.7GB extended 5 513MB 17.2GB 16.7GB logical lvm 6 17.2GB 32.2GB 15.0GB logical lvm (parted) resizepart 2 42.9G (parted) print Model: VMware Virtual disk (scsi) Disk /dev/sda: 42.9GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags:
Number Start End Size Type File system Flags 1 1049kB 512MB 511MB primary ext2 boot 2 513MB 42.9GB 42.4GB extended 5 513MB 17.2GB 16.7GB logical lvm 6 17.2GB 32.2GB 15.0GB logical lvm (parted) quit Information: You may need to update /etc/fstab.
# fdisk -l .... Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 999423 997376 487M 83 Linux /dev/sda2 1001470 83789062 82787593 39.5G 5 Extended /dev/sda5 1001472 33552383 32550912 15.5G 8e Linux LVM /dev/sda6 33554432 62890625 29336194 14G 8e Linux LVM ....
# fdisk /dev/sda Welcome to fdisk (util-linux 2.27.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
Command (m for help): d Partition number (1,2,5,6, default 6): 6
Partition 6 has been deleted.
Command (m for help): n Partition type p primary (1 primary, 1 extended, 2 free) l logical (numbered from 5) Select (default p): l
Adding logical partition 6 First sector (33554432-83789062, default 33554432): Last sector, +sectors or +size{K,M,G,T,P} (33554432-83789062, default 83789062):
Created a new partition 6 of type 'Linux' and of size 24 GiB.
Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
# fdisk -l ..... Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 999423 997376 487M 83 Linux /dev/sda2 1001470 83789062 82787593 39.5G 5 Extended /dev/sda5 1001472 33552383 32550912 15.5G 8e Linux LVM /dev/sda6 33554432 83789062 50234631 24G 83 Linux .....