Linux format System Disk error [How to Solve]

#Background

When the hard disk has a system, the format prompt indicates that the system cannot format

Input: mkfs ext4 /dev/nvme0n1

Error reporting:/dev/nvme0n1 is appropriate in use by the system; will not make a filesystem here!

#Solution

Prompt that/dev/sdk1 is in use/ Dev/sdk1 is being managed by DM, so when we create the file system, we will be prompted with an error. We can manually remove it to create the file system normally. The operation is as follows:

Check:
dmsetup status

Clear:
dmsetup remove_all

Check:
dmsetup status

Execute the command: mkfs.ext4 /dev/nvme0n1

Similar Posts: