linkedin.com/in/wladimirmutel
x.com/muwlgr
youtube.com/channel/UCrawdAUSpvoXlfd-GeMj6tg
github.com/muwlgr

"Рви, ломай, круши!
Опрокидывай дома, поднимай на воздух! ...
Уничтожай, ураган, людей, животных, птиц!
Только лягушечек, мышек, змеек, паучков не трогай, ураган!"

(А. М. Волков, 1939)
This is an update to my older post at muwlgr.dreamwidth.org/52029.html .
I still have one remote Ubuntu 18.04 32-bit (i386) instance which is waiting for its CPU or MoBo upgrade. My older version of upgrade-lubuntu3264.sh had too many special cases to prevent it from failing when upgrading our real Ubuntu 18.04 installations, which had quite a lot of side-addons, such as Canon printer drivers, Remmina from Ubuntu PPA, and the like. To simplify the script, I installed 32-bit LUbuntu 18.04 into a virtual machine and tested the script by applying it to the initial 32-bit snapshot until I became satisfied with the upgrade results with a noticeably shorter script version (-43 lines).
The script upgrade-bionic-to-bookworm.sh has been renamed into upgrade-bionic-to-trixie.sh , with added step of upgrading Debian BookWorm to Trixie.
The script build-lubuntu-on-bookworm.sh has been renamed into build-lubuntu-on-debian.sh and gained logic for downloading Bionic .deb and source packages from within debootstrapped Bionic chroot, since updated apt in Trixie stopped supporting SHA1 signature verification. Also, more patching and rebuilding of Bionic packages has been added to reflect the changed structure of LXDE menus and required Debian/Ubuntu packages. As before, it creates a .tar archive in /tmp/ folder which you then need to copy onto any Ubuntu system recently upgraded to Debian and unpack it there.
The script install-lubuntu-on-bookworm.sh has been renamed into install-lubuntu-on-debian.sh and requires having .deb packages unpacked from the above mentioned .tar in the same folder where the script is run.
All these complex procedures became necessary to preserve the familiar experience of working with the system for not overly experienced users. As we remember, LUbuntu did not have essential changes from 10.04 up till 18.04, after which Canonical decided to migrate it to LXQt.
Most probably, after upgrading my last Ubuntu system to Debian, further development of these scripts will be stopped and they will become only historical curiosities, maybe useful for some borrowing and customization but not for direct use.
In my previous article at muwlgr.dreamwidth.org/54748.html I moved most my in-line scripts to GitHub
to save your efforts on properly copying and pasting them into your terminal window.
Now probably it is worth to briefly explan what is happening inside them.

The script at github.com/muwlgr/scripts/blob/main/debootstrap/populate.sh which you dot-include into your current session
creates initial folder structure, removes leftover Linux kernel and grub files from previous installs,
and fetches a copy of github.com/muwlgr/scripts/blob/main/debootstrap/mount-linux.sh
which could be used for mounting the debootstrapped system and accessing it from the host.

Then it allocates loop image files of given size and creates ext4 fs and swap space within them.
Then it mounts the root fs image and runs debootstrap on it to populate the initial system.
Before running debootstrap it copies eatmydata bins and libs if they are present on the host,
to speed up file operations which is especially useful on slow USB flash drives.
After running debootstrap the user is asked to change the host name of the bootstrapped system,
to be different from the one of the creating host.

Then some more folders are mounted into the target fs (boot , boot/efi if needed, and host),
apt
proxy configuration is copied from host into target if present,
and scripts github.com/muwlgr/scripts/blob/main/debootstrap/runme.sh
and github.com/muwlgr/scripts/blob/main/debootstrap/complete-stable.sh
are copied into the root folder of the target.

runme.sh script is used to bind-mount system folder such as /dev , /proc , /sys and others
from the host into the target and run root session in the target using chroot
Then the user is asked to continue system setup by dot-including complete-stable.sh into this root session.

complete-stable.sh
is doing the bulk of setup work which requires root permissions and is more convenient to be done from within the debootstrapped target, than from the non-root session on the host.

First, it converts apt sources.list into stable.sources corresponding to Debian Stable instance freshly installed in standard Debian way,
and runs apt update using network interface provided by the host.
Then it installs some essential packages like locales , tzdata and console-setup and asks the user to configure them.

Then it prepares the environment and configuration for grub installation
and adds needed entries to fstab.
And then it installs grub :
first, grub-pc is installed to get bootability on BIOS/CSM systems,
then, if needed, it is replaced with grub-efi-amd64 to get bootability on UEFI/SecureBoot systems
(without losing BIOS/CSM bootability left over after grub-pc installation).

Then comes the turn of initramfs-tools config fixes:
do_symlinks in kernel-img.conf is disabled, vfat modules added to the explicit modules list,
and two drop-in scripts are copied from github.com/muwlgr/scripts/blob/main/initramfs/hostloop-premount
and github.com/muwlgr/scripts/blob/main/initramfs/hostloop-bottom into local-premount/ and local-bottom/ folders
to implement loop= option handling in the cmdline of the booted kernel
in the same way as it is done in Ubuntu fork of initramfs-tools.

Then finally it becomes possible to install linux-image-amd64
so that it gets configured perfectly with the above fixes for grub and initramfs-tools.

Then complete-stable is doing some package cleanup,
and creating the simplest initial configuration for systemd-networkd and wpa_supplicant.

Then, within the same chroot root session, the user is asked to create the first non-root user and add it to the sudo group.
Typical Debian installation asks the user to set root password, then create a non-root user, and does not install sudo at all.
The approach with sudo package and sudo group I borrowed from Ubuntu as I liked it more : root password is locked, root operations are done only by a non-root user with sudo.

You may look into Ubuntu's initramfs handling of loop= option
at git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/initramfs-tools/tree/init?h=ubuntu/noble
and git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/initramfs-tools/tree/scripts/local?h=ubuntu/noble

Compare it to Debian's original version
at salsa.debian.org/kernel-team/initramfs-tools/-/blob/v0.148.3/init
and salsa.debian.org/kernel-team/initramfs-tools/-/blob/v0.148.3/scripts/local
to understand what functionality I have added by hostloop-premount and hostloop-bottom scripts .

You may also look into salsa.debian.org/grub-team/grub/-/blob/master/util/grub-mkconfig.in
and salsa.debian.org/grub-team/grub/-/blob/master/debian/patches/default-grub-d.patch
(or may be just look into your local copy of /usr/sbin/grub-mkconfig)
to understand the meaning of grub fixes in complete-stable.
Start with the line GRUB_DEVICE= and follow down to the end of loop including files from ${sysconfdir}/default/grub.d/
to understand why /etc/default/grub.d/hostloop.cfg should be created with its content.

And also you may want to see my comment to bugs.debian.org/700633 to understand eatmydata performance optimization for debootstrap (look for my surname Mutel closer to the end of the page).
This note is a kind of improvement over its earlier version at muwlgr.dreamwidth.org/48219.html .
I created a Windows10 installation media on a 64GB(57.7GiB) USB flash drive, where I still had >40GB of free space even after copying lots of additional useful software and drivers there.
The FAT32 volume contains EFI folder with all needed subfolders for UEFI/SecureBoot booting.
As well it has some boot code for BIOS/CSM systems not supporting UEFI.
I plug the USB drive into a running Debian 13 system, mount it as /media/someone/ESD-USB and cd into this folder in bash shell.
All the following operations are done within this folder
Note, with this setup, your linux folder is going to take at least 8 GB of storage space, most probably, closer to 9..10GB on the FAT volume
Later update: I moved most scripts into my GitHub repository to avoid repelling the reader with vast code blankets.
More explanations on how they work you may read in the follow-up article at
muwlgr.dreamwidth.org/54809.html.
So, what is left to do now, is :
( cd /tmp 
  wget https://raw.githubusercontent.com/muwlgr/scripts/refs/heads/main/debootstrap/populate.sh )
. /tmp/populate.sh

You may be asked about re-creating ext4 fs over already-initialized loop image.
Also you will be asked to set a new host name for a newly-debootstrapped system.
Then a root session will be started in the chroot of debootstrapped system.
And you will be asked (in green text) to run this :
. root/complete-stable.sh

You will need to confirm a number of apt installs and removes, as well as select your preferred locales, time zone and console font.
After the above steps, you should have a well configured Debian system, taking up to 600MB or 15..16% of 4GB root filesystem space
and needing only to add a first user with sudo rights, in Ubuntu style, that is, without root password :
# the script will ask you in green text to do the following :
u=user # choose your preferred name
adduser $u # set your password and other details
adduser $u sudo # give this user sudo permissions

Now type
exit # wait for umounts ; paste the following commands separately

sudo umount -v $target
cd
umount -v $base
and try booting this newly-created system on a real or virtual hardware.
If your UEFI BIOS does not recognize Debian boot loader and only boots Windows instead, plug your USB back into the original host system, mount it, cd into its root folder in bash shell and do this:
[ -d efi ] && { cd efi
 [ -d boot ] && mv boot ms-boot
 cp -av debian boot
 cd boot
 cp -av shimx64.efi bootx64.efi
}
Umount and remove the USB media, plug it into the desired system and try booting again.
If you want to restore Windows bootability, rename boot into deb-boot , and ms-boot back into boot .
Or you might meet a sane BIOS capable of recognizing multiple boot loaders in one UEFI ESP
See wiki.debian.org/UEFI and search for bootx64 in this page to learn more about this unpleasant topic.
Below some useful next steps are described :
Suppose you have been able to log in to the booted system as the user you have added before.
Ensure that you can run sudo id , enter your password and see uid and gid equal to 0, which means that sudo gives you root access.
If you have booted on some new/unfamiliar hardware, take a moment to review the printout of sudo dmesg | grep -i firm to see whether any drivers were unable to find their firmware files.
If you see messages about missing firmware files, find them using packages.debian.org and install needed packages using apt install

You may also want to install some useful packages to bring more familiar experience to yourself
(add sudo and eatmydata before apt install as needed - useful if your USB flash drive is slow on writes) :

bash-completion to improve Tab completion in bash command line;
command-not-found to automate searching for not yet installed packages;
man-db to read invaluable documentation within your running system;
openssh-server to access your system remotely;
rsync to optimally copy local and remote files over the network (works over ssh);
nmap and tcpdump to scan and diagnose your network, to discover its resources;
icewm xdm xorg xterm to get basic GUI environment in which you may run other GUI software
x11vnc to provide remote access to your locally-running GUI session
And/or xvfb to run GUI applications in headless mode (works over ssh port forwarding) and access them by x11vnc as well
Or maybe xpra.org to get more advanced remote access to persistent headless GUI applications (also works over ssh)
pciutils usbutils lshw smartmontools to discover, enumerate and learn more about the available hardware and its operation statistics
sysstat iotop to monitor storage i/o and its statistics, a useful addition to ps, top and vmstat from procps package
iw rfkill wireless-tools wireless-regdb wpasupplicant to take control over your WiFi adapter (already installed by the complete-stable script)
hostapd instead of wpasupplicant to turn your computer into a WiFi access point and router (ensure it has more than 1 network interface)
dkms to build out-of-kernel modules for your VGA or WiFi hardware
module-assistant for even better automation of the preceding task
You may be walking around with your bootable USB drive, plugging it into various computers, booting, logging in and trying to access the Internet.
Your systemd-networkd is configured for dynamic IP allocation for en* and wl* interfaces (see it by running grep . /etc/systemd/network/*.network ).
For en* interfaces everything should work as expected, just run ip a to see your allocated address.
For wl* interfaces there is additional configuration using wpa_supplicant.
First, a script in /root/wpa-networkd.sh to start wpa_supplicant for every found wl* interface; see its source at github.com/muwlgr/scripts/blob/main/wpa/wpa-networkd.sh.
Next, a short udev rule in /etc/udev/rules.d/99-wpa-wl.rules to start this script; see its source at github.com/muwlgr/scripts/blob/main/wpa/99-wpa-wl.rules.
It is attached to ACTION=="move" since udev usually renames (moves) the network interface the kernel initially names wlan0 after successful module and firmware loading.
May be it is worth to attach it to ACTION=="add" instead, testing will show.

If you see a wl* interface in ip a printout (with flags NO-CARRIER and UP), run sudo systemctl status | grep wpa and ensure you see wpa_supplicate@wl... service running for this interface.

Then you are ready to learn a minimal bit of knowledge on using wpa_cli :

Run it as root : sudo wpa_cli , and you will enter its command line with > prompt
Run scan and after some pause scan_results to see discovered wireless networks
Run add_network and remember the number of a newly-created empty network (denote it as N)
Run set_network N ssid "WiFiNetName" and set_network N psk "WiFiNetPassword" to set some name and password known to you for this network
Run enable_network N to let wpa_supplicant connect to this network
Run list_networks to see if you are connected to any network (marked [CURRENT])
Run save_config to save your updated network list
Run exit or type Ctrl+D to exit wpa_cli and return back to your shell
Then run ip a to see what addresses your interface had received.

wpa_cli together with systemd-networkd allow you to use your wireless interfaces without heavyweight management tools such as NetworkManager


My neighbors bought a Lenovo's "gaming laptop" for their teenage son, on which I helped them install Win11, activating it in a well-known way (search: massgrave).
Passed 2 or 3 months, they asked me if I can reinstall Win11 as the boy damaged it in some way during his gaming activities.
I took the laptop to review its state (and possibly to avoid throwing out the whole system and reinstalling it anew).
The symptoms I observed were :
  • Login takes too long after entering PIN or password, waiting for Desktop and Task Bar to appear
  • Inability to run any executable as Administrator using Windows File Explorer
  • Other mysterious effects, like invisible Windows Defender log items, among many others

I tried to run Autoruns or MBAM Antimalware on it but "Run as Adminnistrator" did not have any effect.
I searched Google on how to run administrative process from the unprivileged command line and found a recipe at https://learn.microsoft.com/en-us/answers/questions/1338912/how-to-run-powershell-as-administrator , namely,
Start-Process powershell -Verb RunAs
.
But trying this on the broken system only gave me a long pause followed by "Permission denied" error.
So I booted Linux from a USB stick, mounted nvme0n1p3 and moved the existing Windows folders aside, that is: cd into the mounted folder, make a subfolder named like save0, and moved Program*, Users and Windows folders from root level down into this folder.
This I did in the hope of being able to reinstall a fresh Win11 into the same filesystem without removing or reforrmatting it, and then to exchange the original Windows folders back (that is, by saving newly-installed Windows folders under save1/ and moving save0/* contents back into the root.
This approach often helped me restore Windows functionality in the past, starting probably from as long as WinXP.
So I booted from Win11 installation USB in the hope of a successful reinstall, and it showed me the 3rd NVMe partition as having 0 bytes available (free) and not having NTFS file system on it.
"Windows must be installed to a partition formatted as NTFS", you know ...
What the 'ell, thought I, then how Linux was able to see the same NTFS ???
After some fruitless Google search (where I found recipes to convert the GPT drive into MBR and/or back, or to fix up a protective MBR partition size), and by looking at the behavior of Windows recovery tools (which also refused to show C:\ contents), I came upon an idea that something could be wrong with root NTFS folder permissions.
Indeed, I found a really useful article at https://superuser.com/questions/1754797 which advised to save ACLs from a "good" system using icacls . /save file and restore them onto the "bad" system using icacls . /restore file .
This approach really helped me: I copied the "bad" NTFS partition to an external USB drive using gparted+ntfsclone, reformatted and reinstalled a new Win11 into the same space on the laptop's NVMe, then compared icacls printout from "good" newly-installed C:\ and from its "bad" USB copy visible in the same host as D:\ .
What I found was, that BUILTIN\Users and BUILTIN\Administrators ACLs present on C:\ were in some unknown way removed from D:\ (4 entries in total).
So I copied them using icacls /save, /restore and a text file , and oh wonder, this resolved the situation !
I only had to copy D:\ back into C:\ using Linux USB/gparted/ntfsclone, then ran a Win11 reinstall from its corresponding USB, then from Linux did the mv trick with save1&save0 , and oh wonder, the original Win11 booted intact within its entirety !
Run as Administrator worked perfectly for every executable downloaded before, WIndows defender log items have become visible again.
Happy, I returned the laptop back to my neighbors and received a small monetary reward from them for that :>


(code in Ruby)
First, let's get a 64-bit IEEE754 approximation of phi, and find a pair of Fibonacci numbers which approximate it well enough:
phi=(Math.sqrt(5)+1)/2
f1,f2=1,1
while f2.to_f/f1 != phi
 f1,f2=f2,f1+f2
end
p [f1,f2]
With Ruby's Floats, i.e. IEEE754 64-bit doubles, you should get [102334155, 165580141] as a result.
f1 and f2 will be the numerator and denominator in our search of reg.number ratios.
Next, generate regular (5-smooth) numbers, divide them by our phi approximation, and check if the quotient is also in the regular set:
require 'algorithms' # gem install algorithms
h=Containers::MinHeap.new([1]) # intermediate hash for reg.num.generation

require 'set'
s=Set.new() # set of generated reg.numbers

i=0 # to have this variable in the outer scope to while
while i<f2+f2 # choose your own upper limit
 i=h.pop # get minimal item from the heap
 s << i
 [2,3,5].each { |m| kk=i*m
                    h.push(kk) unless h.has_key?(kk) } # add its following reg.numbers to the heap
 j1=i*f1/f2 # truncated integer division
 j2=(i*f1+f2/2)/f2 # rounded, that is +1/2 then truncated
 Set[j1,j2].each { |k| p [i,k] if s.include?(k) and i.gcd(k) == 1 }
end
j1 and j2 could be identical, so we construct a Set[j1,j2] of their unique values
Also we use .gcd to drop non-unique representations of the ratio as (n*a)/(n*b)
This is the printout you should get as a result :

[1, 1]
[2, 1]
[3, 1]
[3, 2]
[5, 3]
[8, 5]
[9, 5]
[16, 9]
[27, 16]
[81, 50]
[16384, 10125]


So as you see, 214/34/53 would be a better approximation of phi than 34/2/52.
I would dream about a proof that there is no other regular numbers ratio even closer to phi, but my knowledge of the higher mathematics is only limited to my university diploma.
So you are on your own on what to do next with the reached conclusion :>
This note is incomplete, as I did not have any more power outages since Sep 03rd 2024.
So, I received my desufator BR 12-72 600 and on Aug 31st I put it into the operation, just having clamped its leads to my 2*12v serial batteries.
The next power outage I had on Sep 03rd, and my UPS lived 2.5h on my batteries. Earlier it was able to reach 2.5h using only its built-n batts.
So, right now the situation is still "wait and see". On Youtube, I saw a number of clips where authors advised to measure electrolyte density instead of battery voltage, and showed how this density grows up while voltage stays unchanged. Hope my deslufator would help with growing this density which I can't measure easily and exactly right now.

[ update as of Nov 18th 2024 ]: after continuously running this beeping box connected to my batteries terminals for more than 2.5 months, on the next utility power downtime I had battery runtime of only 2h9mins. Which indicates that my sulfation case is more serious than that could be resolved with this device. Its manual advises to use it with fresh batteries to prolong their useful life, and does not guarantee any decided success with old/sulfated ones, only some chance of success.
оригінал: Audiey Kao, MD, PhD, 2002, June
Слова пісні братів Маркс 1933 року "Країна йде на війну" звучать так: "Ми йдемо на війну. Я вважаю, що ми йдемо на війну"
Кіноексперти вважають "Качиний суп" братів Маркс найвеличнішим та найсмішнішим витвором кіномистецтва. Це класична комедія, недовга (70 хвилин), але дуже гостра сатира про націоналізм та диктаторів, дипломатію та війну, міжнародні інтриги та шпіонаж. Коли її вперше випустили, вона не здобула ані комерційного, ані критичного успіху. Глядачі були приголомшені такою нахабною зневагою, осміянням та цинізмом щодо політики у часи політичної кризи. Відомо, що фашистський диктатор Італії Мусоліні заборонив фільм у своїй країні за глузування з його режиму. На щастя, фільм було наново віднайдено студентами 1960х років та багатьма іншими.

У фільмі діє місіс Тіздейл, мільйонерша, що збирається подарувати $20 мільйонів Фрідонії, Балканській державі, що збанкрутувала через неправильне керування, тільки якщо ця держава згодиться зробити Руфуса Файрфлая (якого грає Граучо Маркс) своїм диктатором. Трентіно, посол сусідньої Сільванії, винаймає красуню Веру Маркал, щоб вона звабила та відволікла Файрфлая, так щоб Трентіно зміг зблизитися з мс. Тіздейл, одружитися з нею за здобути контроль на Фрідонією. Для допомоги у своїх витівках Трентіно залучає продавця арахісу Чіколіні (якого грає Чіко Маркс) та його друга Пінкі (якого грає Харпо Маркс) у якості шпигунів. Згодом спалахує війна, і після багатьох карколомних співпадінь та змін, Фрідонія здобуваає у ній перемогу. Зеппо Маркс, ще один з братів, грає у цьому останньому фільмі братів Маркс невелику роль Боба Роланда, помічника Файрфлая.

"Ми йдемо на війну. Я вважаю, що ми йдемо на війну". Всі ми бачили по телевізору, читали в газеті або чули по радіо, що наша країна у війні. Більшість політичних та військових спеціалістів кажуть, що ця війна не схожа на будь-яку війну минулого, адже наші противники не мають армій солдатів у традиційному сенсі. І хоча ми не отримуватимемо тіла наших загиблих братів та сестер у великих пакунках, у нас все одно будуть жертви. Але для багатьох з нас, чи дійсно війна відбувається? Яку роль ми можемо відіграти як громадяни або як медичні спеціалісти у цій війні, яку обрані нами лідери та більшість з нас визнали справедливою ?

У війнах минулого ми просили допомоги у громадян бататьма способами - постачайте їжу для наших бійців, переробляйте наші викиди, споживайте ощадливо, купуйте військові облігації, саджайте "сади перемоги", йдіть на фабрики. Зараз, переважно, майже ніхто з нас не просить віддати забагато часу - чи дійсно зараз відбувається війна?
 Багато наших колег-лікарів наражаються на небезпеку під час своєї служби у збройних сила США, і їх зусилля гідні усякої похвали. Нещодавно надійшли тривожні сповіщення про загрозу принципу медичної нейтральності, коли медичний персонал та споруди були вражені під час надання допомоги пораненим з обох боків конфлікту. Як професіонали, ми маємо засудити такі дії. Багато експертів вважають, що варто очікувати не чому, а коли наступна терористична атака трапиться на внутрішньому фронті. І наступного разу, атака може мати біологічну або хімічну дійову частину. Зважаючи на цю непозбувну імовірність, медики нестимуть велику відповідальність за її початкове виявлення та наступну турботу про тих, хто від неї потерпів. Як професіонали, ми маємо підтвердити наш обов'язок піклуватися та лікувати хворих та постраждалих, без упередження, хоча б під який ризик нас це не підводило.

Повертаюся трохи запізніло до моїх початкових коментарів. Для тих, кому цікаво, чому політичне шахрайство називається "Качиний суп", згадаю такий рецепт від Граучо Маркса: "Візьміть дві індички, одного гуся, чотири капустини, і жодної качки, і гарно їх перемішайте. Після першої ложки, ви ухилятиметесь від супу до кінця вашого життя"


In my past records (https://muwlgr.dreamwidth.org/50292.html), I noted that car batteries attached in parallel to my UPS internal batteries (after I drilled necessary openings to connect them) could greatly increase battery run-time of said UPS.
But after my first test with its impressive 19h+ runtime, I have got a great disappointment.
First of all, the charge my UPS was able to deliver to my upgraded(parallelized) battery setup in >17h, was able to sustain its discharge only for <4.5h on the next power outage (discharge cycle).
And on the next power cycles, it took 1h, 45m, and now it takes down of 45m on every test, that is 4.5A*h or 108 W*h at 24V.
On the local market I purchased an UPS model working from external lead-acid batteries, 2 of them, serial, 12V of each, called SVC SL-1KL .
Its specified charge current was 10A, that is, about 1/6 of its C (capacity in A*h)
I moved my car batteries from my APC SmartUPS 1000 to this SVC UPS, and plugged it into the AC socket first, and APC into its output.
And this 45min runtime was exactly what I have achieved with this setup and multiple charge-discharge cycles.
By watt-meter reading on the input and output of the SVC UPS, I concluded that it uses about 30..35W for its own purposes when feeding from AC utility socket (<75W output and ~105W average input).
Working from batteries, it draws about 6A at 24V, that is 144W, with the same <75W on its output, which means its inverter efficiency is around 50% which I did not like at all.
And when charging the fully-discharged batteries, the current does not reach even 6A (about 5.6..5.7A initially). In less than 2 hours, it drops to 0.24A, that is, "floating charge".
The current to/from batteries I measured with a simple clamping meter from AliExpress.
Currently I have ordered a "Battery Rejuvenator BR 12-72 600" from Aliexpress and am waiting for its delivery.
It is said to dissolve PbSO4 using high-frequency electric impulses.
There is even an experimental paper from some Nigerian guys showing that it really has its stated effect on a battery pack.
At the same time, I have received solar panels for my roof and am waiting for delivery of a solar inverter to improve my electric autonomy, as power outages in our area are going to get even worse in fall&winter.
I discovered that Debian 13 Trixie is not ready yet for everyday consumption, lacking not only packages bundled with Ubuntu such as sssd and dmraid, but also such my favorites as deborphan and crack-attack, which all are provided by Debian 12 Bookworm.
So I concentrated my efforts on improving scripts morphing Noble and Trixie into Bookworm
The steps are similar to those of upgrading Ubuntu 22.04 Jammy to Bookworm described at muwlgr.dreamwidth.org/52552.html :
  • Save initially-installed package lists and states, to be able to restore them in the future
  • Strip the system from non-essential packages to simplify upgrade of essential ones (small research on this topic can be seen at muwlgr.dreamwidth.org/52742.html)
  • Attach to Bookworm APT sources and disable sources for Trixie or Noble. Update package lists
  • Upgrade apt, dpkg, e2fsprogs, gzip to Bookworm-specific versions first, as they could break when upgraded along the rest packages.
  • Upgrade shim-signed to allow it being temporarily removed on the next step
  • Upgrade libapt-pkg6.0, watching for its potential loss of shared libraries, and reinstall manually-downloaded .deb with dpkg if this happens.
  • Upgrade all the rest packages except base-files, watching and fixing potentially missing shared libraries. Repeat this second time if needed
  • Remove t64 libs which are not provided by Bookworm
  • Upgrade base-files
  • Reinstall everything possible from saved lists
  • Install Debian's kernel and firmware packages
  • Remove running kernel
  • Remove extra packages pulled in by Debian's apt

The scripts are at github.com/muwlgr/scripts/raw/main/upgrade-noble-to-bookworm.sh and github.com/muwlgr/scripts/raw/main/upgrade-trixie-to-bookworm.sh , the latter being a minimal customization of the former, which I tested on Ubuntu 24.04 Noble Server, GNOME3 and Kubuntu/KDE virtual machines, as well as on my own laptop where I upgraded Kubuntu Noble to Trixie and then from Trixie to Bookworm.
Probably I could restructure upgrade-jammy-to-bookworm.sh into the same form as well.
I have one important Jammy host with MySQL 8.0 server, and finally, recently we have got MySQL 8.0 built for Bookworm by its vendor, so it would be useful and instructive thing to do.

Upgrade notes are mostly the same:
  • Special Debian account for gdm3, different from that of Ubuntu
  • Separate step of shim-signed upgrade to allow it to be removed/reinstalled later (Ubuntu version is marked critical and is not allowed to be removed)
  • gnome-session in Debian instead of ubuntu-session in Ubuntu
  • Split firmware packages in Debian, as well as differently-named linux-image and linux-headers packages
  • Apparmor configs need to be purged before installation of its lower version.
  • Some Bookworm libraries are not migrated to t64 (64-bit time_t).
    When their lower non-t64 version is installed, it replaces .so files in higher t64 installed version.
    Later, when t64 version is removed, it removes these .so files according to its list, so they become unavailable to dependent packages.
    I added a step to handle this kind of failures, where all dynamically-linked ELF executables are checked with ldd , all .so files not found by ldd are traced to their packages, and these packages are reinstalled either by apt reinstall or by dpkg -i as with libapt-pkg6.0.
    The worst offenders were libssl3 breaking systemd, libgdbm6 breaking man-db, and libdb5.3 breaking python3 , apt-utils and don't remember what else
  • Beware that there could be times where important packages are temporarily uninstalled from your system (such as kernel, firmware, network-manager, grub or shim-signed) so it could become unbootable or un-networked if you decide to reboot or reset it during these periods.
  • firefox-esr provided by Debian stable is at older version and would not open profiles upgraded to higher Firefox versions.
    It is possible to use Firefox builds from Ubuntuzilla, from Mozilla itself and/or probably from LinuxMint
  • On the completion of upgrade script, review what has changed (etckeeper would be helpful), what packages you might have lost (comparing current package lists with saved ones), what is left over from now-disconnected Ubuntu or Debian version (aptitude search '~o'), what firmware is potentially missing after the reboot (dmesg | grep -i firm , also look for update-initramfs messages when it updates initrd files)
I have got a bit lost with development of my Noble->Trixie upgrade script due to enromous package number installed with GNOME3 and KDE setups.
The simplest setup to upgrade was Ubuntu Server whose initial state does not contain GUI stuff at all.
So I decided to find a way to efficiently and significantly reduce package count on Ubuntu system, while still keeping it operating and accessible by network.
First, I debootstrapped a Noble environment in a subfolder and chrooted into it.
Then I added some useful packages and their dependencies: linux-image-generic , shim-signed , network-manager , openssh-server , screen , less and some others.
Then I listed installed packages and saved the list (stripping architecture suffix from libraries):
dpkg -l | grep '^ii ' | awk '{print $2}' | awk -F: '{print $1}' > /tmp/pkglist
Then I copied the list to my experimental Ubuntu VM, and by running apt remove --dry-run , found a package whose removal will remove the most of packages which depended on it directly or indirectly
The search looked like this:
minr=1
for i in $(comm -23 <(dpkg -l | grep '^ii ' | awk '{print $2}' | awk -F: '{print $1}' | 
                      sort -u) <(sort -u /tmp/pkglist) )
do newr=$(sudo eatmydata apt remove --dry-run $i 2>/dev/null | grep -cw Remv ) 
   [ $newr -lt $minr ] && continue 
   [ $newr -gt $minr ] && minr=$newr 
   echo '!!!!' $i $minr 
done
Initially it took quite a time, and the "champion" packages were found to be libxrender1 on GNOME3 and libfontconfig1 on KDE.
Their removal, followed by apt autoremove , removed >1000 Ubuntu packages (to be later reinstalled with Debian versions).

Then I repeated the search for next "champions", having found, in descending usefulness, libgdbm6t64 , libavahi-common-data , libasound2-data , libsharpyuv0 , libdw1t64 , tpm-udev , libdconf1 , libjson-glib-1.0-common , libpcre2-16-0 , emacsen-common , libcrack2 , libdrm-common , libllvm18 , libstemmer0d , pkexec , python3-blinker , python3-distro-info , at-spi2-common , liblmdb0 , liblzo2-2 , libtraceevent1 , x11-common , xz-utils , dmidecode , libaccountsservice0 , libip4tc2 , libmagic-mgc , libfcitx5* , libproxy1v5 , pci.ids .

The rest is probably not worth attention, as they remove only 1 depending package with each of themselves:
fuse3 , inetutils-telnet , install-info , libchewing3-data , libgnome-menu-3-0 , libmarisa0 , libncurses6 , libnuma1 , libpinyin-data , libunwind8 , libwhoopsie0 , linux-sound-base , tnftp , ubuntu-wallpapers-noble

So, what to do if you had accidentally upgraded to Ubuntu 24.04 and found that you actively dislike it ?
I made a script to upgrade it to Debian 13 Trixie which is now in Testing stage.
The script can be had from github.com/muwlgr/scripts/raw/main/upgrade-noble-to-trixie.sh .
(please read muwlgr.dreamwidth.org/53146.html for up-to-date upgrade script)
I tested it on Ubuntu, KUbuntu and Ubuntu Server 24.04, with BIOS and UEFI boot loader, under QEMU/KVM virtual machine.
Also used it to upgrade KUbuntu Noble on my Lenovo IdeaPad 5.

As Ubuntu development is following Debian Unstable (Sid), they often incorporate packages into their LTS releases which are newer than those in Debian Stable and even than in Testing.
So to transform recently-released Ubuntu LTS into as recent Debian Testing, some packages will have to be downgraded.
Their downgrade order is not obvious (not easily resolved by apt/dpkg facilities), and may break your system if followed improperly.
I found an adequate order by trial and errors on a virtual machine with easily-revertable qcow2 image snapshots.
Commmon approaches implemented in my script are the following:

  • Disable Noble APT sources. Configure Trixie sources and update APT package lists
  • For every installed package, query its versions with apt-cache showpkg and find version provided by Trixie package list, forming a list of explicit pairs package=version for apt installation.
  • Initially, upgrade apt and dpkg using these explicit versions. I also upgrade eatmydata in this step, if required.
  • Then upgrade/downgrade most other packages, except libc6 and base-files.
    Debian packages will be compatible with lower version of libc6.
  • Some Ubuntu libraries have migrated to t64 (64-bit time_t), while their Trixie counterparts have not.
    Need to find such pairs and install Trixie's non-t64 libs.
  • Then downgrade libc6 (libc6*, libc-*, locales)
  • Then upgrade/downgrade base-files.
    I found that even unpacking Debian's base-files when Ubuntu's libc6 is still installed instantly breaks all dynamically-linked executables installed on the host.
    That is, I became unable to run any of them and had to terminate my VM and to revert my qcow2 snapshot.
  • Then refer again to the original package list taken from Noble and try to reinstall all its packages which could have been removed explicitly or implicitly

Some more upgrade notes:

  • On gdm3 installation, Debian checks and/or creates user account and group called 'Debian-gdm'.
    Ubuntu creates the same with name 'gdm', also with the same home folder /var/lib/gdm3 owned by gdm.
    So before upgrading Ubuntu's gdm3 to Debian's one I explicitly/manually create Debian-gdm user and group with the same numeric IDs as existing Ubuntu's gdm, to avoid permission conflicts.
  • shim-signed is provided as a single package in Ubuntu but split into several packages in Debian.
    Its upgrade I made into a separate step with apt restart on unpacking/overwriting failure.
  • Debian Trixie does not provide sssd* packages right now.
    They exist in Bookworm and Sid but not in Trixie
    So your Active Directory integration will fall off during the upgrade.
    Hope this will be resolved before Trixie getting released as Stable.
    Similar absence was noticed for other smaller packages, like dmraid.
  • ubuntu-session package is not provided by Debian, have to explicitly install gnome-session.
  • Unlike Ubuntu all-in-one linux-firmware package, Debian has multiple firmware packages split by different hardware vendors and types.
    In my script I try to install these packages for most popular hardware types found on the host.
  • Noble's kernel is newer than Trixie's (6.8 vs 6.7).
    With some setups I could not get into GRUB menu to choose Trixie's kernel before next boot, so I added logic to remove running/active Noble's kernel before the reboot.
    Be sure to respond "no" to the query "Abort kernel removal?"
  • Noble installs AppArmor v4, while Trixie is still at v3 wth incompatible config syntax.
    So, need to purge Noble's AppArmor together with its config files before downgrading it to v3.
    As well, some Ubuntu packages install their own AppArmor profiles as conffiles, which are not downgraded by Debian packages.
    The script now backs up conffiles of such packages and purges them before reinstallation, but from my observation, Trixie's profiles for cups, rsyslogd and man-db are screwed in their own way.
    You will notice long [re]starts of these services with corresponding records in dmesg and journalctl.
  • Some Debian package pulls in gnome-user-share which pulls in apache2-bin , and some other package pulls in exim4-daemon-light. I checked that Ubuntu did not install gnome-user-share at all
    In a separate step I remove these packages, provided they were absent in the initial Ubuntu dpkg -l printout.
    Similar logic I added for lynx, mailcap, tk8.6, opensc and pcscd

Other notes are mostly the same as in my previous posts like muwlgr.dreamwidth.org/52430.html : watch what has changed, check what is missing.
Run aptitude search '~o' to find what packages on your system are still from Ubuntu (that is, from now-unlisted sources)
If you use a laptop or other less popular or more diverse hardware than just Intel/Realtek/NVidia, look into your dmesg for missing firmware files and find on the Internet where to get them (either from Debian packages, or from 3rd party sources).
Over the recent years, I have accumulated a number of dissatisfaction points with the way of Ubuntu development.
When it was initially created in 2004 as a set of improvements and fixes to Debian, Ubuntu was very useful and quickly became popular.
But in the course of its evolution, it has gained a number of unwanted marketing/advertising "inventions" which, to me, are just unacceptable.
Most noticeable of them are: aggressive pushing of snaps&snapd, dropping 32-bit i386 architecture, switching Lubuntu from LXDE to LXQt, adding paid Ubuntu Pro and ESM services, and probably some smaller others.
I created a few scripts to upgrade Ubuntu 18.04 Bionic to Debian 10 Buster and onwards to 11 Bullseye and to 12 Bookworm, which I described at https://muwlgr.dreamwidth.org/52029.html .
With impending release of Ubuntu 24.04 Noble , I simplified and customized my previous script, upgrade-bionic-to-bookworm.sh , for the purpose of upgrading Ubuntu 22.04 Jammy to Debian 12 Bookworm.
The script can be had from https://raw.githubusercontent.com/muwlgr/scripts/main/upgrade-jammy-to-bookworm.sh .
The only specific steps of upgrading Jammy->Bookworm was to downgrade signed GRUB and EFI Shim, as well as gcc and its associated libraries (which Jammy upgraded independently of Debian stable).

I have successfully tested this script, upgrading Ubuntu to Debian on my desktop, 2 portable USB drives and two smaller&simpler servers. Going to test it on larger servers in the nearest future.

After the upgrade and reboot, please review what packages have been removed now, and reinstall them from Debian sources.
For this you may repeat 2 last commands in the script, one of which compares saved package lists and other looks for removed packages in dpkg.log .

Upgrade note: Ubuntu MySQL client can be replaced with MariaDB client from Debian, which provides almost perfectly compatible libraries and command-line tools.
MySQL server 8.0 is not easily upgradable to MariaDB server, mysqldump upgrade is required.
So far I have installed MySQL server 8.0 for Debian 11 Bullseye as described at https://computingforgeeks.com/how-to-install-mysql-8-0-on-debian/
Upgrade note: Firefox from snaps can be replaced with Debian's firefox-esr package.
If ESR firefox creates a new empty profile on its first start, exit it and run firefox -P to switch it back to your existing profile.
Upgrade note: I have a libvirt/qemu/kvm virtual machine created with Ubuntu 14.04 Trusty.
To start it after libvirt upgrade to Debian 12, I had to edit its .xml description under /etc/libvirt/qemu/ and change its emulator file name from /usr/bin/kvm-spice to just /usr/bin/kvm , and its machine architecture from pc-i440fx-trusty to pc-i440fx-7.2.
All that I found by looking into journalctl startup logs where missing emulator and architecture were reported.
Upgrade note: isc-dhcp-server does not work well with apparmor. Remove apparmor package, or disable it, or switch to complain-only mode. Migration to kea-dhcp4-server would be useful in some future.

My next step will be to upgrade Ubuntu 24.04 Noble to Debian 13 Trixie which is now in testing stage.
On my laptop I followed the development of Noble so now it is my only system which is newer than Jammy.
In Aug 2018, I got a technical support side-job where I needed to maintain a "fleet" of 40+ moderately-to-quite old PCs with Linux.
When I started reviewing and inventorying what I have got, most of them had "UALinux LUbuntu Pack 14.04" installed.
As I understood, UALinux was supposed to provide some improvements in Ukrainian&Russian language support compared to "plain" [L]Ubuntu, but even as of 14.04, most of their changes were, to my experience, only branding-related.
On top of Lubuntu LXDE desktop, most used software included: Remmina for RDP access to Windows servers, PCManFM for access to local and networked file shares (using cifs-utils), LibreOffice, Firefox, simple-scan or other scanning software.
Hardware included mostly socket-775 motherboards with i945G/G31/G41 chipset and DDR2 or (less often) DDR3 RAM, typically 2 GB per host.
Some MoBos were really old, with socket 478 and DDR RAM, and some of them did not even have SATA ports.
Some were newer, with H61/B65 and even H81/B85 chipsets and appropriate CPUs (and still with DDR3 RAM).
All this stuff I managed to upgrade to LUbuntu 16.04, then to 18.04, keeping their OS and software packages 32-bit (i386) to save RAM with shorter pointer sizes, and enjoying the fact that LUbuntu LXDE environment did not have essential changes since probably LUbuntu 12.04.

Then, a number of unwanted changes were made from Ubuntu side.
First, LUbuntu 18.10 decided to switch from LXDE to LXQt.
Which could disappoint users and make them learn new less-familiar interface.
At these times, LXQt and PCManFM-Qt were less stable and displayed some unfamiliar and unwanted behavior to an inexperienced user.
Then, Ubuntu 19.10 dropped i386 support.
That is, [L]Ubuntu 18.04 i386 was now left without a clear upgrade path.

In this conservative mode, we stayed on LUbuntu 18.04 i386 for more than 5 years, up till early 2024.
During that time, new hardware appeared which was not supported by old HPLIP.
As well, lot of users demanded to have Viber or Skype on their desktops, which by then started to be provided in 64-bit(amd64) versions only.
Also, Ubuntu started more aggressively promoting their money-making technologies such as snaps, ESM, and so on.
Also they stopped building .deb-based Firefox and updating their 4.15 kernel, despite having promised to extend 18.04 support lifetime from 5 to 10 years (probably this was related only to Ubuntu Server parts, with paid Ubuntu Pro / ESM services).

Once, I decided that it is a time to "move the chip" and to implement my long-imagined plan.

First, I created, tested and improved a script to upgrade i386 Ubuntu 18.04 to amd64, which can be had from https://raw.githubusercontent.com/muwlgr/scripts/main/upgrade-lubuntu3264.sh .
This script will update your i386 system after a few iterations (restarts).
However, in complex situations you will notice that it is restarting the same operations and failing in the same way again and again.
Then you will probably need to intervene and to remove/upgrade problematic packages manually.
As well, if you turn off checking the release name, this script could upgrade your i386 LinuxMint 19.3 "tricia" setup which was based on Ubuntu "bionic", and which was the last LinuxMint version with i386 build.

Next script https://raw.githubusercontent.com/muwlgr/scripts/main/upgrade-bionic-to-bookworm.sh will upgrade Ubuntu Bionic 18.04 to Debian 10/Buster, 11/Bullseye and 12/Bookworm.
One problem with this script is that it may cut you off the DNS when resolvconf package is removed but systemd-resolved is not yet installed.
I just could not track down the exact place where this happens - it varied depending on what packages were installed.
Hope, you know how to fix the situation.

My next step was to rebuild lubuntu-meta 0.94.1 source package from Ubuntu Bionic under Debian 12/Bookworm.
The script can be had from https://raw.githubusercontent.com/muwlgr/scripts/main/build-lubuntu-on-bookworm.sh .
It will drop or replace some Ubuntu-specific dependencies, build needed packages (lubuntu-desktop, lubuntu-gtk-core, lubuntu-gtk-desktop) and pack them into an archive lubuntu-bookworm.tgz , which you then may reuse to install familiar-looking LUbuntu 18.04 themes/icons/sessions on Debian 12/Bookworm.
That is, you don't need to run this script anew on every system you have upgraded to Bookworm - just transfer and unpack this .tgz archive to any newly-upgraded Bookworm system.

And the last step, is to install rebuilt LUbuntu root packages on Debian Bookworm.
The script is at https://raw.githubusercontent.com/muwlgr/scripts/main/install-lubuntu-on-bookworm.sh .
Be sure to unpack your .tgz archive from the previous step so it could conclude its actions.
The script is mostly problem-free, only sometimes it could autoremove cifs-utils.
Hope you know how to reinstall them back.

 After these steps, the upgraded Debian 12 systems will look and behave surprisingly similar to the original LUbuntu 18.04.
However, some problems could be heard from users, which, fortunately, could be easily fixed.

  • we had cifs records in fstab with option sec=ntlm from previous setups.
    under kernel 6.1, this option had to be removed from the option list.
  • Ubuntu's language-pack* and *language-selector packages are not provided by Debian, so you have to run dpkg-reconfigure locales and to select all required locales to be generated (in our case, they were en_US, ru_RU, ru_UA, uk_UA, all with .UTF-8 encoding), as well as default LANG value for your runtime. This step I included into upgrade-bionic* script.
  • For certain versions of Windows RDP server (2012R2 at least), connection properties in Remmina should be changed to set "Advanced/Security protocol negotiation" from "Automatic" to "RDP". For xfreerdp, be sure to add "/sec:rdp" to its command line
  • we had to reinstall Canon CUPS drivers after i386->amd64 upgrade, and in most cases, to remove and rediscover/reinstall the printer, as its backend file name was changed.
    Same actions had to be repeated for Kyocera printers/scanners
  • for HP printers and scanners handled by HPLIP/HPAIO, we had to reinstall HP Plugin by running hp-plugin -i
  • Debian provides Firefox-ESR package which creates default-esr Firefox profile on its first run.
    To select former/existing profile, run firefox -P from the command line.
  • PCManFM started to ask if we want to open "untrusted" .desktop shortcuts.
    This can be turned off in PCManFM preferences.
    Or, "bad" desktop shortcuts can be removed from the Desktop and re-created from the Start Menu shortcuts (right-click on them to show the menu)

Among our current "fleet" we still have 2 or 3 32-bit-only CPUs, and 2 or 3 MoBos with 1 ot 1.5 GB of RAM.
As only the first of my scripts is dependent on i386/amd64 architecture , the rest of them could probably be applied to i386 Ubuntu to upgrade it to i386 Bookworm and to install Lubuntu packages on it.
I did not check this scenario but I believe it could work without additional issues.
Hope, we would receive needed hardware upgrades earlier that this would be needed for real.
Once I needed to write a not-that-complex script, which should copy "new" files from source folder into destination one, where "new" meant that files of the same name should be absent in both dest.folder, and backup folder, into which these files were moved after processing them by other software.
In Unix/Linux&sh/bash, the tool of choice would of course be comm(1), while in Windows&PowerShell, Compare-Object is most often used. So I made these functions,

function union { Compare-object @( $args[0] ) @( $args[1] ) -PassThru -IncludeEqual }

function difference { Compare-Object @( $args[0] ) @( $args[1] ) |
                      where {$_.sideIndicator -eq '<='} |
                      select -ExpandProperty InputObject }

, and shortly, after some experiments, I discovered that PS Item Objects, being kind of maps of named properties to their values, are not comparable by equality ($O1 -eq $O2) or by inclusion of an object into a list ($L -contains $O).
you may check that by yourself in some non-empty folder:

$a=(Get-ChildItem -File)
$b=(Get-ChildItem -File) # should be the same list, right ? wrong !
$a # their printout would look the same
$b # but this only confuses you more
$a[0] -eq $b[0] # False
$a -contains $b[0] # False

you may select only a single property from these Item lists, like:

$a=(Get-ChildItem -File | Select-Object -Property Name )
$b=(Get-ChildItem -File | Select-Object -Property Name )

but this would not improve your results as well.
What is worse, for Item lists taken from the same folder, Compare-Object would return properly-looking results, that is, "no difference between lists, all items are equal". But when you compare file lists taken from different folders, reviewing Compare-Object results would make you ask "What the hell?" (especially when you only select Name property from these Items).

In short, to compare file name lists successfully, you should get them as honest list of strings, that is:

function filelist { Get-ChildItem -Path $args[0] -File -Filter $args[1] |
                    select -ExpandProperty Name }

file lists formed in this way finally were able to be properly unioned and differenced with the above functions.
Windows NT Server 3.1 and later provided FTDisk.sys driver and "Disk Administrator" tool which allowed creation of software RAID sets from individual physical disks.
As far as PCs used BIOS, everything was fine and comfortable, that is, adding mirror for boot volume C: automatically added "boot from secondary plex" item to the boot menu.
But then, with Windows Vista SP1 and Server 2008 (non-R2), UEFI and GPT support had been introduced, which noticeably complicated boot volume mirroring, adding lot of manual steps.
Microsoft described them in their KB951985 , later turned into an article on Microsoft Learn.
An attentive reader would be able to perform all described steps and get his boot volume mirrored and tolerant to a loss of either of its halves.
But then, an unpleasant surprise awaits him when he decides to upgrade his Windows Server to its next version (like, from Windows 2008 R2 to Windows 2012 R2).
The upgrade process fails on its way, then gets reverted to the original Windows version.
I had 4 Windows servers in my "fleet", with identically configured mirroring, and their upgrade failed in the same way.
They all have 2..3 TB of data on C: on 3.5" SATA drives like WD Red (WD20EFRX/WD30EFRX), which would be copied to a cleanly-installed Windows in 4..6 hours, but this long downtime is undesirable.

After some experiments I found a way how to proceed with upgrade: need just to start Windows with one of mirrored C: halves disconnected, so C: gets into degraded mode.
Then it was possible to upgrade Windows 2008 R2 -> 2012 R2 -> 2016 -> 2019.
After completion of this upgrade, I reconnected other half of the mirror, started Windows again and resynchronized mirrored volume C:, which went through transparently to other OS operaion (except reduced I/O performance during resync of C:).

Apparently, when Windows upgrade finds more than one EFI boot partition, it fails and reverts the upgrade.
But when you temporarily hide this partition (by disconnecting physical disk holding it), the upgrade goes on as smoothly as one would expect.

Btw, I once tried to upgrade a smaller 2008R2 server using full copying, that is, install a new 2k8R2 to an single empty drive, copy mirrored C: volume from the upgradeable system to that drive, boot from the copy, upgrade it from 2K8 to 2K12->16->19, then empty one of the original drives, install 2K19 on it, copy upgraded C: back to it, boot from this copy, add mirror to the other original drive by Microsoft's recommendation. It was even harder than with 2K8R2, as in addition to EFI  (EF00) and MSR (0C01) partitions, 2K19 setup creates Recovery partition of type 2700, which you could not re-create on the second drive, and when you try to recreate it using diskpart or gdisk, after that you could not convert the drive into Dynamic format. So my mirrored volume was added to the second drive with different partition offset than the first. Hope this would not bring any serious harm.

Overall, Windows Server upgrade on a temporarily-degraded mirrored boot volume was the simplest way among all others tried and/or imagined by me.

In Aug 1991, Linus Torvalds rolled out to the world his creation, the Linux OS, which he developed and debugged on his PC/AT-386 with 4 MB RAM.
Long time since then, 80386SX with 2MB RAM was the lowest specification allowing you to run a full-featured Unix-like OS.
But to our great regret, with Linux 3.8 released at the beginning of 2013, 80386 support had been removed from its kernel.
So you had to own at least 80486SX to run Linux which of course was much less encouraging for historically-curious IT hardware researchers.
Moreover, in their respective times, 80386 support had also been removed from once-everywhere-portable NetBSD (since v5.0 in Apr 2009) and from BuildRoot (since 2016.05 in May 2016).

Now it is a turn to tell about my personal part in this story.

In about Aug 2000, I had been donated a beautiful, Japan-designed, Chinese-made AT-386 PC of "Laser" brand.
It worked since about 1992..1993 at a local FM radio station.
They donated it to me for Internet services I helped provide to them at that time, when they decommissioned this PC after some upgrade.
It has a quite advanced motherboard, compared to most PCs of its epoch, with IDE/Floppy/COM/LPT ports built-in (while you had to plug an additional Multi-IO card into most of then-time MoBos).
It has 16 30-pin SIMM slots, and I got it with 16 1-MB SIMMs plugged in, which is a significant amount of RAM for a system on which you would run MS-DOS, Novell Netware or Windows 3.11.
It also has an 6-port ISA bus riser or a "fir-tree" as it was called in Russian/Ukrainian.
The CPU is a real Intel 386DX, not some of AMD/Cyrix clones. Without 80387, there is a free socket for it.
It has a sticker "Yes it runs with Netware" but surely you needed to plug your own Ethernet adapter to be able to do any networking.
It had a Realtek RTG3105 VGA adapter, very typical for its times.
To bring it back to life, I had to revive its DS1287 CMOS chip (you know, file off its plastic case over certain pins, where its built-in CMOS battery is soldered, cut off the battery outputs, and solder your own external 3V battery box with 1*CR2032 or 2*AA cells to the chip's inputs instead).
For a very small money, I was able to buy a used Realtek 8019 NE2000-compatible 10BaseT Ethernet adapter (which, besides CAT5/RJ45, has a BNC 10Base2 and a DIX 10Base5 connectors).
Also I replaced its IDE HDD with IDE-CF adapter and 32MB CF SSD plugged into it.

Having all this wealth at my hands, I started to think how to exploit it in the most advanced way.
As a DOS platform, it worked perfectly, with DPMI your Doom or C&C would reasonably fly on it.
But I wanted to run something more modern.
Somewhere in Apr..May 2012 I downloaded BuildRoot 2012.02 and was able to build Linux userland with uClibc, Busybox and OpenSSH 6.0, Linux kernel 3.3.2, SysLinux/EXTLinux, and boot it on this hardware.
My host system was most probably Ubuntu 12.04 (Precise) with GCC 4.6.
The target kernel failed on boot since it started blindly using 486's instructions not available on 386, so I had to do some patching to make it work on 386. To do this, I had to build the kernel with debug information and then find the crash places with objdump -d .
Having achieved and enjoyed its bootability, network auto-configuration and even SSH access, I stashed the whole system into my closet for another 10+ years.

Sorting out my legacy boxes in Sep 2023, I decided to check if this "Laser" still works. To my surprise, it only lost HDD geometry from its CMOS setup, but it kept almost the proper RTC date&time. The battery box had discharged to abot 2.9V but after re-entering HDD geometry (490C, 4H, 32S for a 32MB CF card) it did not ever complain about discharged battery as it did before the "revival".

Now I wanted to bring some improvements into the small system I built and put on a CF card. First problem I had in 2012 was that DropBear SSH service did not start, having segmentation fault which I could neither easily debug on the target system, nor easily reproduce on my then-host (which had much more modern Core i3-380UM CPU with hardware virtualization and without these specific 80386 restrictions in its command set). Which is why I had to use heavier OpenSSH.

One more problem was that OpenSSH v6.0 which I had to use instead of DropBear, used only SHA1 hash in key exchange, while OpenSSH v9.3 on Ubuntu host required using SHA256. As a result, public-key SSH login from host to target stopped working.

And the biggest problem was that Ubuntu 23.10 (Mantic), then heading to its soon initial release, had GCC v13 which was unable to build either older kernels including v3.7.9, or older GCC versions (v4.*, v5.*). I got the oldest x86-i686-uclibc-2017.05 toolchain from https://toolchains.bootlin.com/releases_x86-i686.html (gcc 5.4, uClibc-ng-1.0.24, binutils 2.27) which allowed me to complete building BuildRoot 2016.02, but as its uClibs used i686 commands, it was unable to run BusyBox/init on the target 80386.

Fortunately I kept a copy of 2012.02 BuildRoot tree, unpacked, configured and built at these happy times in 2012 when everyone mostly honored 80386 architecture. So I could bump DropBear version from 2012.55 up to 2022.83, rebuild it with needed options and update its installation on the CF card. After that, DropBear started working as expected, so I would not need OpenSSH anymore. Only had to replace OpenSSH host key with DropBear's in my known_hosts.

So now I am again able to update my target system over the network, instead of re-plugging its CF card between target and host every time. SSH login with a public key and running a short command ( like ssh user@target date ) takes about 21 seconds. Definitely not a "speed demon" but still it allows more control and comfort. BogoMIPS value in dmesg is about 6.40 which probably corresponds to 33MHz CPU clock.

Some of my planned future steps for this ancient box would include: replacing its AT PSU with ATX-AT adapter and a DC ATX PSU. Will compare its power consumption before and after. BTW, this will make the system completely fanless and solid-state. Then, I would replace its AT/DIN5 keyboard with PS/2-DIN5 adapter and a PS/2 keyboard which is more accessible in the local market. Also, bumping CF card up to 512MB would not hurt.
On the software side, it would be kernel upgrade to 3.7.9, and trying to find a way of building 80386-only uClibc+gcc+binutils toolchain which I could provide to BuildRoot 2016.02. Also I am curious in enabling IPv6 support in the kernel to impress everyone interested remotely in this way :>

Update from Oct 03rd: I received ATX-AT adapter and put it into work. For its power switch, I used a tumbler button bought at local car parts market. For its ATX PSU, I used LR1106 which performed poorly with my main ATX box. For its external 12V DC source, I used SC-120-12 and TS-IPS-V02 mentioned at https://muwlgr.dreamwidth.org/50053.html and some times before. The overall setup is quite stable, fanless, that's completely silent, and draws <24W when its SLA battery is fully charged.

Update from Oct 17th: I received PS2->AT convertor and was able to plug a PS2 keyboard into AT motherboard's DIN5 connector. AT/DIN5 keyboards are close to disappearing on the local market, while PS2 KBs are still sold readily.
this is a follow up to https://muwlgr.dreamwidth.org/50292.html and https://muwlgr.dreamwidth.org/50053.html

I removed an extra battery-powered PSU from my setup (that is, SC-120-12 and TS-IPS-V02/V04 connected to it)
And I fed my network boxes (a switch and 2 copper-optical converters mentioned before) directly from my [old?] trusty LD-A300W, using one more Molex->2Molex extender, a cut-inside Molex M-F cable,  and a pair of very simple but convenient clamping wire connectors instead of screwing ones.
I needed only 5V and 12V, so it seemes reasonable to take them from ATX PSU directly. By my Watt-meter indication, power consumption at the APC SmartUPS 1000 inlet had increased by 5..6 W, but it still did not reach 70 W, keeping around 68..69 W.

We are entering a new season of potential rocket attacks and blackouts caused by them, so it would be interesting to check how long the whole setup will live on its extended batteries.

Btw, I discovered that flooded lead-acid batteries do bubble on their charge at about 13.8V, which may be heard by unarmed ear. But as far as these sounds resemble bubbles in a carbonated drink or beer, it is safe. Worse is when they resemble boiling and are heard as hisses or whistles through gas-release openings of the battery.
Once I noticed that 4875 miles equals to 7845 kilometers.
Surprised by this fact, I decided to find other pairs of such kind.
Wrote a script in Ruby like this :
mmm=11*16*10*3*12*254/10 # 1609344 mm in 1 mile
(1000...6213).each{|i|
 mm=i*mmm/1000000 # convert mms into kms, dropping fractional part
 p [i,mm] if i.to_s.chars.sort == mm.to_s.chars.sort
}
Upon running it, I found that there are 14 pairs among 4-digit lengths in miles and kms.
Then I scaled the range up to 10000...62137 and found 43 5-digit permutation pairs which included certain 4-digits originals together with their neighbors. Like,  [1625, 2615] and [1626, 2616] turned into [16247, 26147] and [16248, 26148], and so on. While some other permutations observed for 4-digits had simply disappeared for 5-digits. Like, [1138, 1831].
Then I scaled the range further up to 100000...621371 and found 153 6-digit permutations which brought me back the pair like [113892, 183291] close to the one observed for 4-digits, as well as [4875, 7845] growing to [48741, 78441], [48742, 78442], [48756, 78465] and then to [486937, 783649], [487351, 784315], [487410, 784410], [487411, 784411]

Then I reduced the range down to just 100...621 and found 4 pairs there, that is, [119, 191], [325, 523], [591, 951], [592, 952].
No permutation pairs have been found in even smaller range, 10...62

Probably these sets are worth to be plotted on some kind of 2d logarithmic scale, will try to do that later.

[update:] translated it all into Python and created a Jupyter notebook at https://colab.research.google.com/drive/1eL_lqvNBO1W9_lEGOrphM05SU4rcNu4h with a kind of basic plot, also with a graph connecting shorter and longer numbers with similar mantissas. Please review and suggest your improvements



Це не довге, проте дуже повчальне оповідання було написано у 1991-му році, коли Рад.союз вже рухався до припинення свого існування.
Вперше я прочитав його, певно, у 1992-му, і воно мені запам'яталося.
Після подій 2014 року я знайшов його текст у букіністів та виклав його на домашньому сервері ( https://muwlgr.dreamwidth.org/41292.html ).
І от через 9 років, коли ми вже маємо і повномасштабне вторгнення, і ChatGPT, і інші прояви штучного інтелекту повсюди, я перечитав його знову, виправив декілька дрібних друкарських помилок, і знову раджу його перечитати всім зацікавленим.
Page generated Sep. 27th, 2026 05:30 am
Powered by Dreamwidth Studios