Next revision | Previous revision |
howtos:slackware_admin:hibernation [2012/09/25 02:46 (UTC)] – moved from the general howtos namespace mfillpot | howtos:slackware_admin:hibernation [2014/01/10 05:51 (UTC)] (current) – /*Add method for hibernation using sudo*/ aaditya |
---|
KDE, XFCE and other [[slackware:desktop_environment|desktop environments]] offer hibernation from logout screen/menu. | KDE, XFCE and other [[slackware:desktop_environment|desktop environments]] offer hibernation from logout screen/menu. |
| |
==== lightweight windows managers ==== | ==== Lightweight Window Managers ==== |
| |
You can hibernate your system from console. Either as root via pm-utils or D-Bus with additional programs as regular user. | You can hibernate your system from console. Either as root via pm-utils or D-Bus with additional programs as regular user. |
===== Bootloader configuration ===== | ===== Bootloader configuration ===== |
| |
==== Non-LVM setup ==== | ==== Booting from LVM ==== |
| |
=== LILO configuration === | |
| |
To tell your kernel where to resume from, you need to write the info to ''lilo.conf'': | |
<code> | |
append=" resume=/dev/sdaX" | |
</code> | |
Replace ''/dev/sdaX'' with your actual swap partition. | |
| |
==== LVM setup ==== | |
| |
LILO doesn't support booting from LVM, therefore you have to create initial ramdisk (initrd). You need one even though your kernel has build-in support for LVM. | LILO doesn't support booting from LVM, therefore you have to create initial ramdisk (initrd). You need one even though your kernel has build-in support for LVM. |
* -h set your hibernation/swap logical volume | * -h set your hibernation/swap logical volume |
* -L activate LVM | * -L activate LVM |
| |
| ==== LILO configuration ==== |
| |
Next step is to make sure your ''lilo.conf'' contains following snippet | Next step is to make sure your ''lilo.conf'' contains following snippet |
read-only # Partitions should be mounted read-only | read-only # Partitions should be mounted read-only |
</code> | </code> |
| |
| If you don't use LVM, you can simply tell kernel where to resume from by adding append line: |
| <code> |
| append="resume=/dev/sdaX" |
| </code> |
| Replace ''/dev/sdaX'' with your actual swap partition. |
| |
Afterwards, run ''lilo'' to save changes. | Afterwards, run ''lilo'' to save changes. |
''xlock'' is a command that locks your X session. Upon rebooting, you will be asked for the //root// password. The ''sleep'' command may be omitted, but I think it's safer to leave it, so you are sure that ''xlock'' has enough time to run properly. You don't have to use ''exit'' (or ''logout'') at the end of the command or the script, as it has no use concerning security. You may want to use it though to automatically close the xterm on resuming. | ''xlock'' is a command that locks your X session. Upon rebooting, you will be asked for the //root// password. The ''sleep'' command may be omitted, but I think it's safer to leave it, so you are sure that ''xlock'' has enough time to run properly. You don't have to use ''exit'' (or ''logout'') at the end of the command or the script, as it has no use concerning security. You may want to use it though to automatically close the xterm on resuming. |
<note warning>Security warning: this "trick" will only lock the X system! If you are logged on as root in any of the other ttys, ''xlock'' can be killed, leaving full access to the X session.\\ For people using init3 (no automatic X startup), remember to also logout from the tty from where you launched the X system with ''startx'': hit <key>CTRL+Z</key> (to suspend the task), then ''bg'' (to resume the task in the background), then <key>CTRL+D</key> (or ''logout'') to logout.</note> | <note warning>Security warning: this "trick" will only lock the X system! If you are logged on as root in any of the other ttys, ''xlock'' can be killed, leaving full access to the X session.\\ For people using init3 (no automatic X startup), remember to also logout from the tty from where you launched the X system with ''startx'': hit <key>CTRL+Z</key> (to suspend the task), then ''bg'' (to resume the task in the background), then <key>CTRL+D</key> (or ''logout'') to logout.</note> |
| |
| === An alternate === |
| |
| If one is a sudoer, ie, can use sudo, then the following can also be used: |
| |
| <code bash>sudo /usr/sbin/pm-hibernate</code> |
| |
| |
===== Further reading ===== | ===== Further reading ===== |