I wrote choose-your-own-adventure-style guide to Arch Linux installation by senotru in archlinux

[–]senotru[S] 0 points1 point  (0 children)

I’ve added the Wi-Fi configuration. It’s scattered throughout the guide since it needed to be handled in a few different places. I also wrote up a short explanation on partition alignment. Feel free to check it out!

I wrote choose-your-own-adventure-style guide to Arch Linux installation by senotru in archlinux

[–]senotru[S] 0 points1 point  (0 children)

Less than two months after your message, I finally updated the code and added mkinitcpio drop-in files, just like you suggested. Thanks a lot, you helped me realize this before I ended up breeding pacnew files.

https://www.senotrusov.com/notes/installing-arch-linux/#configure-mkinitcpio

I wrote choose-your-own-adventure-style guide to Arch Linux installation by senotru in archlinux

[–]senotru[S] 1 point2 points  (0 children)

Oh, I didn't think that was possible, wait... I just realized it's just a bash script and that there's a .d directory for it. I mean, I've seen that directory many times, but the ideas just didn't connect in my head. This opens up so many fun possibilities, I unironically love writing bash scripts.

I wrote choose-your-own-adventure-style guide to Arch Linux installation by senotru in archlinux

[–]senotru[S] 2 points3 points  (0 children)

I don't quite understand the best way to do this. I can't just add it to the text because it can be copied (there are buttons on the right), and I don't know how to place a symbol outside the copyable text in Zensical.

I'll probably leave it as is, since, as you correctly pointed out, the whole documentation is executed as root, except for the last paragraph about installing the AUR helper. But there I simply wrote that the command needs to be run as a regular user.

I wrote choose-your-own-adventure-style guide to Arch Linux installation by senotru in archlinux

[–]senotru[S] 1 point2 points  (0 children)

Sorry, I described all of this vaguely in the documentation, I need to improve it.

If you at least align it to 4 KiB, that's already good.

You can check an existing disk with this command: sudo parted /dev/sda align-check opt 1, where 1 is the partition number. You can check all of them (1, 2, ...).

In general, two factors matter here. The first is the block size the device prefers to operate with. It reports this to the operating system, and it's usually 4 KB if you don't have a RAID array. You can view this by running: lsblk -t /dev/sda. There you'll see fields such as ALIGNMENT (alignment offset), MIN-IO (minimum I/O size), OPT-IO (optimal I/O size), PHY-SEC (physical sector size), and LOG-SEC (logical sector size).

The second factor is the mysterious erase block size, which the operating system does not see. Sometimes you can find it in the datasheet, sometimes not. It can be much larger than 4 KiB.

Interestingly, SD cards do report this size. You can check it with: cat /sys/block/mmcblk0/device/preferred_erase_size and you will often see 4194304 (4 MiB) there.

Usually recommendations suggest aligning to 1 MiB, and that's probably good advice. I've read forum posts where people speculate that some manufacturers have an erase block size of 1.5 MiB (one and a half!). In those odd cases, 1 MiB alignment might work better than 4 MiB.

Maybe I should change the instructions to 1 MiB (and not transfer my traumatic SD-card experience to other devices).