How to enable Hibernate Mode on Linux Mint

The hibernation feature support in Linux Mint is not out-of-the-box or an included default feature. You have to perform some technical maneuvers if you want to use it. This article will be referencing the Linux Mint swap file to enable the Hibernate mode.

If you ask a Linux community user why their love and loyalty for Linux Mint continues to be undeterred, you will get a colorful response. This community-driven Linux distro never disappoints in its elegance. The UI, together with the desktop environment, is comfortable enough. It is up-to-date and easy to use. Since it is Ubuntu-based, you are guaranteed a wide variety of free and open-source system software applications at your disposal. It also supports proprietary software like multimedia codecs for users seeking complete out-of-the-box multimedia support.

Conceptualizing the System Hibernation Mode

Despite these praises directed towards Linux Mint, the user experience is not a guaranteed smooth train ride. You have to adjust to some technical configurations and setups to fully declare that you have control of Linux Mint in the palm of your hands. One of the technicalities this article explores relates to Linux Mint’s hibernation mode. It is an operating system feature that is especially useful when you want to sign off from your OS usage but not completely Shutdown the OS. Hibernation keeps your operating system in a low-power mode and retains the state of the work or projects you worked on for easy resumption the next time you sign-in.

The hibernation feature support in Linux Mint is not out-of-the-box or an included default feature. You have to perform some technical maneuvers if you want to use it. This article will be referencing the Linux Mint swap file to achieve its objective. Think of the swap file as an assistant to the machine’s RAM or main memory. It offers assistive storage to data retrieved from your system’s RAM. You can also think of it as RAM’s secondary storage device. The assistive storage it gives the system RAM is essential in the performance improvement of your OS. It helps keep the system RAM from being overwhelmed when more system and user programs are being loaded on it for efficiency in their execution.

Enabling the Hibernate Mode on Linux Mint

With the swipe files, the approaches to configure and enable hibernation in Linux Mint depend on the file systems in use as some file system formats do not support this Hibernate mode. A good example is the Btrfs storage format. You should consider the use of a file system like ext4.


The easiest way to relate to this hibernate function is to think of it as a suspend to disk system feature. Since system hibernation keeps your computer system in a powered-off mode without losing your work or active files, it makes it very different from the system suspend feature. The two features might be from the same household, but they are not siblings. Suspend only keeps your machine in a low power consumption mode. During hibernation, the swap file will store active files from the system RAM, whose state you want to retain once you power back on your machine from its presumed to-be shutdown mode. You will also note that the system resumption period from hibernation mode is longer than the one from suspend mode because your system really adopted a shutdown state.

Hibernation is not a guaranteed success factor in all operating systems, and the factors that contribute to this unsuccessfulness are mainly Bios and system driver issues. A recommended precaution to keep your operating system from boot failure issues once you complete this article tutorial is to use your Linux Mint’s pre-installed Timeshift tool. It will help you configure a system snapshot that functions as a system restore feature similar to the one on Windows operating system.

It restores an OS to a previous state where everything was working normally. An ideal way to efficiently implement the usefulness of the Timeshift tool is to have a Linux Mint live USB/DVD media nearby if the configurations you implement here lead to more complex system issues or cause a boot failure. We have a tutorial on creating a Live USB drive on this Ubuntu-based distro.

Swap File Size Requirements

Since the system kernel is responsible for initiating the actions that facilitate OS hibernation, it has to automate itself to write or create a compressed hibernation image by default. This image file’s maximum size is set to 2/5 the system RAM’s size. If a significant proportion of the RAM’s size is already occupied by other resource-driven system processes before the compressed hibernation image size is created, the swap file is used to hold the surplus of this compressed hibernation image size. Since the swipe file is now the ultimate determiner of whether system hibernation will take place, its allocated size or storage needs to be considerable, or else system hibernation won’t be able to take place.

We cannot confidently quote a safe swap file size allocation. The operations and performances of an operating system can be unpredictable. Your system’s unpredictable nature depends on how much the system apps and services frequent the use of the assigned swap space and installed RAM. To be safe, Linux community users are advised to adhere to a rule of thumb when setting up the swap file size. The least requirement is that it should match your machine’s RAM size. The advisable requirement is that it should double the size of your machine’s RAM.

Running the following command on your terminal will display useful information regarding your system RAM and currently allocated swap usage.

$ free -h

On my end, I got an output like the following:

Checking RAM and Swap Status on Your Linux Mint Machine
Checking RAM and Swap Status on Your Linux Mint Machine

The succeeding commands in this article will assume that the system file path /swapfile is the default location of your swap file configurations. It is not recommended to work with a manually customized swap file location.

The following command should confirm that your swap file system location is /swapfile. Also, check that its assigned size works for you or meets your system requirements depending on the OS activities you frequently perform or schedule.

$ swapon

On my end, I got the following output:

Determining the Location and Size of the Allocated System Swap
Determining the Location and Size of the Allocated System Swap

Swap File Setup

If you feel that your system’s configured swap file is not big enough or does not adhere to the previously stated rule of thumb, you can adjust it to meet your system specs preference.

The first step is to disable your Linux Mint machine’s currently active swap space. Since this operation is highly privileged, you will need to be a Sudoer user or possess Sudo privileges to execute its related command comfortably.

$ sudo swapoff -a

With no swap file currently active, you can now create and resize it to the desired swap file size. When assigning the swap file a custom size, your input preference should be in Gigabytes or GiB. For instance, if you want a swap file of 4 GB, the following command will achieve this objective. This command immediately succeeds in switching off all active swap partitions and their memory allocations.

$ SIZE=4

You can adjust the above input depending on how resourcefully performant your Linux Mint is characterized.

The above command will only execute successfully if you have enough system memory storage to be allocated. The following command string confirms whether your remaining system storage can handle the newly defined swap file size.

$ df / -h

The output of this command should have a parameter called Avail. It is the available system storage on your machine after you assigned the swap file the presumed 4 GB storage. Comparing it to the assigned swap file size value, the Avail parameter storage value should be significantly miles ahead or more in terms of its displayed storage value. In short, do not use up all your machine storage to meet the expectations of the swap file storage. The swap file storage should be a small fraction or proportion of the total machine storage but not too small that the RAM’s size supersedes it. The absence of sufficient swap file storage will hinder your expectation of enabling Hibernate mode in your Linux Mint machine.

If you managed to create the swap file storage by adhering to the rules and guidelines of the above-stated commands, you could proceed with the tutorial by copy-pasting the command strings and sequences below on your system terminal. Execute them one by one in an orderly fashion.

$ sudo dd if=/dev/zero of=/swapfile bs=1M count=$(($SIZE * 1024))
$ sudo chmod 0600 /swapfile
$ sudo mkswap /swapfile
$ sudo sed -i '/swap/{s/^/#/}' /etc/fstab
$ sudo tee -a /etc/fstab<<<"/swapfile none swap sw 0 0"

The above command string sequences configure a swap file with the 4 GB storage we specified in general. These configurations are necessary to make the swap file compatible with your Linux Mint system. These configuration steps also disable or deactivate any other existing swap file storage as their active location can lead to unnecessary swap conflicts that might be difficult to resolve. You are not limited to using one swap space on your system, but multiple swap file instances are difficult to troubleshoot when the said conflicts start to surface. It is advisable to leave that setup to expert users familiar with the Ins and Outs of their operating system.

Kernel Parameters Setup

The next step is to update the system kernel of the changes we have made regarding the newly created swap file and its allocated storage space. Copy-paste and run this command string on your Linux Mint terminal.

$ RESUME_PARAMS="resume=UUID=$(findmnt / -o UUID -n) resume_offset=$(sudo filefrag -v /swapfile|awk 'NR==4{gsub(/\./,"");print $4;}') "

The successful execution of the above command string should be followed by executing the following command string. Also, please copy and paste it on your Linux Mint terminal.

$ if grep resume /etc/default/grub>/dev/null; then echo -e "\nERROR: Hibernation already configured. Remove the existing configuration from /etc/default/grub and add these parameters instead:\n$RESUME_PARAMS";else sudo sed -i "s/GRUB_CMDLINE_LINUX_DEFAULT=\"/GRUB_CMDLINE_LINUX_DEFAULT=\"$RESUME_PARAMS/" /etc/default/grub;fi

It would help if you had a keen eye on the possibility of errors that might pop up from executing the above long command strings. They could be typos or other syntax-related errors. If everything is okay with the command strings on your side and they execute successfully, proceed to update your Linux Mint system GRUB with the following command. Also, run it on your terminal.

$ sudo update-grub

Your system GRUB will be updated of any system changes that concern its functional delivery.

Including the Hibernate Feature to the Shutdown Dialog

You now want your Linux Mint shutdown dialog to include the Hibernation option alongside the Shutdown, Restart, or Suspend Shutdown dialog. Running the following command on your terminal will help meet this system objective.

$ sudo tee /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla <<'EOB' [Enable hibernate] Identity=unix-user:* Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions ResultActive=yes EOB

Testing Your Configured Setup

Reboot your Linux Mint system. After the system reboot, you can verify through your system command-line whether the hibernate mode was successfully configured and is active. The following command string helps achieve this objective. Run it on your system terminal.

$ busctl call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager CanHibernate

The expected output from executing this command should be a yes string response. If it is not the response you receive, we have some troubleshooting tips for you in the next section that follows this one.

With your command-line interface still active, attempt to manually hibernate your Linux Mint operating system from the Shutdown dialog. Give it time to Shutdown and then power it back on. If you log-in to your Linux Mint OS and the current system session is the one you left before hibernating it, then your efforts were fruitful. You should be able to access the command-line interface you previously left active. The command-line utility is also a useful tool for hibernating your Linux Mint OS. It is straight-forward through the following command string.

$ systemctl hibernate


If you are constantly running into a wall trying to enable Hibernation on your Linux Mint OS successfully, then one of the main contributors to this headache could be your machine’s BIOS/UEFI. You should double-check its pre-configured settings and ensure that it fully supports ACPI Sleep State S4. It is a Suspend to Disk feature that should be active for system Hibernation to take place. It takes a machine’s OS to its lowest power mode, a condition necessary for system hibernation. You can also disable UEFI’s fast boot and secure boot as they are likely to get in the way of your machine’s successful Hibernation.

If your system operates under a non-default Kernel, then its compilation might not cater to full Hibernation support. You can troubleshoot this possibility with the following command string.

$ grep CONFIG_HIBERNATION /boot/config-$(uname -r)

Final Note

The complexity of troubleshooting the Hibernation functionality on your Linux Mint OS is the prime reason why the feature is excluded from the system’s Shutdown dialog. The tutorial walk-throughs in this article effectively bring the hibernation function on your Linux Mint OS back to life. The main hurdles you might face while trying to achieve this objective are related to the machine BIOS/UEFI setup. If you take the necessary precautions and adhere to every listed step in this article, and also their guidelines, you will be hibernating with a smile on your Linux Mint OS in no time.

Brandon Jones
Brandon is an avid Linux enthusiast, programmer, and contributor here at FOSS Linux. Linux and open-source are one of his passions. He enjoys Python programming and loves to contribute to open-source projects on GitHub.


Please enter your comment!
Please enter your name here





Photo editing is a global hobby, profession, and exploit. Its execution is not dependant on a specific Operating System or device. For this reason, anyone can be a photo editor regardless of their Operating system preference. The power of an ideal and reliable photo editor is in the many unique features they present to their users. Some features pose unique photo editing benefits like correcting brightness imbalances and color hue. Some editors are efficient in sharpness adjustments and red-eye removal. Others present flexible auto-cropping and zoom features. These are some of the characteristics that define a photo editor.
You might ask, what is the necessity of a password manager? To answer this question, we have to breakdown the attributes of a good and secure password. These attributes are not related to the password we compose at a moment's notice. You do not need a password manager or a password wallet for passwords related to your pet’s name, dream city to visit, or even your favorite pronounceable noun or verb.