Burnin "ERROR - unable to open device: /dev/sda [Device or resource is busy]"
Closed this issue · 4 comments
I wanted to burn in my new drives on my new server. These drives are mounted and mirrored with mdadm, then I've pooled two mirror mounts together with mergerfs. There are four drives to burn in, all the same model. I'm not sitting here waiting for files to finish copying or downloading anything.
Running
sudo bbf info /dev/sda
successfully returned info about the drive.
But running
sudo bbf -c *CAPTCHACODE* burnin /dev/sda
returns
ERROR - unable to open device: /dev/sda [Device or resource busy]
Any idea why the devices would be busy?
Because they are mounted. Or do you mean physically mounted? Regardless, something is using the device. /dev/sda is the mdadm device?
I meant virtually mounted. I think the answer to your question is yes, /dev/sda is a mdadm device. Does lsblk
clear that up?
$ lsblk | grep -v loop
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 9.1T 0 disk
└─md0 9:0 0 9.1T 0 raid1 /mnt/mirror1
sdb 8:16 0 9.1T 0 disk
└─md1 9:1 0 9.1T 0 raid1 /mnt/mirror2
sdc 8:32 0 465.8G 0 disk
└─sdc1 8:33 0 465.8G 0 part /
sdd 8:48 0 9.1T 0 disk
└─md0 9:0 0 9.1T 0 raid1 /mnt/mirror1
sde 8:64 0 9.1T 0 disk
└─md1 9:1 0 9.1T 0 raid1 /mnt/mirror2
So if I unmount the md* partitions, then the device should no longer be in use?
Yeah. md is using the device so bbf can't open it for write. You need to run bbf on /dev/md* (which might work but not ideal) or unmount them.
You're a beautiful human, @trapexit. Thanks for the help!
Summary
I had four equivalent drives.
I had 2 x RAID 1 mirrors created with mdadm (ref)
I had both of these RAID 1 mirrors pooled together using mergerfs (ref)
I tried to run a burnin with bad blocks finder.
sudo bbf -c <MYDEVICECAPTCHACODE> burnin /dev/sda
I received an error.
ERROR - unable to open device: /dev/sda [Device or resource is busy]
I went in and unmounted my mergerfs pool and both of my mdadm arrays from their respective spots in my /mnt folder.
$ sudo umount /mnt/storage
$ sudo umount /mnt/mirror1
$ sudo umount /mnt/mirror2
I tried the burnin
again here and was still receiving the ERROR.
The rest of the process involved deactivating the mdadm array.
I then stopped the mdadm arrays, zeroed their superblocks, commented out persistent references to the array in /etc/fstab
file, commented out the array definition in my /etc/mdadm/mdadm.conf
file, and updated initramfs so that the early boot process doesn't try to find these arrays. (ref)