Discussion:
OS freezes when copying to USB
(too old to reply)
Joerg Walther
2024-03-03 13:38:23 UTC
Permalink
When copying larger files to any USB drive on a Thinkpad T480 with
Ubuntu 22.04 it quite often happens that the OS completely freezes and
the PC has to be restarted by switching it off and on again.
This seems to be an old problem, I found this bug report:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1208993?comments=all
which starts with 13.04, but the last comments are about 22.04. Are
there any ideas how I can fix this? Has this been fixed in 23.10 or will
it be fixed in 24.04?
Thanks for any input on this.

-jw-
--
And now for something completely different...
Markus Robert Kessler
2024-03-04 08:51:21 UTC
Permalink
Post by Joerg Walther
When copying larger files to any USB drive on a Thinkpad T480 with
Ubuntu 22.04 it quite often happens that the OS completely freezes and
the PC has to be restarted by switching it off and on again.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1208993?
comments=all
Post by Joerg Walther
which starts with 13.04, but the last comments are about 22.04. Are
there any ideas how I can fix this? Has this been fixed in 23.10 or will
it be fixed in 24.04?
Thanks for any input on this.
Does the OS "come back" when disconnecting / unplugging the drive?

BR,
Markus
Joerg Walther
2024-03-04 14:15:10 UTC
Permalink
Post by Markus Robert Kessler
Post by Joerg Walther
Thanks for any input on this.
Does the OS "come back" when disconnecting / unplugging the drive?
I have to try this the next time it happens.

-jw-
--
And now for something completely different...
Joerg Walther
2024-03-04 15:14:24 UTC
Permalink
Post by Joerg Walther
Post by Markus Robert Kessler
Does the OS "come back" when disconnecting / unplugging the drive?
I have to try this the next time it happens.
Just tried: It does not come back.

-jw-
--
And now for something completely different...
Paul
2024-03-04 13:57:36 UTC
Permalink
Post by Joerg Walther
When copying larger files to any USB drive on a Thinkpad T480 with
Ubuntu 22.04 it quite often happens that the OS completely freezes and
the PC has to be restarted by switching it off and on again.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1208993?comments=all
which starts with 13.04, but the last comments are about 22.04. Are
there any ideas how I can fix this? Has this been fixed in 23.10 or will
it be fixed in 24.04?
Thanks for any input on this.
-jw-
There are potentially lots of levels of write caching to disable.

Will require more research.

The hdparm thing, might only be useful for some benchmarking activity,
rather than general disk usage.

https://stackoverflow.com/questions/20215516/disabling-disk-cache-in-linux

Maybe something like down the end of this thread.

https://unix.stackexchange.com/questions/637598/how-to-truly-disable-the-write-cache-functionin-dmesg-in-ubuntu-for-an-externa

"edit your /etc/fstab ... mount option sync"

Normally, a memory based cache for write, does not occupy so much space,
that it causes swapping to disk. That would be bad. As if we're forced
to write synchronously to flush the write cache, and at the same time
we need to swap for some reason... will that even work ?

Paul
Joerg Walther
2024-03-04 15:16:16 UTC
Permalink
Post by Paul
Maybe something like down the end of this thread.
Right, so I disabled the write cache via udev rule, which unfortunately
did not help. Note that the system is not out of memory, I have 32GB and
at the time this happened barely a quarter of it was in use.

-jw-
--
And now for something completely different...
stepore
2024-03-05 02:50:21 UTC
Permalink
Post by Joerg Walther
When copying larger files to any USB drive on a Thinkpad T480 with
Ubuntu 22.04 it quite often happens that the OS completely freezes and
the PC has to be restarted by switching it off and on again.
I assume this is dragging/dropping (copy/paste) files in a GUI?
Does same happen from shell, using cp or rsync?
Joerg Walther
2024-03-05 15:20:33 UTC
Permalink
Post by stepore
Post by Joerg Walther
When copying larger files to any USB drive on a Thinkpad T480 with
Ubuntu 22.04 it quite often happens that the OS completely freezes and
the PC has to be restarted by switching it off and on again.
I assume this is dragging/dropping (copy/paste) files in a GUI?
Does same happen from shell, using cp or rsync?
It does not matter, it happens in GUI (Double Commander) and in the
terminal.

-jw-
--
And now for something completely different...
Anssi Saari
2024-03-05 08:25:37 UTC
Permalink
Post by Joerg Walther
When copying larger files to any USB drive on a Thinkpad T480 with
Ubuntu 22.04 it quite often happens that the OS completely freezes and
the PC has to be restarted by switching it off and on again.
You mean your PC crashes when copying data to USB? I would think that's
a hardware issue. If it doesn't happen in some other flavor of Linux,
then maybe it's something in Ubuntu.
Joerg Walther
2024-03-05 15:22:57 UTC
Permalink
Post by Anssi Saari
Post by Joerg Walther
When copying larger files to any USB drive on a Thinkpad T480 with
Ubuntu 22.04 it quite often happens that the OS completely freezes and
the PC has to be restarted by switching it off and on again.
You mean your PC crashes when copying data to USB? I would think that's
a hardware issue.
Probably not because it happens when the USB drive is connected to a
USB2 port als well as a USB3 port, it's unlikely that two USB
controllers are defective.
Post by Anssi Saari
If it doesn't happen in some other flavor of Linux,
then maybe it's something in Ubuntu.
The link in my original message points to a bug filed with Ubuntu years
ago, it may be this bug and I am looking for a fix or a workaround.

-jw-
--
And now for something completely different...
Loading...