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
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.
-
CachyOS Adds Support for System76's COSMIC Desktop
The August 2024 release of CachyOS includes support for the COSMIC desktop as well as some important bits for video.