rPi3 freezes after some time

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version | G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=11
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
  • Distro version | bookworm 0
  • Kernel version | Linux DietPi 6.6.74+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.74-1+rpt1 (2025-01-27) aarch64 GNU/Linux
  • Architecture | arm64
  • SBC model | RPi 3 Model B (aarch64)
  • Power supply used | 5.1V, 2,5A output, 0,5A Input
  • SD card used | Sandisk Ultra 16gb

Additional Information (if applicable)

  • Software title Not sure which software is at ault.
  • The software was freshly installed.
  • It happened to me but I’m not sure it will happen to you.
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | 96ce5892-1933-4829-8760-7d644d0f22c1

Steps to reproduce

  1. Install samba and emby.
  2. Mount external USB drive.

Expected behaviour

  • I should be able to access my USB drive freely.

Actual behaviour

The Raspberry Pi freezes/gets stuck after some hours or sometimes a day or two.

Extra details

I might be looking at the wrong place in the log but here was something interesting:

Mar 22 16:57:32 DietPi systemd[1]: dev-serial0.device: Job dev-serial0.device/st                                                                             art timed out.
Mar 22 16:57:32 DietPi systemd[1]: Timed out waiting for device dev-serial0.devi                                                                             ce - /dev/serial0.
Mar 22 16:57:32 DietPi systemd[1]: Dependency failed for serial-getty@serial0.se                                                                             rvice - Serial Getty on serial0.

Do you have any hard drives attached via USB? Or other devices?

Have a look on resource consumption like CPU and memory

I have a 2TB USB drive connected, yes.

I don’t really know how to check that, I’m not too experienced with this.

you can use free -m and htop

Can you describe the freezing situation a little more? Is the system then no longer accessible at all or only individual applications?

I couldn’t quite figure out how htop worked but with the first command I got this.

               total        used        free      shared  buff/cache   available
Mem:             957         733          31           8         215         223
Swap:

As for the freezing, it’s hard to say for sure because it happens so randomly. But I use my external USB drive as a network drive and when the pi freezes my network files are inaccessible and I can’t log in via putty.

hmm, the available memory is quite low and there is no SWAP file configured. Normally we recommend a total of 2GB memory (phys + swap).

Pls run following to create a swap file

/boot/dietpi/func/dietpi-set_swapfile 1

Okay, I created a swap file, I guess we’ll see if this happens again?

you should see the swap file created. Just watch the usage over time.

Okay, this is what it looks like now, is everything as it should or do I need to change/fix anything?

 free -m
                total        used        free      shared  buff/cache   available
 Mem:             957         738          25           7         216         218
 Swap:           1090           6        1084

EDIT:

Sorry, I can’t seem to format the thing properly. But the swap file has 1084 free memory.

I just did for you :wink:

nope all fine, just keep on watching how free memory and swap usage is behaving.

Has it is own PSU? I had some issues in the past with systems get unresponsive after some time / load when the drive took power only via USB. Even with SSDs

Okay, so I checked the memory today and on the swap usage the used memory is 497 and the free memory is 593. Shoul I be worried?

can you share this again

             total        used        free      shared  buff/cache   available
Mem:         957         531          32           1         410         425

there is no SWAP ??

That’s 'cause I forgot to include it in my copypaste, sorry about that.

                            total        used        free      shared  buff/cache   available
           Mem:             957         531          32           1         410         425
           Swap:           1090         492         598

ok, it looks like your system is using more memory than it physically has. This was probably also the reason why the system froze from time to time, as there was simply not enough memory available. So using SWAP is ok for now to avoid this situation. Keep an eye on the SWAP utilisation to see if it continues to increase. Basically you should check what is using the memory.

I will try to monitor the situation. I know it’s possible to add a swap file to the external drive, is that a good idea or not?