How to upgrade Linux to FreeBSD remotely via SSH?

The answer is simple: download and use my script.

Time runs fast, MBR evolved to GPT, BIOS to UEFI and I followed the footsteps of good old Depenguinator 2.0 and 3.0 to bring some Christmas magic to the end of 2021 year.

This is a very early draft, the script abilities are very limited, there are a lot things to implement and many bugs to fix, but it runs fine on my laptop successfully installs FreeBSD 13.0 over the default CentOS Linux 8 on a VirtualBOX machine.

Notes

  1. The script is extremely dangerous, it can easily ruin your OS, data and life. Do not run it in production or on the system that has any value. You have been warned!
  2. Network connection required: linux2free.sh downloads files from Internet
  3. Currently the linux2free.sh script supports UEFI only boot. Sorry for MBR scheme, perhaps someday I’ll add it (or not)
  4. Only Redhat based Linux distributions are supported
  5. The resulted FreeBSD system is very minimalistic. It uses a simple custom starup scripts to bring up network interfaces and start sshd, you have to configure the system and install additional packages yourself
  6. linux2free created a boot EFI partition and a small ZFS filesystem for FreeBSD to start up, but the rest of the space formerly used by Linux has to be redistributed manually.

Installation

sudo dnf upgrade -y
reboot
wget https://raw.githubusercontent.com/mezantrop/linux2free/master/linux2free.sh && sudo sh linux2free.sh

TODO

  •  Allow root to ssh in remotely
  •  Set default router
  •  Support more Linux distributions
  •  Make the code better (Oh, there are plenty things to do! See TODO remarks over the script body)

History

2021.12.25  v0.1    Mikhail Zakharov <zmey20000@yahoo.com>  Initial version
2021.12.26  v0.2    Mikhail Zakharov <zmey20000@yahoo.com>  SSH root login, default route, resolver

Don’t hesitate to enchance, report bugs or call me, Mikhail Zakharov zmey20000@yahoo.com

Posted in My projects | Tagged , , , | 5 Comments

“— Это не котельная! Это, извини меня, какая-то Сорбонна!..”

В одном из чатиков меня недавно спросили, а кто я, собственно, такой? Поскольку “айтишник”, как я себя определил, это очень расплывчатое понятие и может означать все, “что угодно от человека который заправляет принтеры по кернел разработчика”.

И тут мне почему-то стало неловко за вопрошавшего. Нет-нет, умом я понимаю, что никакого злого умысла или бытового пренебрежения в его устах конечно-же не было и быть не могло. Ну, в самом деле, нынче в кого ни ткни курсором мышки, все айтишники как на подбор. Однако же, в ухе зазвенела тетива, а в сердце ткнулась знакомая заноза.

Может быть это из-за того, что в памяти всплыли картинки из тех пыльных дней, когда я тоже был в самом низу IT-иерархии? Когда-то давно, я должен был стать юникс-админом в большой корпорации, но не сложилось. Время такое было: двухтысячные. Вместо этого мне пришлось посмотреть на развалины фирмы и отправиться в другую сторону, заправлять принтеры, переустанавливать форточки и починять примусы.

А до того, было время, когда я работал преподавателем на ставке лаборанта, а перед тем, не поверите, числился сантехником (да-да, такова у меня была самая первая запись в трудовой).

Одновременно со всем с этим я кодил, писал патчи и кропал статьи (в то время некоторым IT-авторам за это даже иногда платили). И пусть, я не дорос до той самой котельной, но был ли я эникейщиком? Сантехником и лаборантом? Да, был. Но не только же ими, правда? И не только я один такой.

А в иное время, работая уже на крупную телекоммуникационную компанию по достаточно редкой IT-специализации, я также был и заядлым графоманом под настроение двухчасового хоббита на работу и такого же путешествия обратно. Так, что если угодно, то Интернет все помнит: http://samlib.ru/f/fri_i_n, все видит: https://proza.ru/avtor/idfree

Так, что может быть, сойдемся просто на IT-шнике?

Ну, а если нужны подробности, то мою более или менее полную официальную IT-шную карьеру можно увидеть на LinkedIn: https://www.linkedin.com/in/mikhailzakharov

Менее официальные, но не менее для меня увлекательные, IT-интересы можно попытаться проследить по постам блога: https://mezzantrop.wordpress.com.

Ну, или просто поискать в гуглах по имени и фамилии (исключив из выдачи спортивного однофамильца, или приписав какой-нибудь IT-постфикс вроде UNIX или SAN/STORAGE.

Posted in IRL, My projects | Tagged , | Leave a comment

Notes on Installing SCO Open Desktop Release 3.0 in 2021

SCO UNIX was the successor to the Santa Cruz Operation‘s variant of Microsoft Xenix, derived from UNIX System V Release 3.2 with an infusion of Xenix device drivers and utilities. SCO UNIX System V/386 Release 3.2.0 was released in 1989, as the commercial successor to SCO Xenix. The base operating system did not include TCP/IP networking or X Window System graphics; these were available as optional extra-cost add-on packages. Shortly after the release of this bare OS, SCO shipped an integrated product under the name of SCO Open Desktop, or ODT. 1994 saw the release of SCO MPX, an add-on SMP package.

https://en.wikipedia.org/wiki/OpenServer

Having no suitable hardware, I will use VirtualBox to emulate a machine with very basic characteristics:

  • OS: Other/Unknown, 32bit
  • HDD: 512MB
  • RAM: 64MB
  • Network: PCnet-PCI II

Installation procedure

Installation is quite a straightforward but, probably a little annoying procedure due to the large number of diskettes that have to be inserted. Luckily, in the virtual environment, there is no need to do everything physically:

  • Create a VirtualBox guest machine with the above shown characteristics
  • Grab the OS distribution here: https://winworldpc.com/download/41c2b04d-2d18-c39a-11c3-a4e284a2c3a5 and extract files from 7-zip archive.
  • There is a file serial.txt with serial number/code – Sn: SOT552746, Ak: kqpzdsso which is for SCO Open Desktop Release 3.0
  • Distribution missed N1 boot disk. Grab it from SCO FTP server: ftp://ftp.sco.com/pub/SLS/uod383bon1.Z, don’t mix it with the other boot disk which is for SCO UNIX OS: uod383bun1.Z. Uncompress the boot disk image and rename it just to look nicer:
$ uncompress uod383bon1.Z
$ mv uod383bon1 uod383bon1.img

Hints

  • Use Keyboard Mouse for the pointing device.
  • If you selected wrong mouse during installation, you probably unable to use X-window. Press Alt-F1 to switch to the first virtual terminal. Login as root and execute:
# mkdev mouse

to configure the mouse, rebuild kernel for the new device and update configs.

  • AHS/SLS directories contain *.ltr and *.doc files documenting installation procedure for each of the update bundle.

Posted in OS in the VirtualBox | Tagged , , , , | Leave a comment

NoneType issues in chains of inherited dictionaries in Python

There are good hints to avoid errors like:

AttributeError: 'NoneType' object has no attribute 'get'

in the brilliant Python tips 1: beware of Python dict.get() post.

Posted in Tips & tricks | Tagged , , , | Leave a comment

How to add/edit a userform in Excel on Mac?

Haha, surprise! There is no way to add or edit user forms on Mac since Excel 2011 🙂

Posted in IRL, Misc | Tagged , , , , | Leave a comment

CentOS Linux becomes beta RHEL?

According to the latest schedule, CentOS Linux reaches its End-of-Life in December 2021:

As it’s announced in the CentOS blog that “the future of the CentOS Project is CentOS Stream” which “tracks just ahead of a current RHEL release“, and its recommended:

If you are using CentOS Linux 8 in a production environment, and are concerned that CentOS Stream will not meet your needs, we encourage you to contact Red Hat about options.

Posted in IRL, Misc | Tagged , , | Leave a comment

It’s not on the approved list in Screen Time!

Dear Apple, how dare you demand me to approve internet sites I’m visiting via the… this… nasty Screen Time application?

Posted in IRL, Offtop | Tagged , , | Leave a comment

A single write locks the entire SQLite database for both: reading and writing

This fact is quite an unpleasant thing for a database with a lot of writes and relative seldom reads like, for example, a small packet capturing tool I write for my router.

The classical mechanics of SQLite locking is described here, but if you face the same problem as me, you probably would want to enable WAL – Write-ahead logging feature, which can solve the issue of SQLite DB locking:

The traditional rollback journal works by writing a copy of the original unchanged database content into a separate rollback journal file and then writing changes directly into the database file. In the event of a crash or ROLLBACK, the original content contained in the rollback journal is played back into the database file to revert the database file to its original state. The COMMIT occurs when the rollback journal is deleted.

The WAL approach inverts this. The original content is preserved in the database file and the changes are appended into a separate WAL file. A COMMIT occurs when a special record indicating a commit is appended to the WAL. Thus a COMMIT can happen without ever writing to the original database, which allows readers to continue operating from the original unaltered database while changes are simultaneously being committed into the WAL. Multiple transactions can be appended to the end of a single WAL file.

To enable WAL, execute:

sqlite> PRAGMA journal_mode=WAL;

Good news, it’s persistent and required to be run once.

Also additional tuning can be done, like setting: PRAGMA journal_size_limit=N, PRAGMA wal_checkpoint(<MODE>) or PRAGMA synchronous=FLAG, but it’s strongly advised to read documentation before changing something.

Finally, as always, remember to call sqlite3_finalize() after the prepared statement is no longer needed, or you risk locking the database which in the case of WAL leads to the checkpoint starvation and uncontrolled grows of the WAL file.

Posted in Tips & tricks | Tagged , , , , , , | Leave a comment

RAIDZ on-disk format vs. small blocks

Possible ZFS performance problems with small blocks, block alignment and much more explained by Mike Gerdts.

Posted in Copy-paste, Storage | Tagged , , , , , | Leave a comment

Modelling basic architectures of data storage systems

Nowadays majority of the modern and powerful block-level storage systems around the world are built to work in expensive Fibre Channel or more cheaper iSCSI SAN environments. Independent of their class, capacity and performance they are created on well-known principles, technologies and architectures. Furthermore some of these systems are using common servers for their controller hardware with Linux or even AIX as storage operating systems on-board.

In this paper I will describe some of the basic SAN oriented data storage architectures and also model their design using FreeBSD (https://www.freebsd.org) as the operating system and VirtualBox (https://www.virtualbox.org) as the hardware emulator. All the specific FreeBSD solutions in this document are based on my BeaST storage architecture (https://mezzantrop.wordpress.com/portfolio/the-beast) project publications.

Posted in BeaST, My projects | Tagged , , , , , , , | 1 Comment