Hibernate with Samsung 870 EVO SSD

Hi!

I just installed a new 1 TB Samsung 870 EVO SSD in a Thinkpad X120e laptop and installed openSUSE Leap 15.2 on it.

I wonder whether anyone has any experience with openSUSE 15.2 on the Samsung 870 EVO SSD concerning hibernating. After installation and a couple of clean reboots, I clicked on "Sleep" in the display manager (SSDM). The screen went blank and the power button kept blinking for a few minutes. I had to press the power button for more than 10 seconds to reboot and even then the laptop would not start properly and I had to press the power button again for 10 seconds after which it finally booted properly. I normally don't use "Sleep" (suspend to RAM) anyway, but I do often use "Hibernate" (suspend to disk), but because of my bad experience with "Sleep" I am nervous trying out hibernating. My questions are:

1) Does anybody have experience hibernating with Samsung 870 EVO SSD and openSUSE 15.2?

2) Is there any way that I can perform a "safe" hibernate, i.e., turn off features that may cause problems?

3) What is the best way to troubleshoot sleep/hibernate problems, i.e., where do I find log files and what configuration files can I tweak?

I normally use TDE as my desktop environment although I have not tried hibernating from TDE. My attempt to use "Sleep" was from the SSDM (KDE/plasma default) display manager.

Any help would be greatly appreciated.

Thanks!

Comments

  • AndreasAndreas Senior Member
    edited June 28

    "Sleep" means "Suspend To RAM. Correct behavior from a thinkpad laptop.
    https://en.opensuse.org/SDB:Suspend_to_RAM
    1.) Ask this question here: https://forums.opensuse.org/
    2.) You should enable UEFI Secure Boot. See:
    https://forums.suse.com/discussion/14400/extend-root-partition#latest
    and
    $ man kernel_lockdown
    https://man7.org/linux/man-pages/man7/kernel_lockdown.7.html
    UEFI Secure Boot will disable hibernation.
    3.) Read this: https://www.kernel.org/doc/html/latest/power/basic-pm-debugging.html

  • edited June 30

    Thanks for the comment. I tested hibernating using the command:

    systemctl hibernate

    after logging in as root from a virtual console. Hibernation failed and I had to reboot by pressing the power button for 20 seconds. I also noticed that I get error messages related to the SSD such as:

    Jun 30 10:30:51 demetra kernel: ata1.00: exception Emask 0x0 SAct 0x9fffffff SErr 0>
    Jun 30 10:30:51 demetra kernel: ata1.00: irq_stat 0x40000009
    Jun 30 10:30:51 demetra kernel: ata1: SError: { CommWake 10B8B }
    Jun 30 10:30:51 demetra kernel: ata1.00: failed command: READ FPDMA QUEUED
    Jun 30 10:30:51 demetra kernel: ata1.00: cmd 60/08:10:e0:2b:30/00:00:02:00:00/40 ta>
                                             res 41/84:08:18:2b:30/00:00:02:00:00/00 Em>
    Jun 30 10:30:51 demetra kernel: ata1.00: status: { DRDY ERR }
    Jun 30 10:30:51 demetra kernel: ata1.00: error: { ICRC ABRT }
    

    After reading in the following thread that Samsung 800 series EVO SSDs can have problems with the AMD chipset in my laptop:

    https://forums.unraid.net/topic/102160-solved-failed-command-read-fpdma-queued-bad-new-ssd/

    I decided that it may be wise to replace the SDD with a mechanical hard drive such as this one:

    https://shop.westerndigital.com/products/internal-drives/wd-black-mobile-sata-hdd#WD10SPSX

    Are there any potential compatibility issues in Linux between this WD hard disk and the AMD E-350 chipset present in my Thinkpad X120e laptop?

    Thanks!

  • malcolmlewismalcolmlewis Knowledge Partner

    @Gianluca Hi, I've had no issues with WDC SSD's, get a 500GB one for same price as the 1TB HDD?

  • Hi malcolmlewis,

    Have you tested the WDC SSD with a AMD E-350 chipset? I don't want to risk spending time (and money) on another SSD. Maybe in the future with a different system.

  • malcolmlewismalcolmlewis Knowledge Partner

    @Gianluca Hi, not specifically, but have steered well clear of Samsung devices due to the blacklisting of models (See kernel libata.c).... I've used OCZ, Crucial, WDC and SanDisk SSD's, WDC and Silicon Power NVME's across numerous Laptops and Desktop systems. The only issue I have was with the WDC NVME device in a HP Z440 due to the SSD controller, it works fine in another system with and Intel board.

  • edited July 1

    Hi malcolmlewis,

    The only issue I have was with the WDC NVME device in a HP Z440 due to the SSD controller, it works fine in another system with an Intel board.

    That makes me a bit anxious about using a WDC SSD (even if not NVME) with such an old AMD chipset, especially since I like to use the hibernate feature. Have you used the WDC SSD drives with the hibernate feature?

  • AndreasAndreas Senior Member
    edited July 1

    Your old AMD chipset has buggy NCQ support. And any modern hard disc or SSD is NCQ capable.
    https://en.wikipedia.org/wiki/Native_Command_Queuing
    You should disable NCQ in BIOS or in Linux kernel. Check for BIOS and firmware updates for your laptop.
    https://www.itechlounge.net/2013/07/linux-ata-failed-command-read-fpdma-queued/
    https://bbs.archlinux.org/viewtopic.php?id=267211
    All SAMSUNG SSD 8xx series are already black listed for "NCQ TRIM":
    https://forums.suse.com/discussion/comment/39846#Comment_39846
    https://www.algolia.com/blog/engineering/when-solid-state-drives-are-not-that-solid/
    First SSD? Yes:
    https://forums.suse.com/discussion/comment/53818

  • edited July 1

    Hi Andreas,

    Are you saying that:

    1) I will have problems even with a HDD?
    2) If I disable NCQ I should no longer have problems with this Samsung SSD?

  • edited July 1

    I have disabled NCQ by adding

    libata.force=noncq

    to the kernel parameters. Now

    cat /sys/block/sdX/device/queue_depth

    returns 1.

    I no longer get the ata1 READ FPDMA QUEUED errors.

    Do you think that hibernate may work now?

  • Not sure whether this message is a problem for hibernate/suspend:

    [ 11.373287] ACPI Warning: SystemIO range 0x0000000000000B00-0x0000000000000B08 co
    nflicts with OpRegion 0x0000000000000B00-0x0000000000000B0F (_SB.PCI0.SMB.SMB0) (20
    190703/utaddress-213)
    [ 11.373305] ACPI: If an ACPI driver is available for this device, you should use
    it instead of the native driver

  • I no longer get errors related to ATA. However, I tried hibernating using the command:

    systemctl hibernate

    but it fails as described above. dmesg shows the following error message:

    [   11.818285] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked
    [   11.891346] ACPI: \_SB_.PCI0.LPC0.EC__.HKEY: BCTG evaluated but flagged as error
    [   11.891351] thinkpad_acpi: Error probing battery 2
    [   11.894826] battery: extension failed to load: ThinkPad Battery Extension
    [   11.894833] battery: extension unregistered: ThinkPad Battery Extension
    [   11.936703] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/inpu
    t/input16
    

    Is there anything I can change to solve this?

  • I'm going to try out the following suggestions Andreas gave me earlier to troubleshoot hibernation:

    https://www.kernel.org/doc/html/latest/power/basic-pm-debugging.html

  • AndreasAndreas Senior Member
    edited July 2
  • edited July 2

    Hi Andreas,

    Please let me say first: Thank so much for helping me out with this! I totally appreciate getting help from this forum (and forums in general where people help each other out).

    Now you have issues with ACPI which blocks a change to state "ACPI S4" (hibernation).

    Do you think this is unrelated to the Samsung SSD? I was getting the thinkpad_acpi error messages also before turning off NCQ.

    Nonetheless, I came a step closer to fixing the hibernation issue:

    I logged in as root in a virtual console and following the link that you sent me:

    https://www.kernel.org/doc/html/latest/power/basic-pm-debugging.html

    I typed:

    echo shutdown > /sys/power/disk
    echo disk > /sys/power/state

    The system hibernated and the power was turned off. I then pressed the power button to turn it back on. Strangely, the GRUB screen came up. I hit <ENTER> and the system resumed from hibernation and returned to the same state as before hibernating. Hibernation seems to work.

    I remember from the old installation with openSUSE 11.4 that I also had to switch to "shutdown" as hibernation mode. So this is consistent. Is this now permanent?

    /home/gianluca> cat /sys/power/disk
    platform [shutdown] reboot suspend test_resume
    

    Since "[shutdown]" is in square brackets it would seem that it is.

    However, there are still some issues:

    systemctl hibernate

    does not work. The same thing as before happens: screen goes blank and power button LED blinks. Does systemctl hibernate also read the file /sys/power/disk and chooses "shutdown" instead of "platform"?

    Thanks!

  • I see that systemd overwrites /sys/power/disk

    cat /sys/power/disk
    [platform] shutdown reboot suspend test_resume
    

    This link:

    https://superuser.com/questions/1442634/systemctl-hibernate-and-reboot

    describes that you can modify the content of /etc/systemd/sleep.conf, but there is no such file in my current system. Can I just create it and will systemd read it?

  • malcolmlewismalcolmlewis Knowledge Partner

    @Gianluca Hi, have a look at the man page man 5 systemd-sleep.conf

    I suspect you want;

    AllowHibernation=yes
    HibernateMode=shutdown
    HibernateState=disk
    
  • AndreasAndreas Senior Member
    edited July 2

    And
    $ man systemd-suspend.service
    $ more /etc/systemd/sleep.conf
    # This file is part of systemd.
    #
    # systemd is free software; you can redistribute it and/or modify it
    # under the terms of the GNU Lesser General Public License as published by
    # the Free Software Foundation; either version 2.1 of the License, or
    # (at your option) any later version.
    #
    # Entries in this file show the compile time defaults.
    # You can change settings by editing this file.
    # Defaults can be restored by simply deleting this file.
    #
    # See systemd-sleep.conf(5) for details
    [Sleep]
    #AllowSuspend=yes
    #AllowHibernation=yes
    #AllowSuspendThenHibernate=yes
    #AllowHybridSleep=yes
    #SuspendMode=
    #SuspendState=mem standby freeze
    #HibernateMode=platform shutdown
    #HibernateState=disk
    #HybridSleepMode=suspend platform shutdown
    #HybridSleepState=disk
    #HibernateDelaySec=180min

    $ rpm -qf /etc/systemd/sleep.conf
    systemd-246.13-5.1.x86_64

  • AndreasAndreas Senior Member

    Don't forget UPower configuration:
    https://forums.suse.com/discussion/comment/52865

  • Interestingly /etc/systemd/sleep.conf is not present in my system. I guess I will have to create it manually.

    /home/gianluca> rpm -qf /etc/systemd/sleep.conf
    error: file /etc/systemd/sleep.conf: No such file or directory
    /home/gianluca> rpm -qa | grep systemd
    util-linux-systemd-2.33.1-lp152.5.6.1.x86_64
    systemd-bash-completion-234-lp152.31.25.1.noarch
    systemd-sysvinit-234-lp152.31.25.1.x86_64
    systemd-234-lp152.31.25.1.x86_64
    systemd-icon-branding-openSUSE-15.2.20200203-lp152.1.5.noarch
    grub2-systemd-sleep-plugin-2.04-lp152.7.28.1.noarch
    systemd-presets-common-SUSE-15-lp152.9.6.1.noarch
    libsystemd0-234-lp152.31.25.1.x86_64
    systemd-presets-branding-openSUSE-12.2-lp152.14.2.noarch
    
  • Thank you so much Andreas!

    I copy-pasted the sleep.conf file that you posted and set only:

    HibernateMode=shutdown

    Now hibernation works with systemctl hibernate.

    The difference between using systemctl and echo disk > /sys/power/state is that with the former resuming bypasses GRUB. However, I do not get a nice splash screen as it was the case in the past, just a blank screen with a blinking cursor at the top, no progress bar or percentage written.

  • edited July 3

    I wonder whether I can also fix the problem with "suspend to RAM". The are some options in the sleep.conf file in this regard:

    #SuspendMode=
    #SuspendState=mem standby freeze
    

    I understand that if a line is commented out then the default is used. But I can't figure out which of the three is the default, "mem", "standby" or "freeze"? I just know that the default does not work.

    I have not tried yet hibernating from the display manager SDDM. I can type as root from a console in the Trinity Desktop Environment systemctl hibernate and that works, too!

    An interesting fact is also that this laptop came pre-installed with Windows 7 and I can't remember whether it was hibernate or suspend to RAM that where disabled, or both. In an older installation with openSUSE 11.4 and the OEM mechanical drive I was able to do both, hibernate and suspend to RAM, but the latter would often not resume and I was left with a blank screen.

  • AndreasAndreas Senior Member
    edited July 3

    You should configure and test power saving routines for every day usage. I prefer:

    Remark: X11 is not secure. Wayland provide better security.
    https://blog.martin-graesslin.com/blog/2015/11/looking-at-the-security-of-plasmawayland/
    https://en.wikipedia.org/wiki/Wayland_(display_server_protocol)
    https://wiki.debian.org/Wayland#Desktops

  • edited July 8

    Thanks Andreas!

    Hibernate now works. Suspend to RAM does not always work, sometimes the laptop hangs. It does not bother me too much since suspend to RAM has never really worked that well on this laptop (even with the OEM mechanical drive).

    I get the following warning messages (not sure whether they have anything to do with suspend to RAM):

    [ 1753.267312] ata1.00: supports DRM functions and may not be fully accessible
    [ 1753.269812] ata1.00: supports DRM functions and may not be fully accessible

    I wonder whether these warning messages only occur because of the combination between the AMD chipset and the Samsung SSD or is it generally a problem between Linux and the Samsung 8xx EVO series? I ask because I am considering adding a SSD to an older desktop PC with an Intel Pentium D CPU.

    Thanks!

Sign In or Register to comment.