mkfs.xfs: cannot open /dev/sda1: Device or resource busy

I’m trying to create an XFS filestem on a used disk, and got into a problem. Here is the error message: # mkfs.xfs /dev/sda1 mkfs.xfs: cannot open /dev/sda1: Device or resource busy So, let’s see if I can fix it. (Spoiler alert: I think I can, even though it’s not yet done at the time of this writing.) Let’s check the partitions of /dev/sda: # parted /dev/sda print Model: ATA ST1000LM014-1EJ1 (scsi) Disk /dev/sda: 1000GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 512GB 512GB ntfs 1 So, there is a partition (/dev/sda1) with 512GB in size, and its filesystem is ntfs....

March 13, 2022 · 4 min · 703 words · kenno