Hibernate command results in reboot

I set my computer ( a Dell Dimension 9150, Nvidia graphics card, running non-proprietary drivers) to hibernate after 2 hrs inattention,
Every time it initiates a hibernation it simply reboots.

Check the basics first…

Swap space configured?

cat /proc/cmdline

How much swap space is there?

cat /proc/swaps

There should be an appropriate ‘resume=’ entry.

sam@linux:~> cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.4.114-42-default root=UUID=a0fdab26-1fe7-488a-82cf-0f4ddd1e29e8 resume=/dev/sda5 splash=silent quiet showopts

sam@linux:~> cat /proc/swaps
Filename Type Size Used Priority
/dev/sda5 partition 2102268 0 -1

Ok, and is swap big enough? How much RAM in the system?

free -m

sam@linux:~> free -m
total used free shared buffers cached
Mem: 3510 3163 347 26 0 2174
-/+ buffers/cache: 988 2521
Swap: 2052 0 2052

Not enough swap for the RAM you have. Hibernation will never succeed. It needs to be doubled in size.

This can also be used for a quick check…

# cat /proc/meminfo|grep -i total

Some more advice on this here:
https://itsfoss.com/swap-size/
*See the Ubuntu reasoning (with hibernation) as well.

So I created a flat swapfile of 5 gig in /home.
on execution of

“swapon /home/swap/swapfile”

I get a result of

“linux:/home/sam # swapon /home/swap/swapfile
swapon: /home/swap/swapfile: insecure permissions 0644, 0600 suggested.
swapon: /home/swap/swapfile: read swap header failed”

I don’t know why you’re trying to use a swap file instead. Is it not possible for you to use gparted to repartition for a larger swap partition? Apart from the permissions that need adjusting, some additional steps are required to use such a swap file for hibernation purposes. I don’t have direct experience with this, so you’ll need to do some reading…

http://vadim-kirilchuk-linux.blogspot.co.nz/2013/05/swap-file-for-hibernation.html

According to the web, XFS cannot be resized no matter what tool you use!
So… I deleted the /home partition and resized the swap to 10 gigs, then recreated the /home partition as ext4.

Still no joy the system reboots when attempting to hibernate.

Show us with definitive output please…

cat /proc/meminfo|grep Total
sudo /usr/sbin/blkid
cat /proc/cmdline

sam@linux:~> cat /proc/meminfo|grep Total
MemTotal: 3594708 kB
SwapTotal: 10481660 kB
VmallocTotal: 34359738367 kB
HugePages_Total: 0

sam@linux:~> sudo /usr/sbin/blkid
/dev/sda1: SEC_TYPE=“msdos” LABEL=“DellUtility” UUID=“07D6-0509” TYPE=“vfat” PARTUUID=“e686f016-01”
/dev/sda2: UUID=“0AA61CC1A61CAF67” TYPE=“ntfs” PARTUUID=“e686f016-02”
/dev/sda3: LABEL=“DellRestore” TYPE=“vfat” PARTUUID=“e686f016-03”
/dev/sda5: UUID=“688fde5a-91a6-44d4-89f8-3636b671262b” UUID_SUB=“909654ee-ae71-4a4b-a9c5-87a9c28b893c” TYPE=“btrfs” PARTUUID=“e686f016-05”
/dev/sda6: UUID=“9889502d-37b5-4655-827a-914aad3a6848” TYPE=“swap” PARTUUID=“e686f016-06”
/dev/sda7: UUID=“57e12b41-95d6-4502-aa29-40c614fe023d” TYPE=“ext4” PARTUUID=“e686f016-07”

sam@linux:~> cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.4.76-1-default root=UUID=688fde5a-91a6-44d4-89f8-3636b671262b resume=/dev/sda6 splash=silent quiet showopts

Ok, that looks as expected.

What happens if you attempt to hibernate (as user) using the following?

systemctl hibernate

You might find some clues from an examination of the system journal from the previous failed hibernation perhaps…

sudo journalctl -b -1 -r

systemctl hibernate:

initiates a reboot!

sam@linux:~> sudo journalctl -b -1 -r

– Logs begin at Sun 2018-03-18 14:25:20 PDT, end at Sun 2018-03-18 20:32:33 PDT
Mar 18 20:30:33 linux systemd-sleep[680]: Suspending system…
Mar 18 20:30:33 linux systemd-sleep[680]: INFO: Done.
Mar 18 20:30:33 linux systemd-sleep[680]: time needed for sync: 11.7 seconds
Mar 18 20:30:30 linux org.freedesktop.Tracker1.Miner.Extract[1966]: Not a JPEG f
Mar 18 20:30:30 linux org.freedesktop.Tracker1.Miner.Extract[1966]: Not a JPEG f
Mar 18 20:30:30 linux org.freedesktop.Tracker1.Miner.Extract[1966]: Not a JPEG f
Mar 18 20:30:30 linux org.freedesktop.Tracker1.Miner.Extract[1966]: Not a JPEG f
Mar 18 20:30:30 linux org.freedesktop.Tracker1.Miner.Extract[1966]: Not a JPEG f
Mar 18 20:30:30 linux systemd-sleep[680]: running /usr/sbin/grub2-once "openSU
Mar 18 20:30:28 linux systemd-coredump[444]: Process 413 (tracker-extract) of us
Mar 18 20:30:28 linux kernel: BTRFS warning (device sda5): qgroup 259 reserved s
Mar 18 20:30:28 linux kernel: — end trace 411c8167538f3810 ]—
Mar 18 20:30:28 linux kernel: Leftover inexact backtrace:
Mar 18 20:30:28 linux kernel:
Mar 18 20:30:28 linux kernel: DWARF2 unwinder stuck at entry_SYSCALL_64_fastpath
Mar 18 20:30:28 linux kernel: <ffffffff816303b2>] entry_SYSCALL_64_fastpath+0x
Mar 18 20:30:28 linux kernel: <ffffffff81242422>] sys_sync+0x52/0x90
Mar 18 20:30:28 linux kernel: <ffffffff81213b24>] iterate_supers+0xb4/0x110
Mar 18 20:30:28 linux kernel: <ffffffffa047aea8>] btrfs_commit_transaction.par
Mar 18 20:30:28 linux kernel: <ffffffffa047851e>] commit_fs_roots.isra.20+0x14
Mar 18 20:30:28 linux kernel: <ffffffffa04e9044>] btrfs_qgroup_free_refroot+0x
Mar 18 20:30:28 linux kernel: <ffffffff810804e1>] warn_slowpath_common+0x81/0x
lines 1-23…skipping…
– Logs begin at Sun 2018-03-18 14:25:20 PDT, end at Sun 2018-03-18 20:32:33 PDT. –
Mar 18 20:30:33 linux systemd-sleep[680]: Suspending system…
Mar 18 20:30:33 linux systemd-sleep[680]: INFO: Done.
Mar 18 20:30:33 linux systemd-sleep[680]: time needed for sync: 11.7 seconds, time needed for grub: 3.9 secon
Mar 18 20:30:30 linux org.freedesktop.Tracker1.Miner.Extract[1966]: Not a JPEG file: starts with 0x4c 0x49
Mar 18 20:30:30 linux org.freedesktop.Tracker1.Miner.Extract[1966]: Not a JPEG file: starts with 0x4c 0x49
Mar 18 20:30:30 linux org.freedesktop.Tracker1.Miner.Extract[1966]: Not a JPEG file: starts with 0x4c 0x49
Mar 18 20:30:30 linux org.freedesktop.Tracker1.Miner.Extract[1966]: Not a JPEG file: starts with 0x4c 0x49
Mar 18 20:30:30 linux org.freedesktop.Tracker1.Miner.Extract[1966]: Not a JPEG file: starts with 0x4c 0x49
Mar 18 20:30:30 linux systemd-sleep[680]: running /usr/sbin/grub2-once “openSUSE Leap 42.3”
Mar 18 20:30:28 linux systemd-coredump[444]: Process 413 (tracker-extract) of user 1000 dumped core.
Mar 18 20:30:28 linux kernel: BTRFS warning (device sda5): qgroup 259 reserved space underflow, have: 925696, to
Mar 18 20:30:28 linux kernel: — end trace 411c8167538f3810 ]—
Mar 18 20:30:28 linux kernel: Leftover inexact backtrace:
Mar 18 20:30:28 linux kernel:
Mar 18 20:30:28 linux kernel: DWARF2 unwinder stuck at entry_SYSCALL_64_fastpath+0x16/0x71
Mar 18 20:30:28 linux kernel: <ffffffff816303b2>] entry_SYSCALL_64_fastpath+0x16/0x71
Mar 18 20:30:28 linux kernel: <ffffffff81242422>] sys_sync+0x52/0x90
Mar 18 20:30:28 linux kernel: <ffffffff81213b24>] iterate_supers+0xb4/0x110
Mar 18 20:30:28 linux kernel: <ffffffffa047aea8>] btrfs_commit_transaction.part.26+0x498/0xad0 [btrfs]
Mar 18 20:30:28 linux kernel: <ffffffffa047851e>] commit_fs_roots.isra.20+0x14e/0x190 [btrfs]
Mar 18 20:30:28 linux kernel: <ffffffffa04e9044>] btrfs_qgroup_free_refroot+0x154/0x180 [btrfs]
Mar 18 20:30:28 linux kernel: <ffffffff810804e1>] warn_slowpath_common+0x81/0xb0
Mar 18 20:30:28 linux kernel: <ffffffff81339d97>] dump_stack+0x5c/0x85
Mar 18 20:30:28 linux kernel: <ffffffff8101b091>] show_stack+0x21/0x40
Mar 18 20:30:28 linux kernel: <ffffffff8101a2ea>] show_stack_log_lvl+0xfa/0x180
Mar 18 20:30:28 linux kernel: <ffffffff81019f29>] dump_trace+0x59/0x320
Mar 18 20:30:28 linux kernel: Call Trace:
Mar 18 20:30:28 linux kernel: ffff8800373cd940 ffff8800d7c8e000 ffffffffa04e9044 0000000000000103
Mar 18 20:30:28 linux kernel: 00000000000ec000 ffff8800d7c8ed80
Mar 18 20:30:28 linux kernel: ffff8800373cd9c8
Mar 18 20:30:28 linux kernel: ffffffff810804e1
Mar 18 20:30:28 linux kernel: 0000000000000000 ffffffff81339d97 0000000000000000 ffffffffa0501b75
Mar 18 20:30:28 linux kernel: Hardware name: Dell Inc. Dell DXP051 /0FJ030, BIOS
Mar 18 20:30:28 linux kernel: CPU: 0 PID: 1474 Comm: sync Tainted: G O 4.4.76-1-default #1
Mar 18 20:30:28 linux kernel: mfd_core processor btrfs xor raid6_pq hid_generic usbhid sr_mod cdrom sd_mod ata_g
lines 1-36

I note from the output that your machine is a Dell DXP051. A BIOS issue prhaps? Have you checked for any BIOS settings that could be impacting here?

I recall a similar thread which you may like to review. The OP found that upgrading the kernel helped with resolving the issue.

Sorry if I broke a forum’s rule but I did not want to open a new thread.
Until now I thought that I only need a swap if I did not have enough memory (or my memory is not enough for what I do). It seems that until now I misunderstood the swap.
After I read this thread and the links, I have a question: is it absolutely necessary to have a swap?
It seems that the more you read you realize you do not know enough.
Thank you.

For hibernation, yes, and it should be as big as your RAM. That’s because when hibernating, the RAM will be copied to swap and then the system shut down.

Otherwise, it’s not strictly necessary, especially not if you have lots of RAM. Although it still can improve things, as things that are currently not needed can be swapped out freeing more RAM for more useful things.

Thank you for the answer.
I did not use hibernation at all and I have 16 gb ram.
So, I think I will not use swap.