Next revision | Previous revision |
ca-valencia:howtos:hardware:syncing_hardware_clock_and_system_local_time [2015/01/08 14:59 (UTC)] – creat el_pinux_penat | ca-valencia:howtos:hardware:syncing_hardware_clock_and_system_local_time [2015/01/09 13:06 (UTC)] (Actual) – el_pinux_penat |
---|
<note>Work in progess by Jordi Garcia Soler</note> | |
| |
<!-- Reviewed 20130111 by hazel --> | <!-- Reviewed 20130111 by hazel --> |
<!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> |
====== How To Sync Your System Time to Hardware Clock Consistently ====== | ====== Com sincronitzar l'hora del teu sistema de manera consistent amb el rellotge del maquinari ====== |
| |
===== Overview ===== | ===== Perspectiva General ===== |
| |
If you are booting multiple Linux distributions on the same machine, you might face the problem of inconsistent time zone settings across distributions. For example, assume you are dual-booting two Linux distributions, Distro X and Distro Y. You have set your BIOS hardware clock to show the local time. | Si estas iniciant múltiples distribucions de Linux en la mateixa màquina, pots enfrontar-te a un problema d'inconsistència de configuració de la zona horària entre les distribucions. Per exemple, assumint que tens un arranc dual amb dos distribucions de Linux, Distribució X i Distribució Y i que has fixat el teu rellotge de maquinari de la BIOS per a que mostre l'hora local. |
| |
If Distro X is configured to read the hardware clock as local time, it will show the time correctly, but if Distro Y is configured to read the hardware clock as set to UTC, then it will show an incorrect time. | Si la Distribució X està configurada per a llegir el rellotge de maquinari com a hora local, mostrarà l'hora correctament, però si la Distribució Y està configurada per a llegir el rellotge de maquinari com a UTC, mostrarà una hora incorrecta. |
| |
This HOWTO attempts to provide a simple and cross-distribution one-time solution to the issue, making sure all your distributions know that your hardware clock is set to the local time (or UTC if you prefer it). | Este COM tracta de proporcionar un solució al problema simple, única i vàlida per a totes les distribucions, assegurant-te de que totes les teues distribucions saben que al teu rellotge de maquinari està fixada l'hora local (o UTC si així ho prefereixes). |
| |
<note tip>The other solution to time management on a system is to synchronize your computer's clock with an NTP (Network Time Protocol) server.</note> | <note tip>L'altra solució a la gestió de l'hora a un sistema és sincronitzar el rellotge del teu ordinador amb un servidor NTP (Network Time Protocol, Protocol d'Hora de Xarxa).</note> |
| |
===== Procedure to Synchronize the System Time to Hardware Clock ===== | ===== Procediment per a Sincronitzar l'Hora del Sistema amb el Rellotge del Maquinari ===== |
| |
This is a one-time procedure to ensure that your hardware clock's time zone is correctly and consistently recognized by all the Linux installations you multiboot on a single machine. | Aquest és un procediment que es fa una vegada per a assegurar que la zona horària del rellotge del teu maquinari està reconeguda de manera correcta i consistent per a totes les instal·lacions de Linux que arranques en una mateixa màquina. |
| |
Assuming you are dual-booting Distro X and Y, first boot into Distribution X. First check the hardware clock with the following command. | Assumint que tens un arranc dual amb la Distribució X i la Distribució Y, comença arrancant la distribució X. Aleshores, comprova el rellotge del teu maquinari amb la següent ordre. |
hwclock --show | hwclock --show |
If your hardware clock is not set to your local time, then you must set the system time to local time. As root, | Si el rellotge del teu maquinari no està definit a la teua hora local, aleshores has de d'establir l'hora del sistema amb l'hora local. Com root, |
| |
**Update via NTP:** If you installed the ntp package you can: \\ | **Actualització via NTP:** Si vas instal·lar el paquet ntp, pots fer: \\ |
ntpdate pool.ntp.org | ntpdate pool.ntp.org |
-or- \\ | -o- \\ |
**Manual update:** \\ | **Actualització manual:** \\ |
date --set "5 Aug 2012 12:54 IST" | date --set "5 Aug 2012 12:54 IST" |
Obviously in the above command you must set your date, time and time zone correctly. | Òbviament a l'ordre de dalt has d'establir la teua data, hora i zona horària correctament. |
| |
Now as root, synchronize the hardware clock to the current system time as local time. | Ara com root, sincronitza el rellotge del teu maquinari a l'hora del sistema com a hora local. |
hwclock --systohc --localtime | hwclock --systohc --localtime |
Now the hardware clock is readjusted to the system time and both now point to the local time. | Ara el rellotge del maquinari està reajustat a l'hora del sistema i ambdós apunten a l'hora local. |
| |
<note>Obviously there are other ways to achieve the same effect, but this process is least likely to confuse as you set initial time inside the Operating System and then adjust the BIOS clock accordingly.</note> | <note>Òbviament hi ha altres maneres d'aconseguir el mateix efecte, però este procés és el que porta a menys confusió, al establir l'hora inicial dins del Sistema Operatiu i ajustant aleshores en conseqüència el rellotge de la BIOS.</note> |
| |
Now boot into Distro Y and follow the same steps as above. It doesn't matter that the hardware clock is now set correctly, you can still reset the clock once to make sure that every distribution you multi-boot recognizes the hardware clock as set to the local time. | Entra ara en la Distribució Y i segueix els mateixos passos que dalt. No importa que el rellotge del maquinari estiga establert correctament, encara pots restablir-lo una altra vegada per a assegurar-te de que cada distribució del teu multi-arranc reconeix que el rellotge del maquinari està configurat amb l'hora local. |
| |
===== Syncing to UTC instead of Local Time ===== | ===== Sincronitzant a UTC enlloc d'a l'Hora Local ===== |
| |
Some people prefer setting their hardware clock to UTC (Universal Coordinated Time) instead of local time. If you want to set your hardware clock to UTC and adjust the date/time accordingly, use the above steps but simply change the ''hwclock'' command to | Hi ha gent que prefereix establir el seu rellotge de maquinari a UTC (Universal Coordinated Time) enlloc d'a l'hora local. Si vols fixar el teu rellotge de maquinari a UTC i ajustar la data/hora en conseqüència, utilitza el passos de més amunt, però simplement canvia l'ordre ''hwclock'' a |
hwclock --systohc --utc | hwclock --systohc --utc |
while setting the hardware clock from your system time. | al establir el rellotge de maquinari amb l'hora del teu sistema. |
| |
<note important>Be consistent in time settings across Operating Systems when you dual boot. If you use different settings in different Operating Systems, your local time will be messed up.</note> | <note important>Sigues consistent en la configuració de l'hora entre Sistemes Operatius quan tens una arranc dual. Si tens diferents configuracions en distints Sistemes Operatius, la teua hora local serà un desastre.</note> |
| |
====== Sources ====== | ====== Fonts ====== |
<!-- If you are copying information from another source, then specify that source --> | <!-- If you are copying information from another source, then specify that source --> |
* Originally written by [[wiki:user:vharishankar|Harishankar]] for the SlackDocs Wiki Project | * Escrit originalment per [[wiki:user:vharishankar|Harishankar]] per a l'SlackDocs Wiki Project |
* Based on Harishankar's blog article [[http://harishankar.org/blog/entry.php/how-to-set-your-computer-039-s-hardware-clock-to-local-time-and-make-linux-recognize-it|here ]] | * Basat en l'article del blog de Harishankar [[http://harishankar.org/blog/entry.php/how-to-set-your-computer-039-s-hardware-clock-to-local-time-and-make-linux-recognize-it|ací ]] |
<!-- Authors are allowed to give credit to themselves! --> | <!-- Authors are allowed to give credit to themselves! --> |
<!-- * Originally written by [[wiki:user:xxx | User X]] --> | <!-- * Originally written by [[wiki:user:xxx | User X]] --> |