Cannot format partition due to "Device or resource busy" after partitioning
by happysmash27 from LinuxQuestions.org on (#5PDFJ)
After testing my hard disk by writing random 1TB chunks of data to a BTRFS filesystem on my unpartitioned disk, and it passing, I have finally decided to use it. So, I partitioned it as GPT with fdisk, with two partitions, one for a bootloader in case I ever decide to use this as a boot disk in the future for a Talos Secure Workstation (since it is my only SAS drive), and one for a LUKS partition which I will use today.
cryptsetup, however, fails to write to this partition despite as it is supposedly "already mapped or mounted", despite me having just created it, it not being mounted, and nothing showing in lsof or fuser. btrfs fails similarly:
Code:computer-pig ~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931,5G 0 disk
sda1 8:1 0 2M 0 part
sda2 8:2 0 128M 0 part
sda3 8:3 0 931,4G 0 part
root 253:0 0 931,4G 0 crypt
vg3-swap 253:1 0 200G 0 lvm
vg3-root 253:2 0 731,4G 0 lvm /
sdb 8:16 0 3,7T 0 disk
MEGA 253:3 0 3,7T 0 crypt /mnt/MEGA
sdc 8:32 0 5,5T 0 disk
sdc1 8:33 0 5,5T 0 part
UBackup 253:4 0 5,5T 0 crypt
vg4-UBackup 253:5 0 5,5T 0 lvm /mnt/UBackup
sdd 8:48 0 7,3T 0 disk
sdd1 8:49 0 256M 0 part
sdd2 8:50 0 7,3T 0 part
computer-pig ~ # sync
computer-pig ~ # mkfs.btrfs /dev/sdd2
btrfs-progs v5.6
See http://btrfs.wiki.kernel.org for more information.
ERROR: unable to open /dev/sdd2: Device or resource busyHow can I find out what is supposedly making it busy or free up this busy-ness?
Additional info (after running dmesg to see if there was anything interesting it outputted too many lines for me to go back to my original partitioning so this is just a print of the partitions):
Code:computer-pig ~ # fdisk /dev/sdd
Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sdd: 7,28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: HUS728T8TAL5204
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: D587AFAB-8BA3-D140-9924-7A16BB388BE4
Device Start End Sectors Size Type
/dev/sdd1 4096 528383 524288 256M EFI System
/dev/sdd2 528384 15628053134 15627524751 7,3T Linux filesystem
cryptsetup, however, fails to write to this partition despite as it is supposedly "already mapped or mounted", despite me having just created it, it not being mounted, and nothing showing in lsof or fuser. btrfs fails similarly:
Code:computer-pig ~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931,5G 0 disk
sda1 8:1 0 2M 0 part
sda2 8:2 0 128M 0 part
sda3 8:3 0 931,4G 0 part
root 253:0 0 931,4G 0 crypt
vg3-swap 253:1 0 200G 0 lvm
vg3-root 253:2 0 731,4G 0 lvm /
sdb 8:16 0 3,7T 0 disk
MEGA 253:3 0 3,7T 0 crypt /mnt/MEGA
sdc 8:32 0 5,5T 0 disk
sdc1 8:33 0 5,5T 0 part
UBackup 253:4 0 5,5T 0 crypt
vg4-UBackup 253:5 0 5,5T 0 lvm /mnt/UBackup
sdd 8:48 0 7,3T 0 disk
sdd1 8:49 0 256M 0 part
sdd2 8:50 0 7,3T 0 part
computer-pig ~ # sync
computer-pig ~ # mkfs.btrfs /dev/sdd2
btrfs-progs v5.6
See http://btrfs.wiki.kernel.org for more information.
ERROR: unable to open /dev/sdd2: Device or resource busyHow can I find out what is supposedly making it busy or free up this busy-ness?
Additional info (after running dmesg to see if there was anything interesting it outputted too many lines for me to go back to my original partitioning so this is just a print of the partitions):
Code:computer-pig ~ # fdisk /dev/sdd
Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sdd: 7,28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: HUS728T8TAL5204
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: D587AFAB-8BA3-D140-9924-7A16BB388BE4
Device Start End Sectors Size Type
/dev/sdd1 4096 528383 524288 256M EFI System
/dev/sdd2 528384 15628053134 15627524751 7,3T Linux filesystem