Question regarding kernel panic

Me too :smiley:
I don’t know. I just suspect.
Based on few things.

  1. Reading this conversation:
    beagleboneblack - Kernel panic: No working init found. Where is the problem - Stack Overflow

Looking at your screenshot I seen kernel tried /bin/init then /bin/sh without reposrting an error, so looking back to the conversation:

You would get the above message “Starting init: …/init exists but couldn’t execute it (error…” if the execution of the init program returns something else than ENOENT meaning that the program is not present.

That suggests me your kernel doesn’t find the init it whises…

  1. Additionally:
    AFTER the final try to run init as /bin/sh, there’s the line about a new USB device: 1-1.2.3, and few lines later I see 1-1.2.3 is Elements 25A2.

This tells me your USB dirve is not recognised soon enough.
Why?
No idea. Maybe it was there before, but accidentally disconnected then reconnected quickly?
I don’t know.

Did you try to use this drive in an other port?

3 Likes

None. Syslog is making some logs, but not messages or dmesg. You may be able to look at the systemd logs.
but
@kovacslt may be right
there may be nothing in the logs if the kernel terminated abruptly

2 Likes

I wonder if the response time of the external usb drive is
marginally too slow, and the kernel is simply not waiting long enough.
It does say not syncing.
There may be a kernel boot parameter that would increase its wait times?

2 Likes

Hi again, :wave:

thanks so much for your answers.:heart:

@kovacslt :

Thank you for the analysis of the screenshot. That´s really great.

I´m almost convinced that has to be it.

Well, actually: no.
The problem occurred 13 days ago for the first time and then everything worked well for the next 9 days, until the kernel panic happened again.
In both cases an immediate 2nd attempt to boot succeeded without any physical interaction on my part.

Had I chosen another usb port for the second attempt it would in all probability have succeeded as well and we were none the wiser… :thinking: .

@nevj :

Thanks Neville.

I think you and László are on the right track, Neville.

I will definitively do some research on it. :+1:

I never mentioned my exact physical setup scenario, being of the opinion it was of no importance.
Well, I guess I just tell you more about it:

The external HDD (Elements 25A2) is not directly attached to a physical USB port on the PC but rather to a hub (with it´s own power supply).
The external HDD wouldn´t be able to run without it.

So powering down the PC for the night entails the following:

  • mount | grep ext3
  • … which tells me it´s /dev/sda (as an example)
  • sudo hdparm -S 120 /dev/sda (which lets the HDD arrive at a park position after 10 mins; so it spins down)
  • after 10 mins I shut down the external power supply of the hub for the night.

Next day:

  • I turn on the power supply for the hub
  • the HDD begins to spin
  • I power on the PC
  • time elapsed between turning on the power supply of the hub and switching on the PC in plenty enough (5 - 10 mins)

I was also wondering: Should I not switch off the power supply of the hub overnight :question:
Would that have any effect on the situation at all? :thinking:

Many thanks to you all.

Cheers from Rosika :slightly_smiling_face:

Hi Rosika,

I don’t believe you need a hub for your WD Element, but it should not hurt.
Over the years I own several external WD hard drives. All of them connected directly to the USB port on my PC.

Have a good day.
Howard

2 Likes

Hi Howard, :wave:

well, the thing is: I have too many peripherals with too few USB ports available. So I have to use the hub.
But - as I said - the hub has a power source of its own and thus works perfectly.

So it´s just the question:

Should I not switch off the power supply of the hub overnight :question:

Actually I cannot image it would make any difference at all.

Thanks for your opinion on the matter, Howard.

All the best from Rosika :slightly_smiling_face:

Hi Rosika,

My opinion is it does not matter. Personally, I would switch it off.

Curious. How many devices and what are they besides the WD HDD connected to the USB hub.
What is connected to the other USB ports on the laptop?

Regards,
Howard

1 Like

Hi Rosika,
That introduces some more cables/sockets etc that may be
intermittantly faulty.
I remember spinning up externally powered disks… we used to allow about a minute, so 5 mins should be fine.
If the HDD is working well enough to start the boot process, then it is functioning properly.
One thing that used to slow disk responses was fragmentation.
I am not sure, but I think modern disks do not need to be defragmented. We had better check.
Regards
Neville

2 Likes

Thanks all for your replies, :heart:

@easyt50 :

That was my feeling as well. Thanks for your opinion.

This is what it used to look like:

It has changed a bit in the meantime, but not much.

The other ports are used as well (speakers).
I want to leave 2 of them empty as I need those pretty regularly for the ventoy stick and another external HDD (for storing clonezilla backups).

@nevj :

… even if I never even touched them between the first and the second boot attempt?

Thanks, Neville. In most cases it´s even more than 5 minutes.

I was thinking:

As you mentioned:

I was doing some research on the matter.

What about this:

I´m trying to adjust the timeout parameter related to kernel boot. It seems the parameter that might be relevant to my situation is rootdelay, which specifies the number of seconds to wait for the root device to become available.

In /etc/default/grub:

the line starting with GRUB_CMDLINE_LINUX_DEFAULT

add rootdelay=<seconds> to the end of the existing kernel parameters. For example:

GRUB_CMDLINE_LINUX_DEFAULT="noplymouth rootdelay=10"

This would add 10 seconds of rootdelay.
After that:
sudo update-grub

This might be more of a workaround than a solution, and it might not address the root cause of the intermittent recognition issue, but would it be worth a try?
What do you think :question:

Many greetings from Rosika :slightly_smiling_face:

2 Likes

Hi Rosika,
You found the appropriate parameter … well done.
Yes it is a workaround, but your complicated usb setup may need it.
10 secs should be more than enough, given that it works most of the time.

Looking at your diagram, where is the computer link?
How many hubs does it have to negotiate between the computer and the HDD?
It would be best if computer and HDD were on the same hub.
It is possible that any of those devices or their connectors could interfere with your disk response. All it takes is a bit of noise to slow things on a network.
You could try disconnecting devices, one at a time , but it would be tedious. Some devices like KB and mouse need to be there, of course.

BTW Have you tried the program dia… it draws diagrams
like yours

Regards
Neville

2 Likes

Hi,
First of all I want to apologize to all the users who replied if I repeat some of the tips I’ve already mentioned.

I had some difficulty understanding the topic, because it’s quite long and I didn’t follow it from the beginning and I spoke to Rosika to clear up some doubts I had.

I’ll tell you right now that I don’t know the cause or the solution to Kernel Panic, but I’m going to give my opinion on something I’ve checked and which may cause errors.

Hi Rosika,
As I understand it, this is your system:

And this is the installation you’re using at the moment:

  • You daily use Linux Lite which is installed on the external HDD disk;
  • You don’t use WIN 8, which is installed on the internal HDD disk;
  • The EFI partition you are using is on the internal HDD disk.

This is the diagram of what I understand about your current system:


In my opinion, what are the possible irregularities that I see as most likely to occur with this system?

  • The operating system you use on a day-to-day is installed on the external HDD disk;
  • The internal HDD disk is only being used because of the EFI partition;
  • The internal disk is consuming unnecessary power: ~21.5W at startup and 6W when reading/writing;
  • The internal HDD disk has a power cable connected from the internal power supply;
  • The internal HDD disk connects to the motherboard via a SATA cable;
  • Your internal power supply, if it’s still the original one, is 10 years old, which can lead to power supply irregularities;
  • The external HDD disk has an internal USB to SATA converter circuit (I’ll call it a SATA controller);
  • The external HDD disk has a SATA connection to the SATA controller;
  • The external HDD disk has a Power connection to the SATA controller;
  • The internal HDD disk, in some situations and from what I have been able to ascertain, can have a consumption of up to 900mA (I can’t find any specific information);
  • The USB plugs on the PC and the cables, over time, may have bad contacts or possibly oxidize, even with the cables connected;
  • The USB cables, over time, may have bad internal contacts (soldering or even the cables themselves)
  • The external HDD disk is connected via USB 2.0 (the PC only has USB 2.0) which lowers the speed to 480Mbit/s (I assume this is the max speed of USB 2.0).
  • The powered 7-port USB HUB can have a total of 12 (13?) USB ports, according to the diagram below:

  • The USB HUB has an internal controller and has a power limitation per USB port;
  • The USB HUB’s power supply may not have enough power for all the peripherals;
  • The USB HUB’s power supply may have power supply irregularities.

I don’t know the SMART of the internal disk (I couldn’t find it in the topic).

In my opinion and if you can afford it, the way to significantly improve your system would be:

  • Remove the internal HDD disk ;
  • Install an internal SSD (maybe 500GB will be enough);
  • Install Linux Lite on the SSD;
  • You have 4 USB plugs in your PC. I would restructure the HUB connections.

If you need more space, you have the external HDD to expand your system.

What would happen with this change?
You would eliminate:

  • Boot problems with the external HDD disk and its USB SATA converter;
  • Problems with the HUB;
  • Problems with the HUB’s power supply;
  • Problems with USB cables;
  • Problems with USB plugs.

What would you gain by making this change?

  • The consumption of an SSD is much lower than that of an HDD disk;
  • The read and write speed is much higher than that of an HDD disk;
  • Although it’s subjective, your internal power supply would have better performance and lower consumption;
  • You would eliminate possible unnecessary faults;
  • All in all, you get “a new PC”;
  • And, with this change, you could possibly solve the Kernel Panic problem.

I know it’s not the answer you want to your PC problem, but this is my honest opinion.
I’d like to know what other members think.

Jorge

Well done Jorge,
It is a very comprehensive and helpful analysis of the situation,
Regards
Neville

3 Likes

Hi again and thanks a lot for your replies, :wave:

@nevj :

Thanks. Should I run into the problem again I´ definitvely try editing /etc/default/grub.
Perhaps it helps…

Sorry, I created the diagram a long time ago. Seems I missed it.
But @Tech_JA has done such a great job in coming up with a perfect diagram of the layout (see above). I couldn´t have done it better.

Between the PC and the external HDD there´s just one hub (the one with its own power supply).

Thanks also for all of the additional info. I´ll do my best taking it into account.

I haven´t heard of dia yet. Seems interesting. I´ take a look at it at ubuntuusers (in German though), which should provide a general overview. Thanks for mentioning it.

@Tech_JA :

Thank you so much, Jorge, for putting a lot of time and effort into analyzing the situation and setup.
You´ve done a wonderful job here. :heart:

Your diagram depicts the setup perfectly.
I also see you added the connection to the PC in my diagram. That´s correct, of course. Thank you for doing so.

You also did so much research in finding out the links to the hardware.
That´s what I should´ve done in th first place. I missed that completely. Thanks again, Jorge.

Wow, that´s such a concise and comprehensive compilation of the various aspects of the setup and of possible irregularities. I´m blown away. Really, I am. :+1:

No, you couldn´t have. I hadn´t checked the health of the internal HDD. I´ve done so now. Here are the results:

sudo smartctl -A /dev/sda
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-88-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   138   133   021    Pre-fail  Always       -       4066
  4 Start_Stop_Count        0x0032   096   096   000    Old_age   Always       -       4250
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   076   076   000    Old_age   Always       -       17633
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   096   096   000    Old_age   Always       -       4231
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       158
193 Load_Cycle_Count        0x0032   199   199   000    Old_age   Always       -       4090
194 Temperature_Celsius     0x0022   109   097   000    Old_age   Always       -       34
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

Thanks a lot for these recommendations and for listing the advantages of following them.

You´ve done such a great job, Jorge. That´s really much more than could have been expected.

I have not yet decided what to do and what path I will follow. I guess it depends on how things will develop in the time to come.

Adding a bit of delay: GRUB_CMDLINE_LINUX_DEFAULT="noplymouth rootdelay=10" might be the first thing to try.

Anything else will be part of some kind of harware scenario, of course. But at least I have a notion about possible things to try. :blush:

Thank you so much again, Jorge, for your help. :heart:
It´s highly appreciated.

Have a nice day and many greetings from Rosika :slightly_smiling_face:

3 Likes

I was quite bursy, so I finish my post I started 2 days ago.
Sorry if I miss something, because the thread was active, and somewhat TLDR.
But I feel I’d like to reflect to some of things…

So let’s do the timewarp :smiley:
----======------

Another reason to install your system to internal drive :wink:

Wow!!!
What a ceremony!
:slight_smile:

I’d just shut down the computer, and simply switch off the power of the HDD afterwards…

Agreed. :wink:

It has nothing to do with time and waiting. It just tells, that the kernel in panic is in an incosistent / undefined state, and doesn’t try to flush data buffers, avoiding data damage.
At least this is what I read:

----=====-----

And for getting back to the currently happening future :smiley:

The SMART seems to be perfect.

Of course you can. But if you install a new(?) system onto an SSD or at least your current internal drive, the kernel parameter tweaking is unnecessary.
+Is your hub by any chance a Trust hub? I have one too, a 7 port hub with a power supply, It’s great because it has many ports, but its only an USB 2.0 hub (slow…) I connect only non-performant devices to it: mouse, keyboard, printer/scanner.

I think the very best you can do is what @Tech_JA suggested: get an SSD, and put the system there.
A silver medalist option would be to install your system onto your current builtin HDD.
Tweaking your current install on that external drive is only the bronze medalist option at best - I think :wink:

Hi László, :wave:

thank you so much for your reply and for your suggestions. :heart:

Actually it sounds more complicated than it is. It´s become second nature to me, so I do it in an “automatic” kind of way. :smile:

Thanks for the link. I read it through and you seem to be completely right in your assessment.

I see. That´s good to know.
But why is that? What´s the difference between using the internal drive and the external one in this respect :question:
The only difference I can spot is read/write speed would be lower with the external one due to the fact that it´s connected via USB2.0. Might that be it :question:

No, it´s hama hub. :

Yes, that´s great advice indeed.

Thank you so much @kovacslt and @Tech_JA (and to all of you, of course). You´ve done more than I could have asked for. :heart:

Many greetings from Rosika :slightly_smiling_face:

1 Like

Hi Rosika,
Just for curiosity, could you please inform the model of the USB HUB?
Thanks

Jorge

Hi Jorge, :wave:

That´s all what I could come up with. I have not any further specifics available.
Sorry. :slightly_frowning_face:

Cheers from Rosika :slightly_smiling_face:

1 Like

Hi Rosika,
Thanks for the info.
From the picture you sent, I think 00078483 is the model of your HUB and this is the link to the HUB:
Hama 00078483 - USB 2.0 Hub 1 - 7 with Power supply unit Black - anthracite

Please correct me if this is not the model.

According to the manual, the power supply is 5V 2.5A:

From my point of view and I could be wrong, if you have 7 peripherals connected to the 7 ports of the HUB, the maximum that the HUB will be able to provide for each port will be ~350mA for each port (this may not be true because not all connected peripherals can or do consume 350mA), but as you can have up to 13 peripherals connected to the HUB (via the other 2 HUBs) the current for each port should be very limited and I believe that your external HDD disk, in certain situations, could consume much more than this value.

To rule out that the kernel panic is being caused by the connection to the HUB and since your PC has 4 USB ports, I would connect the external HDD exclusively to a USB port on the PC.

BTW: You didn’t connect any other peripherals to the HUB a few days before the kernel panic?

Jorge

4 Likes

Hi Jorge, :wave:

thank you for your new post, Jorge.

Yes, quite right.

That´s some good calculation you did, Jorge. Thanks also for the link.

I see.
Well, bearing my specific hardware setup in mind - and willing to keep the two front usb-ports free (as I need them for the ventoy stick and the other external HDD whenever I make clonezilla backups) that would be a bit clumsy for daily use.
That´s the reason why I employed the hub in the first place. :wink:

I might do it for experimental reasons though. Thanks for the suggestion.

On the other hand that setup has been working flawlessly for years.
But who knows. Seems it´s not only me who´s geting older but the hardware as well… :neutral_face: .

No, actually not. There haven´t been any changes with regard to hardware/peripherals for a very long time now.

Thank you so much for your hard work on the subject, dear Jorge. :heart:

Many greetings from Rosika :slightly_smiling_face:

3 Likes

Hi Rosika,
You mentioned in this post that you keep having kernel panic problems.

I believe you should try connecting your Linux disk to your motherboard and not use it as a USB peripheral on a daily basis.
If you want, I’m willing to help you do it, if only for a test run.
We can talk by PM, email, WhatsApp, etc., but you know how limited my English is (maybe we can understand each other with a “Portuguese-English” language and a dictionary for some help :wink:).

I’m convinced that it’s essential to eliminate the use of your system disk via USB

Jorge

1 Like