Chapter 17. Removing a partition with parted
parted utility, you can remove a disk partition to free up disk space.
Removing a partition deletes all data stored on the partition.
Start the interactive
# parted block-device
Replace block-device with the path to the device where you want to remove a partition: for example,
- Replace block-device with the path to the device where you want to remove a partition: for example,
View the current partition table to determine the minor number of the partition to remove:
Remove the partition:
(parted) rm minor-number
- Replace minor-number with the minor number of the partition you want to remove.
The changes start applying as soon as you enter this command.
Verify that you have removed the partition from the partition table:
Verify that the kernel registers that the partition is removed:
# cat /proc/partitions
Remove the partition from the
/etc/fstabfile, if it is present. Find the line that declares the removed partition, and remove it from the file.
Regenerate mount units so that your system registers the new
# systemctl daemon-reload
If you have deleted a swap partition or removed pieces of LVM, remove all references to the partition from the kernel command line:
List active kernel options and see if any option references the removed partition:
# grubby --info=ALL
Remove the kernel options that reference the removed partition:
# grubby --update-kernel=ALL --remove-args="option"
To register the changes in the early boot system, rebuild the
# dracut --force --verbose