- Any live usb bootable.
- Fedora rootfs archive, we can get it here. It's better to choose the most update / latest archive.
- Some partitions, for root system (/), efi (if you have uefi machine) and swap (optional).
- Basic commandline knowledge.
We need to do some steps here, It's not hard at all.
-
Format and mount partitions.
$ sudo mkfs.ext4 /dev/vda1 $ sudo mkswap /dev/vda2 $ sudo mount /dev/vda1 /mnt/ $ sudo swapon /dev/vda2
PS : I only use 2 partitions here, you can adjust as you wish.
-
Download and extract rootfs archive.
$ cd /mnt $ sudo wget -c https://images.linuxcontainers.org/images/fedora/40/amd64/default/20240724_20%3A33/rootfs.tar.xz $ sudo tar -xf rootfs.tar.xz
PS : You need to adjust the rootfs link download !
-
Mount some filesystems and do chroot.
$ sudo mount -t proc proc proc $ sudo mount -o bind /dev dev/ $ sudo mount -o bind /sys sys/ $ sudo mount -o bind /run run/ $ sudo chroot /mnt /bin/bash
-
Edit dnf configuration.
# vi /etc/dnf/dnf.conf
We need to remove
tsflags=nodocs
part and addinstall_weak_deps=False
option. It's optional, but if we don't edit the default config, we will end up not having any documentation / docs / manual files and get weak dependencies installed.
-
Update packages.
# dnf update
-
Edit fstab.
# vi /etc/fstab
Example :
UUID=YOUR_PARTITION_UUID / ext4 errors=remount-ro 0 1 UUID=YOUR_PARTITION_UUID swap swap defaults 0 0
-
Set time zone.
Incorrect time zone sometimes leads to network errors, we need to set it. Adjust it for your local time, for me it's
Asia/Jakarta
.$ timedatectl set-timezone Asia/Jakarta
-
Install grub and dracut package.
# dnf install grub2-pc dracut
after grub package is installed, we need to disable
blscfg
feature. After wondering for days, I just found that blscfg was the culprit that causes kernel and initramfs not automatically copied to /boot directory. We can disableblscfg
usinggrub2-editenv
command.# grub2-editenv - set grub_enable_blscfg=false
-
Install Kernel.
Kernel is needed here, obviously .
# dnf install kernel-core kernel-modules
After kernel and its modules are installed, dracut will automatically generate initramfs file. The kernel files (vmlinuz, config, System.map) also will be copied to /boot directory automatically.
-
Update and install grub to disk.
We need to update grub, so our kernel will be listed on grub menu. We also install the grub to /dev/vda disk.
# grub2-mkconfig -o /boot/grub2/grub.cfg # grub2-install /dev/vda
-
Set password (root user).
We need to set password for our main user / root.
# passwd
-
Exit chroot and unmount some filesystems.
We need to exit chroot and unmount some filesystems we mount before.
# exit # umount proc # umount dev/ # umount sys/ # umount run/ # cd / # umount /mnt
-
Reboot.
After everything are done, let's reboot !
# systemctl reboot
Update ! Finally, Grub works fortunatelly ! We just need to run
kernel-install
before update grub and install grub to disk.