GNU/Linux

1. Linux   linux

ID: ab57dccf-c9f3-4347-b9d0-5731904f3d67
CREATED: <2025-02-09 Sun 13:33>

[2025-03-06 Thu 09:11] >> UNIX

At this point, I don't really care what the non-believers think - if you are not running GNU/Linux as your daily driver, you are wrong. Of course I understand the need to run dedicated Windows and MacOS machines, when it is out of your control - say you have a Macbook or need to run it for %employer. No need to stress about that. But when you are given the opportunity - given a choice, you should pick whatever Linux-based OS suits your needs best.

1.1. Libraries

ID: 3e6b5e34-4cf0-4289-afda-bea7c2a343dd
CREATED: <2025-02-14 Fri 22:11>

1.1.1. Ublk   fs

ID: 46fdde04-496d-45b4-a674-367edafb8054
CREATED: <2025-03-04 Tue 17:46>

1.1.2. Tracing   test log

ID: 292a62ff-6d56-42e2-88fa-bd13ddbc2fb1
CREATED: <2025-03-04 Tue 17:48>

[2025-03-04 Tue 17:48] Linux Tracing Technologies — The Linux Kernel documentation

  1. strace
    ID: ef769379-7632-4c45-b933-1e3bfd858ea1
    CREATED: <2025-03-04 Tue 17:49>
    

    [2025-03-04 Tue 17:49] man [2025-03-04 Tue 17:50] strace

  2. perf
    ID: da34bba6-7ca1-4836-91d8-e16ae2a8fcb7
    CREATED: <2025-03-04 Tue 17:49>
    

    [2025-03-04 Tue 17:49] man [2025-03-04 Tue 17:50] brendangregg/perf-tools [2025-03-04 Tue 18:58] Linux perf Examples

  3. iostat
    ID: 7e8d965e-6b39-43bb-a69a-4747977b436f
    CREATED: <2025-03-04 Tue 18:59>
    

    [2025-03-04 Tue 18:59] man

  4. rv
    ID: d77d5ce5-2857-4c17-bcaf-c3eb32f93bcc
    CREATED: <2025-03-04 Tue 19:40>
    

    [2025-03-04 Tue 19:40] Runtime Verification — The Linux Kernel documentation

1.1.3. BPF   log

ID: 97d3d07c-e576-412b-a97a-2879efa998c5
CREATED: <2025-03-04 Tue 19:02>

[2025-03-04 Tue 19:02] BPF Documentation — The Linux Kernel documentation

  1. eBPF
    ID: cb4a79ea-64fa-4c3a-b4bf-f3f731bc04ad
    CREATED: <2025-03-04 Tue 19:03>
    

    [2025-03-04 Tue 19:03] Linux eBPF Tracing Tools

1.1.4. RTLA   test

ID: 378227a0-d265-4272-8013-73df72b5e49a
CREATED: <2025-03-04 Tue 19:06>

[2025-03-04 Tue 19:06] The realtime Linux analysis tool — The Linux Kernel documentation

1.1.5. Keyutils   crypto

ID: 5e859a3f-0c31-4796-85c6-7008b346f186
CREATED: <2025-02-14 Fri 22:12>

[2025-02-14 Fri 22:12] keyutils(7) - Linux manual page

1.1.6. Netlink

ID: 25cc1e3f-60f0-401a-a8b6-ac8d5670233d
CREATED: <2025-03-04 Tue 19:14>

[2025-03-04 Tue 19:14] Introduction to Netlink — The Linux Kernel documentation [2025-03-04 Tue 19:14] Netlink Handbook — The Linux Kernel documentation

1.2. Kernel

ID: caed860f-fcef-43a2-b080-94b01352cd43
CREATED: <2025-02-16 Sun 20:12>

[2025-02-16 Sun 20:12] Unreliable Guide To Hacking The Linux Kernel — The Linux Kernel documentation [2025-02-16 Sun 20:12] The Linux Kernel documentation — The Linux Kernel documentation

1.2.1. Devices

ID: ad25b130-d832-4109-84ad-7cb9900ed227
CREATED: <2025-01-17 Fri 19:15>

/dev In Linux, everything is a file.

dev contains special device files - usually block or character device.

major, minor = category, device 0, 5

mknod - create special device files

redhat hints

  1. utils
    ID: f8ce343e-c866-4fff-8e39-2da32a59d56e
    CREATED: <2025-02-06 Thu 19:16>
    
    dd if=/dev/zero of=myfile bs=1M count=32
    losetup --show -f myfile
    ls -al /dev/loop0
    losetup -d /dev/loop0 #teardown
    
    echo "sup dude" > /dev/loop0
    dd if=/dev/loop0 -bs=1
    dd if=/dev/nvme0 of=/dev/null progress=true
    #pacman -S hdparm
    hdparm -T /dev/nvme0
    
    modprobe scsi_debug add_host=5 max_luns=10 num_tgts=2 dev_size_mb=16
    

    sparsefiles: create with C, dd, or truncate

    truncate --help
    

    test mkfs.btrfs on 10T dummy block device

    dd if=/dev/zero of=/tmp/bb1 bs=1 count=1 seek=10T
    du -sh /tmp/bb1
    losetup --show -f /tmp/bb1
    mkfs.btrfs /dev/loop0
    

    diagnostics

    iostat # pacman -S sysstat
    blktrace # paru -S blktrace
    iotop # pacman -S iotop
    

    bcc/ trace: Who/which process is executing specific functions against block devices?

    bcc/biosnoop: Which process is accessing the block device, how many bytes are accessed, which latency for answering the requests?

    at the kernel level besides BPF we got kmods and DKMS,

    compression/de-duplication can be done via VDO kernel mod

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

  2. Frame Buffer Device
    ID: 639e5d85-e143-421d-86be-9bc291bc2f8b
    CREATED: <2025-01-17 Fri 19:15>
    

    [2025-01-17 Fri 19:15] The Frame Buffer Device — The Linux Kernel documentation

    /dev/fb*

    • used by fbgrab/fbcat program
  3. Userspace Block Device
    ID: d58cb494-ce43-49cc-859b-aa6a518ac314
    CREATED: <2025-02-14 Fri 22:11>
    

    [2025-02-06 Thu 19:10] Userspace block device driver (ublk driver)

    ublk https://github.com/ming1/ubdsrv

  4. Input Devices
    ID: ea9bb3f9-3607-4be2-82f8-e9b3381a0524
    CREATED: <2025-02-27 Thu 18:51>
    

    [2025-02-27 Thu 18:51] evdev - Wikipedia [2025-02-27 Thu 18:51] kernel.org input.txt

1.2.2. Systems

ID: 1f728d2c-edf1-4502-9560-d0a6c45d5df8
CREATED: <2025-02-27 Thu 19:38>

[2025-02-27 Thu 19:43] syscalls(2) - Linux manual page [2025-02-27 Thu 19:44] System Calls — The Linux Kernel documentation [2025-02-27 Thu 19:46] linux/arch/x86/entry/syscalls/syscall_64.tbl

  1. Core
    ID: c670fcee-f9b1-4acd-ab32-3b795748b544
    CREATED: <2025-03-07 Fri 15:35>
    

    [2025-03-07 Fri 15:35] Core Subsystems

  2. Storage
    ID: f28b16e2-97e5-4575-a3d6-941efeb8942d
    CREATED: <2025-03-07 Fri 15:36>
    

    [2025-03-07 Fri 15:36] Storage interfaces

    1. Filesystem   fs
      ID: 1f938c20-8d8e-460c-8fb7-f4afaac432cc
      CREATED: <2025-02-22 Sat 19:04>
      

      [2025-02-22 Sat 19:04] Filesystem Hierarchy Standard - Wikipedia

  3. ACPI   hw
    ID: ac0ae4dd-21d4-4b45-9751-a102a48f30e6
    CREATED: <2025-03-04 Tue 19:16>
    

    [2025-03-04 Tue 19:16] ACP - Wikipedia [2025-03-04 Tue 19:16] ACPI Support — The Linux Kernel documentation

    Advanced Configuration and Power Interface

  4. SPI
    ID: cde3ff32-1ad9-43ab-9ac7-05efd3f88490
    CREATED: <2025-03-04 Tue 19:20>
    

    [2025-03-04 Tue 19:20] Serial Peripheral Interface (SPI) — The Linux Kernel documentation

  5. DFL   hw
    ID: 5499a81e-1c6e-48d5-b906-9d2155afc562
    CREATED: <2025-03-04 Tue 19:19>
    

    [2025-03-04 Tue 19:19] FPGA Device Feature List (DFL) Framework Overview — The Linux Kernel documentation

  6. Networking   net
    ID: 8ed2735d-d259-4a78-8891-ded98f857846
    CREATED: <2025-03-07 Fri 15:31>
    
    1. NAPI
      ID: 883daf4b-7084-4356-ab2d-877a8af2cd45
      CREATED: <2025-03-07 Fri 15:31>
      

      [2025-03-07 Fri 15:31] NAPI — The Linux Kernel documentation

  7. Human Interfaces
    ID: 19f3c5da-0f20-4eca-b142-7fc71095ca18
    CREATED: <2025-03-07 Fri 15:38>
    

    [2025-03-07 Fri 15:39] Human Interfaces

    1. Frame Buffer
      ID: 0c37073d-0322-410b-8258-00ffd8215eaa
      CREATED: <2025-03-07 Fri 15:38>
      

      [2025-03-07 Fri 15:40] Frame Buffer

  8. IO   io
    ID: 9d49d145-2c94-4d6f-a4e1-5016df6cbedc
    CREATED: <2025-02-27 Thu 19:39>
    

    Input/Output operations

    1. epoll
      ID: 74367b29-6a50-4eb4-ac6b-1c1b96dabd89
      CREATED: <2025-02-27 Thu 19:39>
      

      [2025-02-27 Thu 19:42] epoll(7) - Linux manual page

    2. io_uring
      ID: 92c2a9aa-6584-470e-977a-3547bca79414
      CREATED: <2025-02-27 Thu 19:39>
      

      [2025-02-27 Thu 19:40] io_uring is not an event system · blog · despair labs [2025-02-27 Thu 19:40] GitHub - noteflakes/awesome-io_uring: Awesome io_uring [2025-02-27 Thu 19:40] Zero Copy Rx with io_uring [2025-02-27 Thu 19:41] io_uring(7) - Linux manual page [2025-02-27 Thu 19:41] Missing Manuals - io_uring worker pool [2025-02-27 Thu 19:42] Lord of the io_uring

    3. poll
      ID: d43311bf-7f5f-4d21-aad8-4b35548813b5
      CREATED: <2025-02-27 Thu 19:43>
      

      [2025-02-27 Thu 19:43] poll(2) - Linux manual page

1.3. Distros

ID: 34966e81-ab92-4b85-b11e-073784261db5
CREATED: <2025-02-22 Sat 19:31>

[2025-02-22 Sat 19:31] List of Linux distributions - Wikipedia

Linux Distributions

1.3.1. Fedora

ID: c9fdd74c-0eb2-4d8f-bc22-0cf40996f186
CREATED: <2025-02-22 Sat 19:32>

[2025-02-22 Sat 19:32] Fedora Linux | The Fedora Project

  1. CoreOS
    ID: ca6795ee-4b2c-4ec3-9bdc-f6be67c2f1ec
    CREATED: <2025-02-22 Sat 19:32>
    AKA: FCOS
    PROPERTIES: :header-args :export both :eval no-export :session coreos :async t
    

    [2025-02-22 Sat 19:32] Fedora CoreOS Documentation

    • CoreOS Installer

      cargo install coreos-installer
      
    • core
    • Ignition documentation
    • Provisioning Fedora CoreOS on QEMU
      • requires ignition config file
      • should provide ssh key for core user
      • fetch the qcow2 image

        # stream = stable,testing,next
        coreos-installer download -s $stream -p qemu -f qcow2.xz --decompress -C ~/.stash/scratch/
        
        /home/ellis/.stash/scratch/fedora-coreos-41.20250215.3.0-qemu.x86_64.qcow2
        
      • setup a new vm

        IGNITION_CONFIG=$config
        IMAGE=$image
        # for x86/aarch64:
        IGNITION_DEVICE_ARG="-fw_cfg name=opt/com.coreos/config,file=${IGNITION_CONFIG}"
        
        # for s390x/ppc64le:
        IGNITION_DEVICE_ARG="-drive file=${IGNITION_CONFIG},if=none,format=raw,readonly=on,id=ignition -device virtio-blk,serial=ignition,drive=ignition"
        
        qemu-system-x86_64 -m 2048 -cpu host -nographic -snapshot \
          -drive "if=virtio,file=${IMAGE}" ${IGNITION_DEVICE_ARG} \
          -nic user,model=virtio,hostfwd=tcp::2222-:22
        
      • launch it

        qemu-img create -f qcow2 -F qcow2 -b "${IMAGE}" my-fcos-vm.qcow2
        qemu-system-x86_64 -m 2048 -cpu host -nographic \
          -drive if=virtio,file=my-fcos-vm.qcow2 ${IGNITION_DEVICE_ARG} \
          -nic user,model=virtio,hostfwd=tcp::2222-:22
        
  2. IoT
    ID: 79c00d69-0624-4e85-a237-79e73e612dca
    CREATED: <2025-02-22 Sat 19:34>
    

    [2025-02-22 Sat 19:34] Fedora IoT Documentation

1.3.2. Arch

ID: 6ef3fb84-6805-46f7-ad13-8929a023b43c
CREATED: <2025-02-22 Sat 19:39>

[2025-02-22 Sat 19:40] Arch Linux

1.3.3. Ubuntu

ID: 5d1223c7-0ded-44b9-b494-3a3593a2fe02
CREATED: <2025-02-22 Sat 19:39>

[2025-02-22 Sat 19:41] Enterprise Open Source and Linux | Ubuntu

1.3.4. Debian

ID: f03769bc-abf2-4f58-809f-b672c66120f3
CREATED: <2025-02-22 Sat 19:39>

[2025-02-22 Sat 19:41] Debian – The Universal Operating System

1.3.5. Alpine

ID: 4e717401-7b7b-4ce6-83c7-6f8420e01b93
CREATED: <2025-02-22 Sat 19:40>

[2025-02-22 Sat 19:41] Alpine Linux

1.3.6. Adélie

ID: b54a3fef-192f-4767-bec2-c10058e69a89
CREATED: <2025-03-04 Tue 15:27>

[2025-03-04 Tue 15:27] Adélie Linux | Welcome

1.3.7. Gentoo

ID: 5cbe7ad4-008a-4ed7-889d-e7ec5663dfd1
CREATED: <2025-02-22 Sat 19:40>

[2025-02-22 Sat 19:42] Gentoo Linux

1.3.8. Slackware

ID: 21e5a881-54d0-410e-b48a-f32ee26ef90d
CREATED: <2025-02-22 Sat 19:43>

[2025-02-22 Sat 19:43] The Slackware Linux Project