Skip to main content
Topic: [SOLVED] Suspend to RAM while in the initial ramdisk stage of the boot process (Read 1124 times) previous topic - next topic
0 Members and 5 Guests are viewing this topic.

[SOLVED] Suspend to RAM while in the initial ramdisk stage of the boot process

Hello everyone.

The UEFI firmware of my laptop has a problem where if you do not put the laptop to sleep, you cannot access the internal storage device.

For example, to install Artix, I had to put the laptop to sleep ( suspend to ram ) and then wake it up to access my internal storage device to perform the installation.

After the installation, I encountered the same problem.

The UEFI firmware is able to detect my EFI bootloader ( I'm using grub ) and execute it, and my EFI bootloader is able to do the steps necessary to reach the initial ramdisk stage of the boot process.

However, my initial ramdisk environment is not able to detect the internal storage device due to the problem I mentioned above.

Now of course the solution would be to initiate sleep in this instance, and with the help of aldum in the Artix IRC channel, I know the command to do it would be:      echo mem > /sys/power/state

However, this is where the problem starts.

When I execute the above mentioned command, the screen fades to black, the power LED goes off for a second and then comes back up,  the laptop becomes unresponsive and the screen is completely black and remains black until you forcefully shut the laptop down

For reference, I tried the same command on an Artix live USB, and it worked completely fine, laptop went to sleep and I was able to wake it up.

Does anyone know how I can put the laptop to sleep in the initial ramdisk stage of the boot process and have it wake up normally?

Re: Suspend to RAM while in the initial ramdisk stage of the boot process

Reply #1
i think you may need to disable secure boot in the bios in order to install artix....
Cat Herders of Linux


Re: Suspend to RAM while in the initial ramdisk stage of the boot process

Reply #3
This is a weird problem. Are you sure this is UEFI that causes the issue and not hardware issues? Have you tried updating your UEFI firmware? BTW do you experience this issue with other distros or ever OSes? This is a bit weird, because your grub can somehow be executed, it can find its configuration, kernel and initramfs, it loads the stuff etc.

For reference, I tried the same command on an Artix live USB, and it worked completely fine, laptop went to sleep and I was able to wake it up.
I suppose, the reason for this is, Artix live USB doesn't mess up with mounting of your internal drive.

Does anyone know how I can put the laptop to sleep in the initial ramdisk stage of the boot process and have it wake up normally?
I think you need to add an initcpio hook which would execute the aforementioned command. It must be executed relatively early (before the disks and root filesystem initialization). Also, the acpi kernel module must be available at that early stage.

EDIT: But the problem is, how to tell the system to continue boot process after resuming from suspend (scratches his head). When you put your Artix live USB to sleep, the system is fully loaded and running at the 'default' runlevel of your init system of choice.

So, the answer would be, you may exploit special runlevels (like #4), transfer this parameter to the kernel via grub. On a 4th runlevel, the system would go to suspend early, and after resuming, it would switch to runlevel 2 (by executing init 2), and the normal init process would be executed. But this approach seems too complicated to me honestly...

Re: Suspend to RAM while in the initial ramdisk stage of the boot process

Reply #4
This is a weird problem. Are you sure this is UEFI that causes the issue and not hardware issues? Have you tried updating your UEFI firmware? BTW do you experience this issue with other distros or ever OSes? This is a bit weird, because your grub can somehow be executed, it can find its configuration, kernel and initramfs, it loads the stuff etc.

one thing I forgot to mention: my laptop is an Acer Aspire a315-56

>> This is a weird problem. Are you sure this is UEFI that causes the issue and not hardware issues?

Yes this is a firmware issue, as many other people have been having the same problem as me in their internal storage not showing up, whether it was an SSD or HDD

>> Have you tried updating your UEFI firmware?

Yes I probably should do that, but at the same time people have been having this issue as far back as version 1.17 of their firmware, and I'm on v1.22 and the latest is v1.26.

>> BTW do you experience this issue with other distros or ever OSes?

Yes, same story on Arch Linux

>> This is a bit weird, because your grub can somehow be executed, it can find its configuration, kernel and initramfs, it loads the stuff etc.

Yes it is sort of weird, I even went to the grub command line and it saw that grub could see my internal storage and its layout.



Ok, so I will try updating my firmware, and then I would come back here and report my progress, whether my problem was solved or not, Thank you for your help

Re: Suspend to RAM while in the initial ramdisk stage of the boot process

Reply #5
Just Wow.  You came to a forum seeking help to a problem knowing what the solution is and refusing to try it and then posted a query while choosing to hide all that initially and leaving us all to play a guessing game by not telling us anything even about your pc model or specs until after someone politely called it out?

Ok then.

Well, I'm glad someone got you back on track.
Cat Herders of Linux

Re: Suspend to RAM while in the initial ramdisk stage of the boot process

Reply #6
Just Wow.  You came to a forum seeking help to a problem knowing what the solution is and refusing to try it and then posted a query while choosing to hide all that initially and leaving us all to play a guessing game by not telling us anything even about your pc model or specs until after someone politely called it out?

Ok then.

Well, I'm glad someone got you back on track.

>> You came to a forum seeking help to a problem knowing what the solution is and refusing to try it

I wasn't sure the "solution" would work, because people have been having this problem as far back a few versions ago, and what do you know, updating to the latest firmware version did not magically fix the problem.

Also in my circumstances, installing windows 10 is not easy, and I wasted many hours yesterday just to get the damn thing installed to update my firmware.

>> while choosing to hide all that initially and leaving us all to play a guessing game by not telling us anything even about your pc model or specs until after someone politely called it out?

Nobody called it out, I forgot to mention it at first, and then corrected myself in the second post, and the very fact I chose to give the model of my laptop means I wasn't intentionally hiding it.

Also stop being dramatic, nobody played a guessing game, I stated my problem very clearly, and that problem will still persist whether or not you know the model name of my laptop.

But I admit, it was the fault on my part to not specify the model at the very beginning, I apologize.


>> Well, I'm glad someone got you back on track.

Good, because I surely wouldn't want someone as hostile and unknowledgeable ( you would think I would have disabled secure boot to be able to install Artix in the first place, right?  ) to give me help.
 


For anyone wondering about my progress, I am currently trying every combination of BIOS options to see if any of them solves my issue, will let you know what comes out of it, but as of right now, the problem is still present.

Re: Suspend to RAM while in the initial ramdisk stage of the boot process

Reply #7
Well, I exhausted all my BIOS options and the problem still didn't go away, the only solution I have is to somehow to put it to sleep in the initial ramdisk stage of the boot process.


I suppose, the reason for this is, Artix live USB doesn't mess up with mounting of your internal drive.
I think you need to add an initcpio hook which would execute the aforementioned command. It must be executed relatively early (before the disks and root filesystem initialization).

>> I suppose, the reason for this is, Artix live USB doesn't mess up with mounting of your internal drive.

I don't exactly understand what you are saying.

Artix live USB could not even see the internal disks unless I put the laptop to sleep and woke it up.

>> I think you need to add an initcpio hook which would execute the aforementioned command. It must be executed relatively early (before the disks and root filesystem initialization).

yes I think I should do that with the run_earlyhook menitioned in the arch wiki: https://wiki.archlinux.org/title/mkinitcpio

ok, I will try adding the sleep command as a very early hook, see if it fixes my problem

Re: Suspend to RAM while in the initial ramdisk stage of the boot process

Reply #8
Well gentlemen, after days of being stuck on this problem, I finally fixed the problem.

You essentially have to add an early runtime hook that runs a script before the filesystems get mounted.

This script must contain the command "echo mem >/sys/power/state" so that laptop goes to sleep and automatically wakes up and resumes the boot process.

I used the "run_hook" hook.

Special thanks to VictorBrand for initially suggesting this, I am marking this as solved.

I will also add a section specifically for this laptop model to the Arch wiki Acer page.

Re: [SOLVED] Suspend to RAM while in the initial ramdisk stage of the boot process

Reply #9
T
one thing I forgot to mention: my laptop is an Acer Aspire a315-56

>> This is a weird problem. Are you sure this is UEFI that causes the issue and not hardware issues?

Yes this is a firmware issue, as many other people have been having the same problem as me in their internal storage not showing up, whether it was an SSD or HDD

>> Have you tried updating your UEFI firmware?

Yes I probably should do that, but at the same time people have been having this issue as far back as version 1.17 of their firmware, and I'm on v1.22 and the latest is v1.26.

>> BTW do you experience this issue with other distros or ever OSes?

Yes, same story on Arch Linux

>> This is a bit weird, because your grub can somehow be executed, it can find its configuration, kernel and initramfs, it loads the stuff etc.

Yes it is sort of weird, I even went to the grub command line and it saw that grub could see my internal storage and its layout.



Ok, so I will try updating my firmware, and then I would come back here and report my progress, whether my problem was solved or not, Thank you for your help


The only thing that can be assumed from your OP is that you have told us almost nothing.  Trying to work around not disabling the  secure boot is the first most likely cause given the amount of info you provided, which is scant little, given that many people who come to linux start out not knowing anything about anything.

rather than engaging in personal attacks on people trying to help you, be grateful that the person who did help you was gracious enough to do so in spite of the huge lack of info and that they were still willing to help you in spite of hiding the fact that you knew the solution and hadn't yet tried it.  The person who did that is very gracious to have helped you as they did.  That should be your takeaway really.

Have a wonderful day.
Cat Herders of Linux

Re: [SOLVED] Suspend to RAM while in the initial ramdisk stage of the boot process

Reply #10
I am thankful of VictorBrand, however definitely not you.

I already gave you a response and since apparently you can't be bothered to read, I'm not going to repeat myself.

Have a good day.