top of page
Writer's pictureMukesh Chanderia

Linux Commands Part 19 -DELETE LINUX PARTITION

Updated: Aug 21, 2021

Friends,


As of now two partitions are mounted


[root@RedHat ~]# df -h | grep sdc

/dev/sdc1 1008M 1.3M 956M 1% /thisisnewpart

/dev/sdc6 8.9G 21M 8.4G 1% /root/thisisnewpart3

So if try to delete without unmounting then it will give error


Step 1 : unmount


[root@RedHat ~]# umount /dev/sdc1

[root@RedHat ~]# umount /dev/sdc6


[root@RedHat ~]# fdisk /dev/sdc

Welcome to fdisk (util-linux 2.32.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-7, default 7): 7

Partition 7 has been deleted.

Command (m for help): d

Partition number (1-6, default 6): 8

Value out of range.

Partition number (1-6, default 6):

Partition 6 has been deleted.


Step 2 : Save Configuration


After deleting all save file with "w"

Command (m for help): w


The partition table has been altered.

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).

13 views0 comments

Comments


bottom of page