0

I created a partition with parted and then removed it using parted /dev/<partition> rm partition number. After that I executed partprobe,udevadm settle and systmelctl daemon-reload. Then I used lsblk and the partition was not showing. Then when I tried to create another partition with same size using parted I was able to but when I tried to use mkfs.xfs on that partition, it said the data already exists. It said use the -f option overwrite the data with new file system.

My question is that can you remove the partition and filesystem at the same time using parted? If not, then using fdisk or gdisk is better? Also, what's the difference between partprobe,udevadm settle and systmelctl daemon-reload? Do you use it after creating a partition with parted or after writing a file system on it or both?

1 Answer 1

1

parted doesn't have an option for removing the filesystem, you can use wipefs before running the command. fdisk will ask you to remove existing filesystems when creating a partition and you can also use --wipe-partitions always to make this automatic.

partprobe tells kernel to re-read the partition table on the device. You don't need to run this manually, both parted and fdisk do this after making partition table changes (they use the BLKRRPART/BLKPG ioctls to do that).

udevadm settle just waits until UDev finishes with current queue of events. Again, no need to run this manually, you are not using any tool that relies on UDev (like UDisks) and again, it's up to the tools/users of UDev to deal with this.

systmelctl daemon-reload is used to reload systemd manager configuration. This has nothing to do with partitioning.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .