Ceci est une ancienne révision du document !
Table des matières
Comment synchroniser votre horloge système avec votre horloge matérielle ?
Aperçu du problème
Si vous avez plusieurs distributions sur le même machine, vous pouvez renconter le problème de temps inconsistant entre les distributions. Par exemple, si vous avez pouvez démarrer votre ordinateur avec deux distributions différentes, Distro X et Distro Y, il vous faut régler l'horloge matérielle du BIOS pour afficher l'heure locale.
Si la distribution Distro X est configurée pour lire l'horloge matérielle comme heure locale, elle affichera une heure correcte, mais si elle est configurée pour lire l'horloge matérielle comme une heure UTC, alors elle affichera une heure incorrecte
Cet HOWTO vous propose une solution simple et unique, valable pour toutes les distributions qui vous assurera d'avoir votre horloge matérielle toujours réglée sur l'heure locale ( ou UTC si vous préférez).
Procedure to Synchronize the System Time to Hardware Clock
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.
Assuming you are dual-booting Distro X and Y, first boot into Distribution X. First check the hardware clock with the following command.
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,
Update via NTP: If you installed the ntp package you can:
ntpdate pool.ntp.org
-or-
Manual update:
date --set "5 Aug 2012 12:54 IST"
Obviously in the above command you must set your date, time and time zone correctly.
Now as root, synchronize the hardware clock to the current system time as local time.
hwclock --systohc --localtime
Now the hardware clock is readjusted to the system time and both now point to the local time.
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.
Syncing to UTC instead of Local Time
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
hwclock --systohc --utc
while setting the hardware clock from your system time.
Sources
- Originally written by Harishankar for the SlackDocs Wiki Project
- Based on Harishankar's blog article here