Both sides previous revisionPrevious revisionNext revision | Previous revision |
ca-valencia:howtos:slackware_admin:hibernation [2015/02/01 14:30 (UTC)] – [Booting from LVM] el_pinux_penat | ca-valencia:howtos:slackware_admin:hibernation [2015/02/02 21:38 (UTC)] (Actual) – [Amb pm-utils] typo el_pinux_penat |
---|
<note>Work in progress by Jordi Garcia Soler</note> | |
====== Hibernació ====== | ====== Hibernació ====== |
| |
===== Hibernant ===== | ===== Hibernant ===== |
| |
==== Desktop Environments ==== | ==== Entorns d'Escriptori ==== |
| |
KDE, XFCE i altres [[slackware:desktop_environment|entorns d'escriptori]] ofereixen l'hibernació des de la pantalla/menú de tancament de sessió. | KDE, XFCE i altres [[slackware:desktop_environment|entorns d'escriptori]] ofereixen l'hibernació des de la pantalla/menú de tancament de sessió. |
=== D-Bus === | === D-Bus === |
| |
Slackware ofereix dos serveis per a controlar la gestió de la energia en els seus alliberament recents. UPower i HAL. Com HAL està deprecated a Slackware 14.0, utilitza HAL en alliberaments més antics d'Slackware (de la 12.0 a la 13.37), en qualsevol altre cas utilitza UPower. | Slackware ofereix dos serveis per a controlar la gestió de la energia en els seus alliberament recents. UPower i HAL. Com HAL està deprecated a Slackware 14.0, utilitza HAL només en alliberaments més antics d'Slackware (de la 12.0 a la 13.37), en qualsevol altre cas utilitza UPower. |
| |
Utilitza una de les ordres següents per a hibernar el teu sistema. | Utilitza una de les ordres següents per a hibernar el teu sistema. |
</code> | </code> |
| |
===== Bootloader configuration ===== | ===== Configuració del carregador de l'arrancada ===== |
| |
==== Arrencant des de LVM ==== | ==== Arrancant des de LVM ==== |
| |
LILO no suporta l'arranc des de LVM, per tant, has de crear un ramdisk inicial (initrd). En necessites un encara que el teu nucli tinga suport integrat per a LVM. | LILO no suporta l'arranc des de LVM, per tant, has de crear un disc ram inicial (initrd). En necessites un encara que el teu nucli tinga suport integrat per a LVM. |
| |
No has d'ajustar de manera especial el ''lilo.conf'' perquè pots establir tot allò relatiu a la represa a initrd. | No has d'ajustar de manera especial el ''lilo.conf'' perquè pots establir tot allò relatiu a la represa a initrd. |
* -L activate LVM | * -L activate LVM |
| |
==== LILO configuration ==== | ==== Configuració del LILO ==== |
| |
Next step is to make sure your ''lilo.conf'' contains following snippet | El següent pas és assegurar-te de que el teu ''lilo.conf'' conté el següent fragment |
<code> | <code> |
image = /boot/vmlinuz | image = /boot/vmlinuz |
</code> | </code> |
| |
If you don't use LVM, you can simply tell kernel where to resume from by adding append line: | Si no utilitzes LVM, pots simplement dir-li al nucli des d'on reprendre afegint una línia ''append'': |
<code> | <code> |
append="resume=/dev/sdaX" | append="resume=/dev/sdaX" |
</code> | </code> |
Replace ''/dev/sdaX'' with your actual swap partition. | Reemplaça ''/dev/sdaX'' amb la teua partició d'intercanvi actual. |
| |
Afterwards, run ''lilo'' to save changes. | Després d'això, executa ''lilo'' per a salvar els canvis. |
<code> | <code> |
$ lilo | $ lilo |
</code> | </code> |
| |
===== Lock your computer upon resuming ===== | ===== Bloqueja el teu ordinador en reprendre ===== |
| |
You may have noticed that when your computer resumes, there is no protection to ensure no one can use your computer. As ''pm-hibernate'' must be run as root, any user that powers up your computer will be granted a root terminal! I'll show you some tricks to ensure a proper lock of the system. | Potser t'has adonat de que quan el teu ordinador reprèn el seu estat no hi ha cap protecció per a assegurar-te de que ningú podrà utilitzar el teu ordinador. Com ''pm-hibernate'' s'ha d'executar com root, qualsevol usuari que encenga el teu ordinador tindrà garantit un terminal de root! Et mostraré alguns trucs per a assegurar-te un bloqueig adequat del sistema. |
<note warning>Security warning: whether you are using the trick from the command-line or from an X session, don't forget to logout from all other ttys! None of them will get locked, so people issuing <key>CTRL+ALT+F1</key> (ar any Fx key) upon resuming will be able to access them, rendering the lock trick totally useless!</note> | <note warning>Advertència de Seguretat: Si estàs utilitzant el truc des de la línia d'ordres o des d'una sessió X, no t'oblides de tancar sessió a la resta de terminals tty! Cap d'elles es bloquejarà, pel que qualsevol persona que emeta <key>CTRL+ALT+F1</key> (o qualsevol altra tecla de Funció) en reprendre podrà de accedir-los, fent que el truc del bloqueig siga totalment inútil!</note> |
| |
==== With pm-utils ==== | ==== Amb pm-utils ==== |
| |
=== From the command line === | === Des de la línia d'ordres === |
If you dont have an X session open, the only way to lock your computer is to logout from your session before hibernation. You can use the following command: | Si no tens una sessió X oberta, l'única manera de bloquejar el teu ordinador és tancar la teua sessió abans d'hibernar. Pots utilitzar la següent ordre: |
<code>pm-hibernate & logout (OR pm-hibernate & exit)</code> | <code>pm-hibernate & logout (O pm-hibernate & exit)</code> |
It's important to logout from every tty prior to hibernation! ''logout'' will only log you out from the terminal from where you launched the command. Please read the warning in the following section. | És important tancar sessió a cada tty abans d'hibernar! ''logout'' només tancarà la teua sessió al terminal des d'on vas llançar l'ordre. Per favor, llig l'advertència en la següent secció. |
<note>This trick may not work on fast systems, as ''logout'' may not have enough time to complete. You may think that using '';'' instead of ''&'' could do the trick (as it will log out the user //after// resuming), but it allows the user doing a <key>CTRL+C</key> upon resuming, killing the ''logout'' command.</note> | <note>Aquest truc pot no funcionar en sistemes ràpids, ja que ''logout'' pot no tindre prou temps per a completar-se. Pots pensar que utilitzant '';'' enlloc de ''&'' podria fer el truc (ja que tancaria la sessió de l'usuari //després// de reprendre), però permet a l'usuari fer un <key>CTRL+C</key> en reprendre, matant la ordre ''logout''.</note> |
| |
=== From an X session === | === Des d'una sessió X === |
If you want to lock the computer prior hibernation, you can issue the following command (as root of course):\\ | Si vols bloquejar l'ordinador abans de la hibernació, pots emetre la següent ordre (com root, pressupost):\\ |
<code># xlock & sleep 5 ; pm-hibernate</code> | <code># xlock & sleep 5 ; pm-hibernate</code> |
You can also create the following script:\\ | També pots crear el següent guió:\\ |
<code bash>#!/bin/bash | <code bash>#!/bin/bash |
echo 'Hibernating in 5 seconds' | echo 'Hibernant en 5 segonds' |
xlock & | xlock & |
sleep 5 | sleep 5 |
pm-hibernate</code> | pm-hibernate</code> |
''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'' és una ordre que bloqueja la teua sessió X. En reiniciar, se't demanarà la contrasenya de //root//. L'ordre ''sleep'' es pot ometre, però crec què és més segur deixar-la, així t'assegures de que ''xlock'' té temps suficient per a executar-se correctament. No has d'utilitzar ''exit'' (o ''logout'') al final de la ordre o guió, ja que no té cap utilitat respecte a la seguretat. Tot i que potser vols utilitzar-lo per a tancar automàticament l'xterm al reprendre. |
<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>Advertència de Securetat: aquest "truc" només bloquejarà el sistema X! Si has iniciat sessió com root en qualsevol altra tty, ''xlock'' pot ser matat, deixant accés complet a la sessió X.\\ Per a gent utilitzant init3 (no inici automàtic de les X a l'inici), recordeu tancar sessió també de la tty des de la que vas llançar el sistema X amb ''startx'': prema <key>CTRL+Z</key> (per a suspendre la tasca), aleshores ''bg'' (per a reprendre la tasca en el rerefons) i aleshores <key>CTRL+D</key> (o ''logout'') per a tancar sessió.</note> |
| |
=== An alternate === | === Una alternativa === |
| |
If one is a sudoer, ie, can use sudo, then the following can also be used: | Si ets un sudoer, és a dir, pots utilitzar sudo, aleshores el següent també es pot utilitzar: |
| |
<code bash>sudo /usr/sbin/pm-hibernate</code> | <code bash>sudo /usr/sbin/pm-hibernate</code> |
| |
| |
===== Further reading ===== | ===== Lectures addicionals ===== |
| |
* Hibernate to encrypted swap - [[http://slackware.osuosl.org/slackware-13.37/README_CRYPT.TXT|README_CRYPT.TXT]] | * Hibernar a una partició d'intercanvi xifrada - [[http://slackware.osuosl.org/slackware-13.37/README_CRYPT.TXT|README_CRYPT.TXT]] |
| |
===== Sources ===== | ===== Fonts ===== |
* Original source: [[http://www.slackwiki.com/Hibernate]] | * Font original: [[http://www.slackwiki.com/Hibernate]] |
* Original author unknown - original submissions [[http://www.slackwiki.com/index.php?title=Hibernate&oldid=366|1]],[[http://www.slackwiki.com/index.php?title=Hibernate&oldid=368|2]] | * Autor original desconegut - presentacions originals [[http://www.slackwiki.com/index.php?title=Hibernate&oldid=366|1]],[[http://www.slackwiki.com/index.php?title=Hibernate&oldid=368|2]] |
* Otherwise [[http://www.slackwiki.com/index.php?title=Hibernate&action=history|rewritten]] by [[wiki:user:yenn|Martin Matějek]] (also on Slackwiki) | * En un altre cas [[http://www.slackwiki.com/index.php?title=Hibernate&action=history|reescrit]] per [[wiki:user:yenn|Martin Matějek]] (també a Slackwiki) |
* Hibernate trick by [[wiki:user:zithro|zithro]] | * Truc d'hibernació per [[wiki:user:zithro|zithro]] |
| |
{{tag>howtos hardware hibernation power_saving author_yenn author_zithro}} | {{tag>howtos hardware hibernation power_saving author_yenn author_zithro}} |