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
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.