SD card not detected during early boot from hibernation

My laptop has a built in SD card adapter, which is unfortunately the only way to extend its storage as it does not have SATA or M.2 connectors inside.

I wanted to set up hibernation with a fast 128 GB SD card that I have been using with the laptop for 2 years. I have a 10 GB swap partition on the card, which I set up in fstab, and is generally working fine. I also added the resume=UUID=xxxxkernel parameter to GRUB with the UUID of the swap partition, and /proc/cmdline confirms that linux knows about it.

When I first tried to hibernate, it went down as expected, but it did not even try to resume. On my PC where I hibernate to SSD, while resuming the log stops at a systemd line from which I recognize that its loading back the hibernation state. But not here.
Logs according to sudo journalctl --bootalso do not have any lines containing “resume” other than those including the kernel parameters.

Then I added resumedelay=10, updated grub and rebooted, and now when resuming from hibernation the same thing happens but with a 10 second delay at a certain point in the boot process, and nothing about it in the logs. From that what I suspect is that early boot does not detect the SD card or the filesystems on it.
But I dont know how to figure out why is that. Could you please help in figuring this out?


The fstab entry:

UUID=77954a31-5af4-4a5b-828b-e95796f2deb4   none        swap defaults,auto    0 0

lsblk showing the device name and UUID:

MODEL          NAME         LABEL  PATH                SIZE FSSIZE FSTYPE     MOUNTPOIN UUID                                 PARTUUID
STORAGE DEVICE sda                 /dev/sda          116,1G                                                                  
               ├─sda1              /dev/sda1            10G        swap       [SWAP]    77954a31-5af4-4a5b-828b-e95796f2deb4 3327a387-01
               └─sda2       sdpool /dev/sda2         106,1G        zfs_member           7531262699245233092                  3327a387-02

/proc/cmdline:

BOOT_IMAGE=/boot/vmlinuz-6.4.0-150600.21-default root=UUID=a9f5b3dd-55ed-4b94-980a-1fdc61c5b09b splash=verbose preempt=full quiet security=apparmor zswap.enabled=1 zswap.compressor=lz4 zswap.max_pool_percent=30 zswap.zpool=zsmalloc delayacct i915.dmc_firmware_path= mitigations=auto resume=UUID=77954a31-5af4-4a5b-828b-e95796f2deb4 resumedelay=10

My laptop is a lenovo 500e chromebook 2nd gen, with 8 GB RAM and soldered MMC main storage.

The SD card reader shows up both in lsusb and lspci:

sudo lspci
[...]
00:1c.0 SD Host controller: Intel Corporation Celeron/Pentium Silver Processor SDA Standard Compliant SD Host Controller (rev 06)
[...]

sudo lsusb
Bus 002 Device 002: ID 05e3:0747 Genesys Logic, Inc. USB Storage
[...]

Hi, maybe you have to edit your thread title like this.
"SD card not detected during early boot from hibernation".
Just saying because you were able to boot the OS and in the wake up from hibernation that’s when you suspect that it was not detected.

Did you wait for a while when it boot after hibernation. Here I just tried it and it takes longer to have the gui coming from hibernation. One of the reason I don’t use this feature. I rather shutdown because it is faster to boot when I want to use it.

On a side: Are you using nvidia gpu?

thanks! but it seems I’m not permitted to change the title anymore.

Did you wait for a while when it boot after hibernation. Here I just tried it and it takes longer to have the gui coming from hibernation.

currently I cannot resume hibernation on this laptop. but the reason to hibernate is not to boot faster, but to sleep with lower power consumption. suspend to ram does not work reliably when swap on this SD card is being utilized because of a race condition, and I need to use simple s2idle/freeze for sleeping when I dont have enough memory to turn off the swap partition.
to be more precise, for some reason sometimes the sd card comes up too late, when the processes are already thawed and running, and processes that need to access swapped memory crash. This does not happen always, but there is a chance for it.

I am using the integrated graphics of my intel cpu. this laptop does not have dedicated graphics.

I can and did.

2 Likes

Thanks!

It seems pm_debug_messages does not turn on messages that are logged with pm_pr_dbg (like here), but I have found that the 10 second wait induced by resumedelay=10 is seemingly happening before devices are discovered. In the logs I see that PCI, USB and SCSI device discovery is logged later on in the following seconds.

Is this how thats supposed to work? Is that delay only to give time for slow hardware to initialize itself?

Hi, It could be cause by reading the swap in the SSD connected thru usb that it’s taking too long. I have a SSD here with openSUSE tumbleweed in SSD connected via sata to usb and I find it to take longer time to boot but once it is booted it start to process faster a bit. Try waiting a bit longer maybe 2,3, or more minutes if the swap drive will kick in. I timed my hibernation here and it took more than 2 minutes to wakeup, the swap is in the main drive.

I did not reset the computer because it took long to boot. The problem was that it was totally ignoring the swap partition, as if it did not exist. When booting, instead of resuming it just booted a new system from zero.

But it seems I have figured out the problem. I did not have the “resume” dracut module enabled… I dont know if its supposed to be enabled automatically, but I made new file /etc/dracut.conf.d/99-resume.conf, and put this into it:

add_dracutmodules+=" resume "

(note the spaces around the resume word)

After that I regenerated the initramfs:

sudo dracut -f

And now resuming works as expected. In the verbose boot log I enabled it can be seen when it reaches the task to load the resume data to memory, and then after some time the lock screen just appears as expected.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.