Hibernating to one swap volume works, but other fails to resume sometimes
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Hibernating to one swap volume works, but other fails to resume sometimes

    Hi all, not sure if this belongs here or on a stackoverflow site somewhere. I'm running Fedora 29 on a fairly normal tower home PC, dual booting with Windows 10, with 3 physical drives installed. I have two swap partitions, and can configure the system to hibernate to either one. When I configure it with the smaller drive that's on the same physical drive as my linux partitions, resume is reliable, but when I use the much larger swap partition on the same physical drive as windows, resume *sometimes* works, but sometimes fails.

    When it fails, I see this in /var/log/messages on resume:

    Code:
    Apr  5 17:19:40 uberneek systemd[1]: Mounting Kernel Configuration File System...
    Apr  5 17:19:40 uberneek systemd[1]: Mounted Kernel Configuration File System.
    Apr  5 17:19:40 uberneek kernel: audit: type=1130 audit(1554459580.194:4): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-udev-trigger comm="systemd" 
    exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
    Apr  5 17:19:40 uberneek audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-udev-trigger comm="systemd" exe="/usr/lib/systemd/syst
    emd" hostname=? addr=? terminal=? res=success'
    Apr  5 17:19:40 uberneek systemd[1]: Started udev Coldplug all Devices.
    Apr  5 17:19:40 uberneek systemd[1]: Starting dracut initqueue hook...
    Apr  5 17:19:40 uberneek systemd[1]: Starting Show Plymouth Boot Screen...
    Apr  5 17:19:40 uberneek systemd[1]: Received SIGRTMIN+20 from PID 451 (plymouthd).
    Apr  5 17:19:40 uberneek systemd[1]: Started Show Plymouth Boot Screen.
    Apr  5 17:19:40 uberneek audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=plymouth-start comm="systemd" exe="/usr/lib/systemd/systemd" h
    ostname=? addr=? terminal=? res=success'
    Apr  5 17:19:40 uberneek systemd[1]: Started Forward Password Requests to Plymouth Directory Watch.
    Apr  5 17:19:40 uberneek kernel: audit: type=1130 audit(1554459580.212:5): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=plymouth-start comm="systemd" exe="/
    usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
    Apr  5 17:19:40 uberneek systemd[1]: Reached target Paths.
    Apr  5 17:19:40 uberneek kernel: atl1c 0000:03:00.0: version 1.0.1.1-NAPI
    Apr  5 17:19:40 uberneek systemd-udevd[461]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
    Apr  5 17:19:40 uberneek systemd-udevd[448]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
    Apr  5 17:19:40 uberneek kernel: atl1c 0000:03:00.0 enp3s0: renamed from eth0
    Apr  5 17:19:40 uberneek systemd[1]: Found device INTEL_SSDSC2KW512G8 2.
    Apr  5 17:19:40 uberneek systemd[1]: Found device KINGSTON_SV300S37A240G 5.
    Apr  5 17:19:40 uberneek systemd[1]: Reached target Initrd Root Device.
    Apr  5 17:19:40 uberneek systemd[1]: Starting Resume from hibernation using device /dev/sda2...
    Apr  5 17:19:40 uberneek systemd-hibernate-resume[473]: Could not resume from '/dev/sda2' (8:2).
    Apr  5 17:19:40 uberneek systemd[1]: Started Resume from hibernation using device /dev/sda2.
    Apr  5 17:19:40 uberneek audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-hibernate-resume@dev-sda2 comm="systemd" exe="/usr/lib
    /systemd/systemd" hostname=? addr=? terminal=? res=success'
    Apr  5 17:19:40 uberneek audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-hibernate-resume@dev-sda2 comm="systemd" exe="/usr/lib/
    systemd/systemd" hostname=? addr=? terminal=? res=success'
    Apr  5 17:19:40 uberneek systemd[1]: Reached target Local File Systems (Pre).
    Apr  5 17:19:40 uberneek systemd[1]: Reached target Local File Systems.
    Apr  5 17:19:40 uberneek kernel: audit: type=1130 audit(1554459580.337:6): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-hibernate-resume@dev-sda2 co
    mm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
    Apr  5 17:19:40 uberneek kernel: audit: type=1131 audit(1554459580.337:7): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-hibernate-resume@dev-sda2 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
    Apr  5 17:19:40 uberneek systemd[1]: Starting Create Volatile Files and Directories...
    Apr  5 17:19:40 uberneek systemd[1]: Started Create Volatile Files and Directories.
    Apr  5 17:19:40 uberneek audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-tmpfiles-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
    Apr  5 17:19:40 uberneek systemd[1]: Reached target System Initialization.
    The important bit seems to be "systemd-hibernate-resume[473]: Could not resume from '/dev/sda2' (8:2)."

    I have seen other threads with messages like "PM: Image not found (code -22)" or "PM: Hibernation image not present or could not be loaded." but I am not seeing these.

    My system info:

    Code:
    # uname -a
    Linux uberneek.localdomain 5.0.3-200.fc29.x86_64 #1 SMP Tue Mar 19 15:07:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
    
    # free -m
                  total        used        free      shared  buff/cache   available
    Mem:          15996        3173        7955         395        4868       12099
    Swap:         75348           0       75348
    
    # lsblk -f
    NAME   FSTYPE LABEL     UUID                                 MOUNTPOINT
    sda                                                          
    ├─sda1 ntfs             42D06C34D06C2FF9                     
    └─sda2 swap             fc8739f2-6a9b-4a87-9842-695f5f9f7895 [SWAP]
    sdb                                                          
    ├─sdb1 ext4             876b9629-8c0f-435b-a2fb-a63606909a82 /boot
    ├─sdb2 ext4             9909d0b7-da24-4023-84bd-efc832bf4d3c /home
    ├─sdb3 swap             d8e902c1-f652-4a27-9d68-f489f6399a13 [SWAP]
    ├─sdb4                                                       
    └─sdb5 ext4             9c74648d-d941-47a4-a5a8-86a15fff1411 /
    sdc                                                          
    ├─sdc1                                                       
    └─sdc2 ntfs   2Tb_Space 8236C24836C23D43      
    
    # swapon -s
    Filename                                Type            Size    Used    Priority
    /dev/sda2                               partition       69014524        0      -3
    /dev/sdb3                               partition       8142844 0       -2
    
    # dmidecode
    [..cut.. just the BIOS bit ..]
    Handle 0x0000, DMI type 0, 24 bytes
    BIOS Information
            Vendor: American Megatrends Inc.
            Version: F8e
            Release Date: 11/21/2012
            Address: 0xF0000
            Runtime Size: 64 kB
            ROM Size: 8192 kB
            Characteristics:
                    PCI is supported
                    BIOS is upgradeable
                    BIOS shadowing is allowed
                    Boot from CD is supported
                    Selectable boot is supported
                    BIOS ROM is socketed
                    EDD is supported
                    5.25"/1.2 MB floppy services are supported (int 13h)
                    3.5"/720 kB floppy services are supported (int 13h)
                    3.5"/2.88 MB floppy services are supported (int 13h)
                    Print screen service is supported (int 5h)
                    8042 keyboard services are supported (int 9h)
                    Serial services are supported (int 14h)
                    Printer services are supported (int 17h)
                    ACPI is supported
                    USB legacy is supported
                    BIOS boot specification is supported
                    Targeted content distribution is supported
                    UEFI is supported
            BIOS Revision: 4.6
    So I have /dev/sda, where I have my Windows 10 partition and a large 70Gb swap partition, and /dev/sdb where I have all Linux partitions (root, home etc) and a smaller 7.8Gb swap partition.

    I followed https://robbinespu.github.io/eng/201...hibernate.html as a guide to how to configure the system to use a specific swap partition for hibernation. I have quite an old non-EFI bios

    When I configure /dev/sdb3 as the hibernate partition, I have to close down most applications to get the system to hibernate, because there isn't enough space in the swap partition for all the RAM it's trying to hibernate. After closing Thunderbird, Firefox, Skype etc. etc. it will hibernate, and resume very reliably. However this is annoying and I am trying to switch to using /dev/sda2 instead.

    When I configure /dev/sda2 as the hibernate partition, it hibernates as soon as requested, as there is plenty of space on the partition, but resuming is hit and miss. I haven't noticed a pattern to when it succeeds or fails.

    My first thought was that when I hibernate and boot into Windows, Windows is somehow corrupting the /dev/sda2 partition data, which would cause the resume to fail, however there are no messages like "Hibernation image not present or could not be loaded." and besides, Windows isn't aware of that partition, it's a Linux swap formatted partition, so it should ignore it, right? Also since resuming works fine sometimes, this does not sound like a reliable theory.

    I have tried making /dev/sda2 the 'first' swap partition, to see if this would help. Initially it appeared second in the 'swapon -s' output, and I thought perhaps its swap priority made it unreliable somehow, but changing the priorities did not help.

    I'm on the verge of resizing partitions on /dev/sdb so that I can expand /dev/sdb3 but it's risky and I'd really like to get /dev/sda2 working since I have so much extra space available there.

    What can I do to inspect or improve the use of /dev/sda2 to figure out why resume fails?

  2. #2
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,868
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Hibernating to one swap volume works, but other fails to resume sometimes

    I run swap partition size as 8gigs (I have 16gigs of ram). My resume partition is the same size, on the same drive. I can do hibernate.
    For what it is worth, I have swappiness set to 10 # 10percent ram free would cause swapping to occur

    What is your system ram size? If you have 8gigs ram, the rule was 1-1 or 8 gigs swap and 8gigs resume=xxx. At 16 gigs ram, usually a 10 to 12 gig resume=swapfile should be enough.

    70 gigs for a resume=swapfile is way to excessive in my view.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  3. #3
    Join Date
    Aug 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Hibernating to one swap volume works, but other fails to resume sometimes

    Hi Isatenstein, thank you for the reply. You are right, 70Gb is excessive, I just had the space available and decided to go a bit crazy I had trouble with my 8Gb swap for some time and had a chance when installing a new drive a few months ago to try a different configuration. I have 16Gb RAM in the machine (as seen in the 'free -m' output I provided) so I quadrupled the RAM and then added a bit more.

    My main response to your comment is that you cannot assume the swap parititon required to hibernate with 16 gigs of ram can be much less than 16 gigs of storage, especially if you have any actual swap partition in use, because the amount of used memory (both physical ram and swap) may exceed the amount of physical ram you have. It's possible it will fit but there is a chance your total used memory will be too much for the available hibernation partition.

    I'm surprised you can hibernate OK on your setup, with 8 gigs swap and 16 gigs RAM you can theoretically have up to 24Gb data in memory, and when you hibernate everything has to be able to fit onto the swap partition. My swappiness is set to 30 but regardless of that, when I'm developing software with 2 or 3 browsers running, dev environment, databases, database client, email, Skype, etc I easily have 20Gb allocated, I have 11Gb ram and 9Gb swap in use as I type this. This is simply the space required for the apps I have running, I have the same situation when just the 8Gb swap partition active, and then of course it all cannot fit on my 8Gb swap partition for hibernation.

    I'd be interested to see your 'free -m' output.. is the 'used' total of the Mem and Swap lines less than your swap partition size of 8Gb? Of course it might not be as simple as I make out but this is the general way I think things work
    Last edited by neekfenwick; 9th April 2019 at 05:42 AM. Reason: Edit for grammar and clarity.

  4. #4
    Join Date
    Aug 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Hibernating to one swap volume works, but other fails to resume sometimes

    I may have noticed a pattern.. it might be when I 'dnf update' the system and it installs a new kernel version, then if I try to hibernate and resume later, the resume fails.

    I had the same issue this morning, resume brought up a fresh desktop losing all my apps from yesterday, but I know that on 10 April (2 days ago) I updated to kernel 5.0.6-200 and that night I slept the machine, not hibernated. Last night I hibernated to do some gaming in Windows, and this morning resume from hibernate failed. From rough memory, the times resume succeeds are times I haven't updated the kernel since booting fresh.

    This doesn't make a lot of sense to me, as the kernel version was the same between hibernate and resume (of course) so I see no reason it would fail, but maybe it's a pattern that can predict the failure, so I can avoid losing data better. I'll see if this guess proves true.

  5. #5
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,868
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Hibernating to one swap volume works, but other fails to resume sometimes

    Quote Originally Posted by lsatenstein
    I run swap partition size as 8gigs (I have 16gigs of ram). My resume partition is the same size, on the same drive. I can do hibernate.
    For what it is worth, I have swappiness set to 10 # 10percent ram free would cause swapping to occur

    What is your system ram size? If you have 8gigs ram, the rule was 1-1 or 8 gigs swap and 8gigs resume=xxx. At 16 gigs ram, usually a 10 to 12 gig resume=swapfile should be enough.

    70 gigs for a resume=swapfile is way to excessive in my view.
    I don't run much at any time. With system monitor, my swap use was zero. I run a few compiles, some downloads, I do some web browsing, and that's it.
    In my case 4 gigs would be sufficient for my needs.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

Similar Threads

  1. Grub, swap file and resume
    By Eric F in forum Using Fedora
    Replies: 3
    Last Post: 25th April 2016, 05:23 AM
  2. swap logical volume vs. a non-LVM2 swap
    By jenaniston in forum Using Fedora
    Replies: 10
    Last Post: 22nd January 2013, 12:47 AM
  3. resume does not find swap partition
    By roebel in forum Using Fedora
    Replies: 0
    Last Post: 16th November 2008, 03:24 PM
  4. Will not resume from hibernate after creating swap
    By compuboy04 in forum Hardware & Laptops
    Replies: 0
    Last Post: 1st August 2007, 05:40 AM
  5. Replies: 8
    Last Post: 15th January 2005, 12:47 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •