
Deleting a partition frees its space for a new layout or for extending another partition. It also erases access to everything on it, so the safe order matters: back up, unmount, remove it from /etc/fstab, then delete. This guide shows how with fdisk, parted and LVM, on CentOS, Rocky Linux, AlmaLinux, Ubuntu and Debian.
Quick answer(partition /dev/sdb1, not the system disk):
sudo umount /dev/sdb1
sudo sed -i.bak '/sdb1\|UUID-OF-SDB1/d' /etc/fstab # or edit /etc/fstab by hand
sudo parted /dev/sdb rm 1
lsblk /dev/sdb
Step 1: Identify the partition
lsblk -f
sudo fdisk -l /dev/sdb
Check the device name, size, filesystem and mount point carefully. Never delete partitions on the disk you booted from (usually sda, vda or nvme0n1) unless you know exactly what you're doing; deleting the root, /boot or EFI partition makes the system unbootable.
Step 2: Back up and unmount
Copy anything you need from the partition first. Then unmount it:
sudo umount /dev/sdb1
# "target is busy"? find what's using it:
sudo lsof +f -- /mnt/data
If it's a swap partition, turn it off with sudo swapoff /dev/sdb2.
Step 3: Remove it from /etc/fstab
sudo blkid /dev/sdb1 # note the UUID
sudo nano /etc/fstab # delete or comment out the line with that UUID or device
Skipping this step can stop the server from booting, because it will try to mount a partition that no longer exists.
Step 4: Delete the partition
With fdisk
sudo fdisk /dev/sdb
- Press p to print the partition table.
- Press d and enter the partition number to delete.
- Press p again to check, then w to write the change. Until you press w, nothing is changed and q quits safely.
With parted
sudo parted /dev/sdb print
sudo parted /dev/sdb rm 1
If the kernel doesn't notice the change, run sudo partprobe /dev/sdb.
Deleting an LVM partition
On CentOS and Rocky, data partitions are often LVM logical volumes. Remove them from the top down:
sudo umount /data
sudo lvremove /dev/vg_data/lv_data
sudo vgremove vg_data # only if the volume group is no longer needed
sudo pvremove /dev/sdb1
sudo parted /dev/sdb rm 1
Wipe leftover signatures (optional)
To remove old filesystem or RAID signatures so the disk looks new:
sudo wipefs -a /dev/sdb1 # before deleting the partition
sudo wipefs -a /dev/sdb # the whole disk, including the partition table
wipefs doesn't overwrite the data itself. To destroy data securely before disposing of a disk, use your disk's secure-erase feature or overwrite it.
Frequently asked questions
How do I delete a partition in Linux?
Unmount it, remove it from /etc/fstab, then delete it with d in fdisk (and w to save) or parted /dev/sdX rm N.
Can I delete a partition that's in use?
No. Unmount it first (and swapoff for swap). The root partition can't be deleted from the running system.
Does deleting a partition erase the data?
It removes the partition entry, so the data is no longer accessible, but it isn't securely overwritten. Recovery tools may still find it.
How do I delete all partitions on a disk?
Create a new empty partition table with sudo parted /dev/sdb mklabel gpt, or wipe it with sudo wipefs -a /dev/sdb. Both destroy access to everything on the disk.


