LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-12-2021, 06:58 AM   #1
JASlinux
Member
 
Registered: Oct 2020
Posts: 385

Rep: Reputation: Disabled
Does Linux have a variably-sized hibernation file like hiberfil.sys?


I would hibernate in Linux if it were possible without a large swap file that is always in use.

Quote:
the speed with which the system resumes depends on how big the hiberfil.sys file is
https://www.techrepublic.com/blog/wi...feature-works/
 
Old 12-12-2021, 11:57 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,699

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by JASlinux View Post
I would hibernate in Linux if it were possible without a large swap file that is always in use.
Code:
the speed with which the system resumes depends on how big the hiberfil.sys file is
https://www.techrepublic.com/blog/wi...feature-works/
From a brief search about Linux hibernation; bolded a piece for emphasis only:
https://wiki.archlinux.org/title/Pow...tion/file_size
Quote:
Originally Posted by Docs
You may either decrease the value of /sys/power/image_size to make the suspend image as small as possible (for small swap partitions), or increase it to possibly speed up the hibernation process. For systems with a large amount of RAM, smaller values may drastically increase the speed of resuming a hibernating system. See systemd#systemd-tmpfiles - temporary files to make this change persistent.
Linux isn't Windows, and you should look up the differences between suspend and hibernate, what they are, and how they work.

Not sure what the actual issue/problem is; suspend is always going to be faster, and there are well known issues with both suspend and hibernate in Linux. My laptops boot cold to desktop in less than 30 seconds...not sure why that would be too long for you to wait.

Last edited by TB0ne; 12-12-2021 at 11:59 AM.
 
Old 12-12-2021, 02:23 PM   #3
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by JASlinux View Post
I would hibernate in Linux if it were possible without a large swap file that is always in use.



https://www.techrepublic.com/blog/wi...feature-works/
The swap area, as you probably already know (regardless of whether it's a file or a partition), needs to be large enough to hold everything in RAM and likely more for the situations where you're already using more memory than you have physical RAM for your running processes. My rule of thumb comes from my days administering Oracle servers: 4 x physical RAM (disk space is cheap nowadays). With a large-enough swap partition, I've had no problems hibernating. I've only hibernated on my laptop, though. It ought to work on my desktop system but I've just never used it.

There is a kernel boot command line option, "resume=...", that points to a disk partition. I seriously doubt it could be used to specify a file in a filesystem. (Does the kernel know about what filesystem is built on a particular partition during bootstrap and know how to look for a file within it? I'm doubting it.) There are other boot command line parameters that are used for suspend/hibernation in "/usr/src/linux/Documentation/admin-guide/kernel-parameters.txt". A little research into their use might get you what you want.


Hope this helps...
 
Old 12-12-2021, 07:45 PM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,377

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
Quote:
There is a kernel boot command line option, "resume=...", that points to a disk partition. I seriously doubt it could be used to specify a file in a filesystem.
From /usr/src/linux/Documentation/power/swsusp-and-swap-files.rst
Quote:
In principle the location of a swap file's header may be determined with the
help of appropriate filesystem driver. Unfortunately, however, it requires the
filesystem holding the swap file to be mounted, and if this filesystem is
journaled, it cannot be mounted during resume from disk. For this reason to
identify a swap file swsusp uses the name of the partition that holds the file
and the offset from the beginning of the partition
at which the swap file's
header is located. For convenience, this offset is expressed in <PAGE_SIZE>
units.
 
Old 12-14-2021, 09:06 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,676
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
There are several ways that the Linux kernel can implement "suspend." One way is to use the swap area, which may or may not be a file. The kernel architecture is somewhat flexible here.
 
  


Reply

Tags
hibernation, microsoft, swapfile, windows



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Windows 8 hiberfil.sys jdmeaux1952 Linux - Software 6 08-22-2015 07:50 AM
File to wakeup the system for hibernation like resume.sh ?? sanketdangi Ubuntu 3 01-16-2010 11:25 AM
[SOLVED] Need to manually re-install sys-lib/com_err and sys-lib/ss matsvw Gentoo 4 08-02-2009 11:17 AM
Why can't OpenSuse have normal sized fonts like Ubuntu and not microscopic ones? doublepow SUSE / openSUSE 3 02-08-2009 08:38 AM
Is a Linux sys w/o any passwd's as secure as a microsoft windows sys w/no passwd? t3gah Linux - Security 4 04-22-2005 08:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration