Ask Klaus
Ask Klaus
Klaus Knopper answers your Linux questions.
Good Morning Klaus,
I am using Knoppix 7.7 obtained from Linux Magazine. I boot from a boot-only CD to an 8GB memory stick with an encrypted Reiser partition. The OS remembers my trash can on the desktop settings, personalized desktop wallpaper, and new background color.
Although the date and time is remembered, my time zone is reset back to the default New York on every boot. This causes some confusion with email date/time stamps. Is there a cure for this? I would much prefer to remain permanently in Johannesburg.
Thanks for the great software.
ted
First, a more general answer: The system time in a Unix system is composed of elements from two resources: The interpretation of the battery-backed clock (which exists on most Intel/AMD architecture boards) and the localization settings, which determine the time offset to Greenwich mean time (GMT), or rather "Universal time" (UTC). Although your question is more about localization, I'll look at the battery-backed clock setting first.
Under Unix/Linux, it is common always to leave the BIOS/real-time clock time in Universal time (UTC) and let the system time be set by time zone settings automatically during boot. Under Windows it seems common instead to have the real-time clock in "local time," and even rewrite the real-time clock time during the daylight savings time switch. It is possible for both operating systems to change the default "BIOS" time interpretation to either "localtime" or UTC; however, it's probably easier to do this under Linux than it is to search for an appropriate setting or registry patch or change a system setting in Windows.
When a Linux system reads the time from the battery-backed real-time clock, it honors the file /etc/adjtime
, which contains the word
UTC
in its last line if the BIOS time is expected in Universal time, or
LOCAL
if the BIOS time is stored as local time instead.
Changing this setting in /etc/adjtime
will change Linux behavior when reading the battery-backed clock with hwclock -s
during system start.
GNU/Linux systems will not write back their own system times to the BIOS automatically, unless instructed to do so during system shutdown, whereas Windows will do this frequently whenever time needs to be adjusted because of a winter or summer time change, so you might still experience differences when dual booting and it's time to switch between daylight savings and standard time.
Now the offset between this time reference and the local time adjustment determined by the time zone is set by a timezone file stored as /etc/timezone
. Normally, this file is created just once during system installation when time zone settings are interactively queried, which can also be done at a later point (Figures 1-3) using the Debian command
sudo dpkg-reconfigure tzdata
Because Knoppix is distributed as a Live system, the standard setting is to interpret the battery-backed clock time in local time "as is," with no offset to universal time. For easy changeability for non-Unix experts (who most likely don't know about the settings mentioned above), the timezone setting offset is guessed from the lang
variable (lang=en
, lang=de
, etc.) or set as an additional tz
boot command-line option, such as
knoppix64 tz=Africa/Johannesburg
either typed on the boot screen for the current session or written to the APPEND
option lines in boot/syslinux/syslinux.cfg
(boot/syslinux/syslnx64.cfg
in the UEFI boot variant for 64-bit and boot/syslinux/syslnx32.cfg
for the UEFI 32-bit variant) on the Knoppix USB flash disk:
APPEND lang=de apm=power-off initrd=minirt.gz nomce libata.force=noncq hpsa.hpsa_allow_any=1 loglevel=1 tz=Africa/Johannesburg
This is also (partly at least) documented in the knoppix-cheatcodes.txt
file found in the KNOPPIX
directory. To be on the safe side, you might want to add the timezone setting tz=area/region
to all APPEND
lines in the .cfg
files.
For an uncompressed Knoppix hard disk installation, the same setting can be placed in the KERNEL
configuration statement in the GRUB configuration file /boot/grub/menu.lst
.
Now your special setup of the boot-only CD with a USB flash disk is only a little more complicated, because the boot settings are read from the boot-only CD's isolinux settings in boot/isolinux/isolinux.cfg
, which is not easily changeable without remastering the CD.
For creating a new boot-only CD with changed settings, please do the following (Listing 1).
Listing 1
Creating a CD with Changed Boot Options
- Mount the CD.
- Copy the CD content to a directory.
- Make the copied content writable.
- Change settings, and then save the file (Ctrl+X in Nano).
- Create a new bootable ISO (if your system does not have the
mkisofs
command, usegenisoimage
instead). - Burn the new ISO image to a CD medium (use
wodim
ifcdrecord
is not available).
The new boot-only CD now contains the settings for your time zone.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.