Fixed Failure to Wipe Disk "Error: [Errno 16] Device or resource busy: '/dev/sdb'"

DavisIan22

Cadet
Joined
Feb 2, 2023
Messages
4

System:​

Dell Poweredge R720
PERC H710 Mini D1 card
2x Intel Xeon E5-2690
128GB of Ram
4x 3TB SAS Drives
3x 4TB SAS Drives

Issue:​

About 18 months ago I originially thought I could setup TrueNAS by myself, and did it the wrong way. TrueNAS is virtualized through Proxmox, and I created LVM disks of the full capacity and pushed those to Truenas, instead of forwarding the PCI-E Raid card to my Truenas setup. I had a drive fail, and turns out you really can't do much through proxmox and it was a whole mess. I have a backup Truenas only machine that has all of my data backed up so I decided to redo Truenas through Proxmox. I reinstalled TrueNAS Scale, got the PERC card passed through, and voila! Nothing. All of the drives show up,
1675348166473.png


and they update almost instantly when I pop a new one into the backplane, but when I go to wipe them to create a new Storage pool to sync my backed up data back, I get this error

Error: [Errno 16] Device or resource busy: '/dev/sdb'

I found another person who had a similar issue and they used

Code:
sgdisk -Z /dev/sdXYZ


And after a reboot it fixed it for them. I tried that and it worked!

It took me days to find that thread looking for answers so I thought I might give everyone my post for it to help them out. This is probably common on used drives from other old RAID configurations.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
TrueNAS is virtualized through Proxmox, and I created LVM disks of the full capacity and pushed those to Truenas, instead of forwarding the PCI-E Raid card to my Truenas setup.

Please do not do EITHER of those things.


I reinstalled TrueNAS Scale, got the PERC card passed through, and voila!

The PERC H710 is a RAID controller and is not suitable for passthru use with TrueNAS.


However, it is possible to lobotomize an H710 into a pure IT-mode HBA, see the notes at the bottom of that link.
 

DavisIan22

Cadet
Joined
Feb 2, 2023
Messages
4
Ah yes. I forgot to mention I already put it into IT mode. I used Fodeesha Docs as my method, and I’m sure there are plenty of others but this was super easy to do.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Ah yes. I forgot to mention I already put it into IT mode. I used Fodeesha Docs as my method, and I’m sure there are plenty of others but this was super easy to do.

Awesome, then you're fine. I don't think the method makes a difference. I withdraw my warning about RAID cards since yours no longer is. :smile:
 

Triumph

Dabbler
Joined
May 14, 2014
Messages
12
Error: [Errno 16] Device or resource busy: '/dev/sdb'

I found another person who had a similar issue and they used

Code:
sgdisk -Z /dev/sdXYZ


And after a reboot it fixed it for them. I tried that and it worked!

It took me days to find that thread looking for answers so I thought I might give everyone my post for it to help them out. This is probably common on used drives from other old RAID configurations.

Just wanted to say thanks for posting this, I had this issue on an NVME drive, and couldn't get it working. This did the trick!
Thanks again!
 

Bikerchris

Patron
Joined
Mar 22, 2020
Messages
210

rhuneai

Cadet
Joined
Jul 26, 2023
Messages
2
Thank you as well @Davislan22, zapping the disk (and rebooting!) resolved this issue for me.

I had 4 used HGST SAS HDDs that I had run badblocks on to test. One of these I used in a Proxmox node (so maybe was LVM?) and then had this busy error when I tried to use it in a TrueNAS Scale build. The other 3 HDDs hadn't been touched since running badblocks and worked fine.

I had tried zeroing the busy disk with dd (dd if=/dev/zero of=/dev/sdb bs=1M), but still got the busy error.

Not sure if it was due to zeroing the disk with dd or maybe if it was the cause of the error, but sgdisk gave a few header errors that the unused HGST disks didn't.

Code:
root@truenas[/home/admin]# sgdisk -Z /dev/sdb
Warning: Partition table header claims that the size of partition table
entries is 0 bytes, but this program  supports only 128-byte entries.
Adjusting accordingly, but partition table may be garbage.
Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!

Warning: Invalid CRC on main header data; loaded backup partition table.
Warning! One or more CRCs don't match. You should repair the disk!
Main header: ERROR
Backup header: OK
Main partition table: OK
Backup partition table: OK

Invalid partition data!
GPT data structures destroyed! You may partition the disk using fdisk or
other utilities.


Thanks again!
 
Top