1

I got Pi4 4Gb running rasbian (similar to Debian) and Orico 4bay HDD rack connected with USB3.

Earlier with same host and one HDD in separate enclosure I was able to power off disk using:

sudo udisksctl power-off -b /dev/sda 

But now, for this four disks enclosure rack I got errors like this:

pi@raspberrypi:~ $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 931.5G 0 disk └─sda1 8:1 0 931.5G 0 part └─md0 9:0 0 931.4G 0 raid1 /mnt/raid sdb 8:16 0 931.5G 0 disk └─sdb1 8:17 0 931.5G 0 part └─md0 9:0 0 931.4G 0 raid1 /mnt/raid sdc 8:32 0 2.7T 0 disk └─sdc1 8:33 0 2.7T 0 part /mnt/wdred sdd 8:48 0 1.8T 0 disk └─sdd1 8:49 0 1.8T 0 part mmcblk0 179:0 0 14.8G 0 disk ├─mmcblk0p1 179:1 0 256M 0 part /boot └─mmcblk0p2 179:2 0 14.6G 0 part / pi@raspberrypi:~ $ sudo umount /mnt/raid pi@raspberrypi:~ $ sudo umount /mnt/wdred pi@raspberrypi:~ $ sudo udisksctl power-off -b /dev/sdc Error powering off drive: Error opening /dev/sdb for fsync: Device or resource busy (udisks-error-quark, 0) pi@raspberrypi:~ $ sudo udisksctl power-off -b /dev/sda Error powering off drive: Error opening /dev/sdb for fsync: Device or resource busy (udisks-error-quark, 0) pi@raspberrypi:~ $ sudo udisksctl power-off -b /dev/sdb Error powering off drive: Error opening /dev/sdb for fsync: Device or resource busy (udisks-error-quark, 0) pi@raspberrypi:~ $ sudo udisksctl power-off -b /dev/sdd Error powering off drive: Error opening /dev/sdb for fsync: Device or resource busy (udisks-error-quark, 0) pi@raspberrypi:~ $ 

If I shutdown pi and the turn off this rack with power button on it I see increment of Power-Off_Retract_Count attribute in HDD Smart (so this is not graceful power off, but emergency retract).

How can I properly power off drives in this rack?

2
  • 2
    Device or resource busy is the problem. Something(s) are using the drives. Commented Apr 1, 2023 at 7:27
  • 1
    unix.stackexchange.com/questions/43413/… (from comments in the accepted answer, step 5 is more useful than step 4 and step 4 should not be done). You'll have to do something about MD raid (since this answer covers only DM raid). Commented Apr 1, 2023 at 7:27

2 Answers 2

1

After the umount commands, you should do a

sudo mdadm --misc --stop /dev/md0 

and make sure it's successfully completed before trying to power off drives.

Since you are getting "device or resource busy" errors on all four disks (even from the non-RAID sdc and unmounted sdd, the next step would be to ensure you don't have any disk monitoring software (e.g. smartd) running, and stop them first if you do.

You might also want to use sudo fuser -v /dev/sd* to see if any processes are still using the disks before trying to power them off.

1
  • Sir you are absolutely right - I completely forgot to stop madam array Commented Apr 1, 2023 at 11:28
0

Similar thing can happen with ZFS, but in that case I had a /dev/zd0 after doing zfs unmount POOL. Turns out a zvol existed and was still mounted. The solution was to use zfs export POOL instead, that fully unmounted it all and allowed to re-run the command.

Worth noting that fuser -v /dev/sda or lsof /dev/sda* would've given nothing in result.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.