Git Product home page Git Product logo

hibernation-setup-tool's Introduction

title section header footer date
hibernation-setup-tool
1
System Utilities
hibernation-setup-tool 1.0
June 29, 2021

NAME

hibernation-setup-tool - sets up a VM for hibernation

SYNOPSIS

hibernation-setup-tool

DESCRIPTION

hibernation-setup-tool is a tool that sets up a swap file suitable for hibernation, and sets up the system to enable proper resuming.

It accomplishes that by creating a swap file in the root directory that's slightly larger than the total amount of RAM available for the VM, ensuring it has no holes and isn't fragmented, and setting up parameters for the currently-running kernel (so the VM can be hibernated as soon as the set up is complete), and for next boots (so that the VM can be resumed).

On Hyper-V virtual machines, it'll also ensure that proper udev rules are set in place so that the machine can hibernate when receiving a command from the host. In addition, it'll install systemd hooks to track hibernation success, failures, and cold-boot scenarios, and store them in the system log.

It currently only fully supports distributions with GRUB2 as the bootloader (e.g. those with /etc/default/grub as part of its configuration file), and those using initramfs-tools (e.g. Debian and Ubuntu). Use in systems where either of these aren't used is possible, however the tool won't be able to adjust the system in such a way that it'll resume from hibernation.

Installation can be performed either manually, by using the provided Makefile (e.g. by issuing make to build and make install with superuser privileges to install files in the correct locations), or by installing a .deb package. To build the .deb package, one can use the provided build.sh script in the debian-packaging branch of this repository, which, in a system where tools to build Debian packages have been installed, will perform all necessary steps to output a file that can be installed via dpkg.

OPTIONS

No command-line parameters exist. The tool is fully automatic, and will exit when set up has been completed. It can be safely executed on every boot, without impacting boot time.

RETURN VALUE

The tool will return 0 on success, and 1 on failure.

AUTHORS

Written by Leandro Pereira.

BUGS

Submit bug reports online.

SEE ALSO

Full source code is available.

NOTES

This program requires superuser privileges to execute.

Pull requests improving the tool are greatly appreciated. Please refer to the CONTRIBUTING.md file located in the source repository for more information, including a link to the Microsoft Open Source Code of Conduct document.

Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.

hibernation-setup-tool's People

Contributors

ishaansehgal99 avatar larohra avatar lpereira avatar pavanrachapudy90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ishaansehgal99

hibernation-setup-tool's Issues

The generated kernel param should be no_console_suspend rather than no_console_suspend=1

See https://www.kernel.org/doc/html/v4.14/admin-guide/kernel-parameters.html

We need changes at these places:
hibernation-setup-tool.c:1057: else if (!strncmp(field, "no_console_suspend=", sizeof("no_console_suspend=") - 1))
hibernation-setup-tool.c:1058: no_console_suspend_field = field + sizeof("no_console_suspend=") - 1;
hibernation-setup-tool.c:1161: if (asprintf(&args, "resume=/dev/disk/by-uuid/%s resume_offset=%lld no_console_suspend=1", dev_uuid, swap_area.offset) < 0) {

However, it looks like no_console_suspend=1 also works, according to my understanding of the kernel code:

"kernel/printk/printk.c"
static int __init console_suspend_disable(char *str)
{
console_suspend_enabled = false;
return 1;
}
__setup("no_console_suspend", console_suspend_disable);

But I think it's still good to get this changed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.