Powering-off external USB HDD causes Tumbleweed to lock-up

OK running Tumbleweed from my machine’s internal drive. sometimes I have an external USB HDD attached

I used to unmount the partitions on the external drive and power it down with gnome-disks. After a recent update, the power-down option on gnome-disks ceased to work. Instead the system locked-up. Had to do Alt+SysRq+“R”,“E”,“I”,“S”,“U”,“B” to get it back.

My understanding is that gnome-disks uses these commands:

To unmount partition /dev/sdXn:

udisksctl unmount -b /dev/sdXn

To power-off device /dev/sdX

udisksctl power-off -b /dev/sdX

Issued these commands from a virtual - Ctrl+Alt+F1 - terminal

The “unmount” commands worked OK, but the “power-off” command filled the screen with text and then froze the system.

Just before I did a reisub, I noted down a few phrases from the screen: “kernel not syncing”, “kernel panic”, “hard lockup”,…

What’s going on?

Is there some other way of powering-down an ext USB HDD?

As long as you unmount the disk before powering off, it should be okay.

Hmm, I usually unplug the USB cable before I power off the external disk. So that would be:

  1. umount the drive
  2. unplug the USB cable (either end)
  3. power off the drive.

For that matter, I usually power on, and let the drive get up to speed before I plug in the USB cable.

Same here (without screen filled with text).
With power-off my system has frozen 3 times in a row.
Strange. I used these commands a week ago and everything was fine.

Sorry, there is a misunderstanding. I am talking about a 2.5" hdd powered only by USB.

Have you tried sync;sync;sync…depending upon the number of partitions on the disk before running the commands to insure you don’t have any cached writes waiting?

  1. I did not sync but I did not write anything on it.
  2. I think that if there was some caches writes waiting, I would not unmount it (not power-off).

Re: nrickert’s suggestion. To clarify: the drive in Q is an external USB drive; it draws its power from the computer to which it is attached.

Moving on:

Could this - the recent tendency of my system to freeze when I attempt to power-down an ext HDD - be a “permissions” problem? I.e., have the permissions for gnome-discs, udisksctl (whatever) gone awry somewhere as a result of a recent update?

What if I tossed a “sudo” into the mix - would that do anything, like, bad?

A thought (of more general interest): is there a way of asking the system to simulate the performance of a command (and to report back) without actually carrying-out the command?

Okay. I never had a problem with one of those. I just unmount, then unplug the USB (which powers it down).

I have usually mounted via the “Device Notifier” in KDE. So I unmount the same way, and it tells me that it is safe to remove. But I guess that’s probably the same as what Gnome-disks was doing.

From what I was reading it is better to unplug an external hdd after “power-off” command. After “unmount” the hdd is still powered and platters still spin. “Power-off” will shut down the power and the platters will stop spin.

Hi
Likewise here, one note though I always use a Y adapter to ensure there is plenty of power for a USB disk… never had an issue unmounting/syncing then unplugging.

I also use a USB hub/USB 2.5" caddie, this is powered via a usb power adapter for the HDD, also have a USB IDE-SATA adaptor with separate power for 3.5" drives, this also works fine.

We are not alone:
https://bugs.archlinux.org/task/58548

Interesting. Thanks.

We can hope that it is quickly solved.

Hi
I don’t see it here on 4.16.9-1-default with GNOME, Nautilus and USB 3.0, now I do see some stack trace for the shell on unmounting with Nautilus, but all functional, no lockup…


/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
    |__ Port 1: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 5000M

Hi
Also tested with a 2.5 drive and USB 3.0;


/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
    |__ Port 1: Dev 15, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 1: Dev 17, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 2: Dev 16, If 0, Class=Mass Storage, Driver=uas, 5000M

HDD uses the uas driver, all unmounted and unplugged fine…

Hi,
Malcolm, sorry, maybe I do not understand well but there îs no problem if I unmounted from Dolphin.
Command line is the problem.
udisksctl unmount -b /dev/x - working
then
udisksctl power-off -b /dev/x - froze the system.

With pleasure @nrickert.

As of this week, the command-line problem is fixed on my system:

azed@linux-qnar:~> uname -r
4.16.12-1-default

I.e.,

udisksctl unmount -b /dev/sdaXn

and especially

udisksctl power-off -b /dev/sdX

behave as they should.

Maybe it was fixed earlier. Whoever did it, thanks.

Gnome-disks isn’t quite right though. When I use it to unmount a partition, I get this error-message:

Error unmounting filesystem
Device ‘/dev/sda7’ is not mounted (udisks-error-quark, 7)

After closing the error-dialogue, the target-partition unmounts as it should