Home About Now Archive RSS

A kilo is 1024 when talking about computers

A kilo is 1024 in digital electronics because that is how binary numbers work. This is an undisputed fact. I grew up when everyone using a computer knew that a binary kilo was 1024, Mega was 1024 x 1024, Giga was 1024 x 1024 x 1024, and Tera was 1024 x 1024 x 1024 x 1024. Nobody was confused even if binary kilos used in computing are different than decimal kilos used when buying vegetables. Nobody used incorrect decimal kilos about computers before greedy hard drive producers wanted to pretend they made larger disks than they did in the late 90s.

If you think we should use kibi, Mibi, Gibi and Tibi, then please educate yourself on binary numbers, remember that most words have different meaning in different contexts and that nobody had a problem with binary kilos in computing before hard drive producers started to confuse people by using incorrect decimal units in a binary context. People like me that (continue to) use the correct binary units in a binary context should not change their language to appease those who use the wrong decimal units in a binary context or those insisting that we should use different units to avoid confusing the people that don't know the correct units. The solution is that everyone uses the correct binary units in a binary context and uses decimal units only in decimal contexts.

The real problem is that new users are no longer told by magazines, books, websites, online videos and people in the know that 1024 is a kilo when you use a computer because some people incorrectly insists that it is not, either because they don't understand that people are perfectly capable of using words with different meanings in different contexts, or are ignorant of how computers work. Those of us lucky enough to grow up when correct use of binary units was the common practice know that it is in no way, shape or form a problem for anyone to know that a kilo in a binary context is 1024 and in a decimal context is 1000 if you just tell them that, unless you make it a problem by insisting that the incorrect use is correct. Luckily, good software like the GNU Coreutils uses the correct binary units, so there is no confusion except for people that are ignorant.

Boot RaspberryPi OS on an NVME larger than 2TB

RaspberryPi OS boots from an EFI partition. On other hardware, an EFI partition is used with UEFI which demands that your disk is GPT-partitioned or a hybrid GPT with MBR. However, the RaspberryPi imager and the installer you get when pressing Shift at boot uses MBR. MBR is a way to partition a disk that we used in the 1980s and that made sense back then, but it has the unfortunate limitation that it cannot use disks larger than 2 TB. So when I bought my 4 TB NVME to use with my Raspberry Pi 5, I was unpleasantly surprised that after installing RaspberryPi OS light, I could only see a 2 TB disk.

There are various solutions floating around the internet to get around this problem, but most of them are unnecessarily complex. The RaspberryPi 5 can boot from a disk partitioned with a GPT partition table just fine. The problem is just to get the right partitions with the right data onto the disk since the installer insists on using 1980s technology which means that you cannot use it on large disks. In the early 80s, a large hard drive had 40 MB capacity, so 2TB seemed like science fiction. Who would need all that space when Macintosh System Software, a few programs like MacWrite and MacDraw and a dozen files could fit on a 800kB diskette? (The Double Density 3.5 inch floppy disks that gave 720kB space on MS-DOS delivered 800kB on a Mac.)

In addition to your NVME, you will also need a USB stick and an SD card. If you use a case like my Argon Neo, installing the NVME and SD-card demands a bit of disassembly. The reason we need two other devices is that we need to clone one of them to the NVME and to do that we need to boot from the other. Here is what you need to do to your NVME working:

  1. Insert the SD-card and the NVME in your case or hat or whatever you use and insert an ethernet cable connected to your router.
  2. Boot your RaspberryPi while repeatedly pressing down the shift key until you get to the Raspberry Pi screen that downloads the installer.
  3. Install RaspberryPi OS (light) on the SD card.
  4. Boot from the SD card. If the boot order is set to boot from NVME first, you may have to press Space when booting to get to the boot order screen first. Since RaspberryPi OS reboots once as part of the isntallation, you may have to go through the boot order screen twice, so be ready to press space again after the first boot. After the second boot, the SD card has got RaspberryPi OS and the root partition (/) has been expanded.
  5. Insert your USB stick into one of the blue USB3 ports.
  6. Boot your Raspberry Pi again and repeatedly press down shift until you get to the screen that downloads the installer.
  7. Install RaspberryPi OS on your USB-stick.
  8. When the Pi reboots, press space repeatedly to get to the boot order screen and select USB and boot.
  9. Be ready to press space repeatedly again since the Pi reboots once as part of the installation process and choose USB again to boot the USB stick and let it expand the root partition.
  10. When you have booted into the USB stick for the second time after the root partition has been expanded, open a terminal (or use the TTY if you used RPi light).
  11. Write sudo fdisk /dev/nvme0n1 to partition the NVME with fdisk.
  12. Press g to make a new GPT partition table. You may have to confirm that you want to remove an MS-DOS (MBR) partition table already there.
  13. Press n to make a new partition.
  14. Choose the default as the first sector by pressing return.
  15. Write +512M to make the size of the partition half a Gigabyte.
  16. Press t to change a partition.
  17. Choose the default 1 as the partition you want to change.
  18. Set its type to 1 (EFI System).
  19. Make a new partition with n.
  20. Accept the defaults since it will use the rest of the disk.
  21. Press w to write your changes to the disk.
  22. Write dd if=/dev/mmcblk0p1 of=/dev/nvme0n1p1 && sync and press return. This will clone the first partition, the EFI partiont, of the SD card onto the first partition of the NVME.
  23. Write dd if=/dev/mmcblk0p2 of=/dev/nvme0n1p2 && sync and press return. This will clone the second partition, the root partition, of the SD card onto the second partition of the NVME.
  24. Write sudo mount /dev/nvme0n1p1 /mnt to mount the EFI partition of the NVME to /mnt on your running system (from the USB stick).
  25. Write lsblk -f to get the UUID of the root partition of the NVME (/dev/nvme0n1p2).
  26. Open the file /mnt/cmdline.txt with sudo in a text editor. (I prefer to combine step 25 up to and including 33 since Emacs has a built in terminal multiplexer and tiling window manager, and it is easier to copy the UUID from one window in Emacs to another window than to try to remember a UUID from lsblk -f from before I opened Emacs. I also use tramp inside Emacs to open the files with sudo instead of opening emacs with sudo. If you use another text editor in a TTY, then you probably have to write the UUID down after running lsblk -f since your text editor will hide the output from that command when you launch it to edit the file, unless you use GNU screen or tmux.)
  27. Change where it says root=PARTUUID=somenumber to root=UUID= and write or paste the UUID from lsblk -f for /dev/nvme0n1p2.
  28. Save the file and exit the text editor if you use a TTY editor without a built in terminal multiplexer.
  29. Write sudo umount /mnt and press return to unmount the first partition.
  30. Write sudo mount /dev/nvme0n1p2 /mnt to mount the root partition from the NVME to /mnt on your running system (the USB stick). If it tells you the disk is busy, wait for it. It means that the disk is still writing even if it has tld the OS it has finished. If you fail to wait, then you cannot boot.
  31. Write lsblk -f again and note down the UUID of both /dev/nvme0n1p1 (the EFI partition) and /dev/nvme0n1p2 if you did not already note it down. (Or use a terminal multiplexer or Emacs to copy it over when you need it.)
  32. Open the file /mnt/etc/fstab in a text editor with sudo.
  33. Replace the part of the line that says PARTUUID=somenumber on the line where it says /boot/firmware with UUID= and write or paste the UUID number for /dev/nvme0n1p1 (the EFI partition).
  34. Do the same with line where it says /, but use the UUID for /dev/nvme0n1p2 (the root partition).
  35. Save the file and exit your text editor.
  36. Wait for a while to allow time for the nvme to write out the change. Turn off the RaspberryPi.
  37. Remove the SD card and the USB stick.
  38. Reboot the Raspberry Pi. It should now boot from the NVME. If the boot order is set to boot USB or SD Card first, you may have to press space when booting to boot from the NVME. In such a case, you should write sudo raspi-config in a terminal and go to Advanced Options, choose A4 Boot order, and choose B2 NVME/USB Boot … and then press OK and finish and reboot. It should now boot from the NVME. If something went wrong and you end up in an emergency shell, then reboot, insert the USB and SD card again, press space and try again.

I now have a 4TB NVME that boots my RaspberryPi 5. I also tried booting from SD card and using the NVME only as storage for a while, but it was slow and annoying, so it is really worth spending some time to get the Pi booting from the NVME. Hopefully, the RaspberryPi devs will change the imager and installer so they use the GPT partition scheme in the future. There is no reason to use MBR in the 21st century.

My new emo-present minor mode

A while ago, I wrote that I made a few functions to present from org mode to replace org-present which removes too many glyphs to be practical for my use. I thought it would be nice to use use-package to defer loading these functions until I need them, and I was curious about how to make a minor mode. So yesterday, I created a minor mode around those simple functions.

I made functions for starting the presentation, going forward, going backward and stopping the presentation, so turning it into a minor mode that is turned on and then have some functionality bound to a keymap, and which you then can turn off again was a very natural fit. I added the ability to customize a few things and have some ideas for more functionality to include and more things to customize.

Have a look at the Readme.org at Codeberg.org if you want to have a look or try it out. I might try to include it in a package archive in the future, but for now, you can install it with use-package's vc: keyword.

Presentation functions

I use Emacs at work to present in class. I teach basic IT technology, programming and development, so it is very useful to be able to run code blocks interactively and get them syntax highlighted. If I get questions from the students, I can change the code to explain other ways of doings things or show them how small changes can yield very different results. I also quite often add additional useful information from the students into the slides while presenting if they mention something worth noting. I have written about this before.

I have used org-present to present from Emacs Org files thus far. It has been good in many ways, but there have been a few annoyances as well. One thing that has bitten me many times is that it hides too many characters. This means that when I show things like == on screen (except in code blocks), it looks like =. This is very annoying when teaching programming. It also ruins org tables since it removes + which means that tables with vertical lines that are fully aligned normally show up misaligned. I have stopped using lines to separate headings and content in tables, but it is not ideal. I have used org-present for two years now, and there is no way to configure it to remove these annoyances, so I am ready to switch to something else.

Today, I found some time to look into this and made a few, simple functions that does exactly what I need and nothing more. It is just ten lines more than my previous configuration for org-present. And since it is part of my Emacs config, there is no need to install additional packages. I almost always start presentations from the the start with the title, so my emo-present-start function does that. There is a bit of a rough edge in that it shows metadata keywords like #+Title: and #+Options: toc: nil when I present the title. I might sandpaper that rough edge off in the future. Otherwise, it works better for me than org-present and with a lot fewer lines of code.

Now

A few years ago, I got the chance to teach foundational IT technologies, programming and development which is a job I have wanted for years. At the time, I was midway into an online IT study at Høgskolen i Molde and worked as an English teacher. So I have spent the last few years finishing my studies, learning a lot of technologies and making a lot of teaching materials. It has been a lot of hard work, but also a lot of fun.

However, I want to do better, both for my students and my own satisfaction, so I am going deeper into these technologies this school year:

This is also the first year I have the role as lead teacher for a class. It means that I am responsible for the psychosocial and learning environment of my students, and there are some extra administrative work as well as following up with the students to help them learn as much as possible both within the subjects and skills needed to interact with other people and society at large, and also have as good a time as possible doing it. I am also responsible for communication between the school and my students' parents or other guardians when they are under 18 years of age. It's all new to me, but it is natural that I get this role since I am the teacher that has the most lessons with the first year students on the IT and media production study line.

(Maybe you are wondering what a now page is? Click the link to find out.)

© Einar Mostad 2010 - 2025. Content is licensed under the terms of CC BY SA except code which is GNU GPL v3 or later.
Made with GNU Emacs, Org-Static-Blog, and Codeberg Pages on GNU/Linux.