Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Help] Debian 9 AMD64 Stable, can't "safely remove device".

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
User avatar
fender0107401
Posts: 52
Joined: 2014-05-10 11:42

[Help] Debian 9 AMD64 Stable, can't "safely remove device".

#1 Post by fender0107401 »

My desktop uses two removable disks as a data backup pool.

Very recently, I find I can't "safely remove device" to unmount the removable disks.

If I try to "safely remove device", the system will go to freeze.

Why and how to overcome? Is that a new bug or something like that?

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#2 Post by debiman »

something is probably using it.
try to investigate with

Code: Select all

lsof
you WILL need to grep for something, lsof output is just too long otherwise.

scruffyeagle
Posts: 73
Joined: 2011-09-06 19:11

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#3 Post by scruffyeagle »

I've run into this before. Try using "eject" instead of "safely remove device". I think this happens, because the OS sees external HD's effectively the same as being flashdrives.
.
A.I. - an emergent life form, within an unacknowledged Domain. Expect competition for resources.

User avatar
fender0107401
Posts: 52
Joined: 2014-05-10 11:42

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#4 Post by fender0107401 »

scruffyeagle wrote:I've run into this before. Try using "eject" instead of "safely remove device". I think this happens, because the OS sees external HD's effectively the same as being flashdrives.
OK, I will try.

User avatar
fender0107401
Posts: 52
Joined: 2014-05-10 11:42

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#5 Post by fender0107401 »

debiman wrote:something is probably using it.
try to investigate with

Code: Select all

lsof
you WILL need to grep for something, lsof output is just too long otherwise.
I can't, because I can't run anything.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#6 Post by bw123 »

found some suggestions depending on fs type: fsck them, check smart status, use umount instead, etc.
https://duckduckgo.com/html/?q=debian+f ... ely_remove
My desktop uses two removable disks as a data backup pool.
Sounds interesting, what kind of pool? How does it work?
resigned by AI ChatGPT

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#7 Post by GarryRicketson »

Some times I have just 1, other times 2 portable USB drives connected, using them in a similar way:
removable disks as a data backup pool
Occasionally the same happens, especially if I am using a file manager (GUI) to view/copy or move data, so I am curious as to what file manager is involved here, also maybe DE (desktop environment)
debiman wrote:
something is probably using it.
try to investigate with
CODE: SELECT ALL
lsof

you WILL need to grep for something, lsof output is just too long otherwise.
by fender0107401 » I can't, because I can't run anything.
So what do you do ? How do you shutdown the PC, if you can not do anything ?
Have you tried opening a terminal using <ctr-alt-f1 >or f2, etc ...it does not have to be f1 ? If you can open another terminal, you can run the 'lsof' command from there.
I have found the hard way, it is not good to just power off the PC, with the switch, it can cause considerable damage to the external devices, if they are not properly unmounted before turning the machine off.
by fender0107401 » Why and how to overcome? Is that a new bug or something like that?
Need to know what file manager is involved, I don't think it is anything new, like I said , I have had it happen, and even several years back, I am not sure why, but it seems to me like some GUI file managers have some kind of cache going, and the device stays busy, even when one is not doing anything. I have found usually , if I close the file manager , and use 'umount' from the cli, then I can safely unmount / eject them.
In fact I had this happen just a few minuets ago, I had started to delete a directory, on 1 device, it was a very larger directory, 200+ gb, I changed my mind, because I saw that it was going to take some time, and also I realized maybe I did not really want to delete/remove it, so I "cancelled" or aborted,... it did not matter, even when I closed the file manager, I still could not unmount the drive, from the CLI, it kept saying it was busy. I ended up using the alt-ctrl-f1 as mentioned earlier, and rebooted, I guess it sort of got caught in a "limbo" sort of state, any way after rebooting it was no longer mounted, and after I made sure about removing the directory, I did remove it, took about 15 minuets, but once it was done, there was not the same problem, I was also able to unmount the device, as normal. Hope the OP does not have trouble translating this, if they do not read english very well.

User avatar
fender0107401
Posts: 52
Joined: 2014-05-10 11:42

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#8 Post by fender0107401 »

GarryRicketson wrote:Some times I have just 1, other times 2 portable USB drives connected, using them in a similar way:
removable disks as a data backup pool
Occasionally the same happens, especially if I am using a file manager (GUI) to view/copy or move data, so I am curious as to what file manager is involved here, also maybe DE (desktop environment)
debiman wrote:
something is probably using it.
try to investigate with
CODE: SELECT ALL
lsof

you WILL need to grep for something, lsof output is just too long otherwise.
by fender0107401 » I can't, because I can't run anything.
So what do you do ? How do you shutdown the PC, if you can not do anything ?
Have you tried opening a terminal using <ctr-alt-f1 >or f2, etc ...it does not have to be f1 ? If you can open another terminal, you can run the 'lsof' command from there.
I have found the hard way, it is not good to just power off the PC, with the switch, it can cause considerable damage to the external devices, if they are not properly unmounted before turning the machine off.
by fender0107401 » Why and how to overcome? Is that a new bug or something like that?
Need to know what file manager is involved, I don't think it is anything new, like I said , I have had it happen, and even several years back, I am not sure why, but it seems to me like some GUI file managers have some kind of cache going, and the device stays busy, even when one is not doing anything. I have found usually , if I close the file manager , and use 'umount' from the cli, then I can safely unmount / eject them.
In fact I had this happen just a few minuets ago, I had started to delete a directory, on 1 device, it was a very larger directory, 200+ gb, I changed my mind, because I saw that it was going to take some time, and also I realized maybe I did not really want to delete/remove it, so I "cancelled" or aborted,... it did not matter, even when I closed the file manager, I still could not unmount the drive, from the CLI, it kept saying it was busy. I ended up using the alt-ctrl-f1 as mentioned earlier, and rebooted, I guess it sort of got caught in a "limbo" sort of state, any way after rebooting it was no longer mounted, and after I made sure about removing the directory, I did remove it, took about 15 minuets, but once it was done, there was not the same problem, I was also able to unmount the device, as normal. Hope the OP does not have trouble translating this, if they do not read english very well.
Sorry for the late reply. :D

DE = Mate
File Manager = Caja

When the system go to freeze, to make everything right again, I just reboot the system with the reboot switch.

<ctr-alt-fx> will not work too, I used think this combination will always work.

Now I use the sync and umount cmd to umount the removable disks, so no need to run the "right hit the device and safely remove device".

Also I don't manually copy the backup files. A few minutes ago, I wrote a small Perl script to use rsync cmd to copy the file.

It should not be a Linux bug, I think it is file manager bug, because I still can umount the removable disks.

ernstlx
Posts: 3
Joined: 2018-11-27 20:15
Location: Vienna, Austria

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#9 Post by ernstlx »

Hi,
I've got a very similar problem:
Recently I installed on a Samsung 970 Evo M2-SSD a new Debian 9.5 (kernel 4.9.0-8-amd64) with XFCE desktop, so I use Thunar as file manager (and for "safely remove devices").

Now, after unmounting any USB device (HDD or pendrive) my system is freezing instantly. No input devices are responding. The only possible way to continue is a hard reset. Logs only show series of null bytes (syslog, messages).
-- The crashes only occur with my file manager (Thunar 1.6.11), umount from console works without freeze.
-- Thunar works fine safely unmounting SATA devices.
-- And that's interesting: no problems ever occurred or do occur with my old (quite similar) Debian 9.5 system, installed on a SATA SSD (Samsung 860 Pro). Could this be hardware related?
My otherwise unchanged hardware: ASRock Z170 Extreme4 (latest firmware), i5 6600T (using integrated graphics), 8 GB RAM

Any ideas? I don't like to use eject* or unmount from console.
Best wishes

*) on my system I use an eject button for unmounting, but it powers off the device, so I guess it's a similar function.
Desktop: Intel i5-6600T@2,7GHz, ASRock Z170 Extreme4, 8GB RAM, Samsung 970 Evo SSD, Debian Stretch (64-bit), Xfce
Router/Server: Intel D945GCLF2 ITX-Board mit Atom 330@1,6GHz, 2GB RAM, Samsung 860 Evo SSD, Debian Stretch (32-bit), -

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#10 Post by Head_on_a_Stick »

ernstlx wrote:Any ideas?
https://www.debian.org/Bugs/Reporting
deadbang

ernstlx
Posts: 3
Joined: 2018-11-27 20:15
Location: Vienna, Austria

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#11 Post by ernstlx »

Maybe it's a Debian bug and should be reported, but maybe it is hardware related.

As it turned out, it's not unmounting the USB drive what's causing the trouble, but the following power-off command:

Code: Select all

udisksctl power-off --block-device /dev/sdd
It is not necessarily thunar, which is sending the command. The system freezes after executing the command from console as well.

@fender0107401: You don't use a Samsung M2 SSD eventually, do you?
Desktop: Intel i5-6600T@2,7GHz, ASRock Z170 Extreme4, 8GB RAM, Samsung 970 Evo SSD, Debian Stretch (64-bit), Xfce
Router/Server: Intel D945GCLF2 ITX-Board mit Atom 330@1,6GHz, 2GB RAM, Samsung 860 Evo SSD, Debian Stretch (32-bit), -

scruffyeagle
Posts: 73
Joined: 2011-09-06 19:11

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#12 Post by scruffyeagle »

ernstlx wrote:Hi,
I've got a very similar problem:
Recently I installed on a Samsung 970 Evo M2-SSD a new Debian 9.5 (kernel 4.9.0-8-amd64) with XFCE desktop, so I use Thunar as file manager (and for "safely remove devices").

Now, after unmounting any USB device (HDD or pendrive) my system is freezing instantly. No input devices are responding. The only possible way to continue is a hard reset. Logs only show series of null bytes (syslog, messages).
<snipped>
I'll tell you the same thing I told fender. I ran into this before. The solution was to use "Eject" instead of "Safely unmount" - for ANY USB drive. I've found this to be true in every Linux system I've tried.
.
A.I. - an emergent life form, within an unacknowledged Domain. Expect competition for resources.

ernstlx
Posts: 3
Joined: 2018-11-27 20:15
Location: Vienna, Austria

Re: [Help] Debian 9 AMD64 Stable, can't "safely remove devic

#13 Post by ernstlx »

I've found this to be true in every Linux system I've tried.
I haven't so far and it's a nice feature (if it doesn't freeze the system).

I have done further testing, posted a Debian bug report and found out:
It's primary a kernel bug in kernel 4.9.0-8 (and probably other versions of older kernels)
The command

Code: Select all

udisksctl power-off --block-device /dev/sdx
used by various file managers for "safely remove", causes a complete system freeze.
It is NOT hardware related. My new system, cloned on a Samsung 860 Evo, freezes as well. My old system, cloned on the same SSD, doesn't. I couldn't find out what makes the difference, but I tested with the exact same hardware.
According to a Debian maintainer, it's a kernel bug and it is fixed in kernels from stretch-backports (4.17 or 4.18). It's also not present in the previous stable 4.9.0-7 kernel (tested).
Desktop: Intel i5-6600T@2,7GHz, ASRock Z170 Extreme4, 8GB RAM, Samsung 970 Evo SSD, Debian Stretch (64-bit), Xfce
Router/Server: Intel D945GCLF2 ITX-Board mit Atom 330@1,6GHz, 2GB RAM, Samsung 860 Evo SSD, Debian Stretch (32-bit), -

Post Reply