This guide assumes you have connection to the internet via ethernet, which is the easiest way of installing Crux on a computer or VM since you won’t need to mess around with WiFi.
First off, list the drives, for this tutorial I’m going to assume that /dev/sda is the hard-drive you wish to install onto, however you may have such drives named /dev/sdb too.
lsblk #list drives
Now we need to check if you’re either installing on a system with BIOS or UEFI.
dmesg | grep 'EFI v' if stdout ~= [0.000000] EFI v2.00 by American Megatrends then boot = UEFI if stdout = then boot = BIOS
If dmesg returns nothing, then you’re on BIOS, if it shows something, then you’re on a UEFI system. :(
Onwards to formatting the harddrives, using the output of
lsblk, select your harddrive device, i.e. /dev/sda, and use cfdisk on it as shown:
cfdisk /dev/sda gpt Device Boot Start End Sectors Size Type /dev/sda 500GiB ├─/dev/sda1 ... ... ... 40G Linux ├─/dev/sda2 ... ... ... 451GiB Linux ├─/dev/sda3 ... ... ... 5GiB Linux ├─/dev/sda4 ... ... ... 4GiB Linux swap --- UEFI ONLY --- └─/dev/sda5 * ... ... ... 128MiB FAT32
Make a partition of 1GiB minimum, with an ideal 40GiB for the root partition, /dev/sda1.
Make a partition for your home directory, /dev/sda2, however large you desire.
Make a partition of around 5GiB for var, /dev/sda3, and finally make a partition for the swap, my rule of thumb for swap size is ½ your RAM size, mine is 4GiB, so I’ll make a 2GiB partiton for /dev/sda4.
If you’re using a UEFI system, you must create a partition of no less than 128MiB, then set this partition to FAT32 using the
Type option in the cfdisk UI, make the device bootable, so that it has an asterisk in the Boot column.
Yours should look vaguely similar to the above, once done, write. \
To to format the partitions in their specified filesystem types, run these commands on your respective partitions.
- /dev/sda1 is root, in ext4
- /dev/sda2 is home, in ext4
- /dev/sda3 is var, in ext4
- /dev/sda4 is swap, in swap
- /dev/sda5 is boot, in FAT32
mkfs.ext4 /dev/sda1 #format root (ext4) mkfs.ext4 /dev/sda2 #format home (ext4) mkfs.ext4 /dev/sda3 #format var (ext4) mkswap /dev/sda4 #make sda4 swap swapon /dev/sda4 #enable swap
Now we need to make the folders on the USB device/VM drive to mount the partitions onto:
mkdir /mnt/home #make home folder mkdir /mnt/var #make var folder
Proceed to mount the partitions onto the aforementioned folders.
mount /dev/sda1 /mnt #mount /mnt => root mount /dev/sda2 /mnt/home #mount home => sda2 mount /dev/sda3 /mnt/var #mount var => sda3
Time to setup the base installation.
setup Yes 1 - Install Crux 3.2 OK /mnt OK (press space to add ‘*’) [*] core #mandatory [*] opt #mandatory for UEFI [ ] xorg #optional
If you’re on UEFI, the opt section must be selected, xorg is advised if you want a desktop interface later. Continue installation as follows:
OK No Yes OK setup-chroot
setup-chroot fails, if so run these commands to manually do a chroot enviroment.
mount --bind /dev /mnt/dev mount --bind /tmp /mnt/tmp mount -t proc proc /mnt/proc mount -t sysfs none /mnt/sys chroot /mnt /bin/bash
In order to enable networking via ethernet, simply find your adapter with
ip link, which is usually something like enp0s3, wlan0 is your wireless:
ip link #gives adapters dhcpcd -t 10 <"adapter name"> #connect to internet w/ ethernet
Change the root password:
passwd #change root password
Now it’s time to configure the kernel settings:
cd usr/src/linux* #go to kernel folder make menuconfig #compile pre config <"make personal preferences to kernel"> #do what you want YES OK make all && make modules_install #compile linux kernel
This might take a while so come back in around 30 minutes.
Move the system image and map to /boot via:
cp arch/x84_64/boot/bzImage /boot/vmlinuz #copy boot files /boot cp System.map /boot #copy system.map /boot
For a BIOS boot, you’ll use lilo for the boot manager, to configure lilo, add the boot drive, in this case /dev/sda to the
boot section of /etc/lilo.conf, and then add your root partition, /dev/sda1 to the
root section of lilo.conf using a text editor such as vi or nano. I’m using nano for this.
nano /etc/lilo.conf #setup lilo bootloader boot=/dev/sda #append this to line 7 image=/boot/vmlinuz #append this to line 8 root=/dev/sda1 #append this to line 11
And then add it to lilo by executing it.
lilo #set /sda as bootable
For the UEFI systems, you have to configure GRUB, to do this do:
grub install /boot/efi grub-mkconfig -o /boot/grub/grub.cfgz
In order for CRUX to know which drives are which, we must edit /etc/fstab, and label each drive to its corresponding directory:
nano /etc/fstab #edit fstab config /dev/sda1 / ext4 defaults ... #don’t forget to rm ‘#’ /dev/sda2 /home ext4 defaults ... #make sure sda* is correct /dev/sda3 /var ext4 defaults 0 0 #this line must be added /dev/sda4 swap swap defaults ... # ^ before the /dev/sda*
Ensure the hashes before each line is removed.
The following steps aren’t mandatory, you can reboot right now, but they are useful edits to make the system easier to use. First find your keymap and timezone by going into the following directories, and noting down the file that meets your keymap / timezone.
For keymaps; cd /usr/share/kbd/keymaps/i386/qwerty/ ls For timezones; cd /usr/share/zoneinfo ls
Using these two filenames, add them to your rc.conf, you can also edit the hostname of your device by doing:
nano /etc/rc.conf #edit config file KEYMAP = en_GB #your keymap TIMEZONE = GMT #your timezone HOSTNAME= "whatever you like" SERVICES= (lo net crond dbus)
Almost there, find your locale and configure it by doing:
cd /usr/share/i18n/locales ls | grep "country initials e.g gb" #find locale localedef -i "en_GB" -f ISO-8859-1 "en_GB" #replace ‘en_GB’ with localedef -i "en_GB" -f ISO-8859-1 "en_GB".ISO-8859-1 # ^ your ls | grep * localedef -i "en_GB" -f UTF-8 "en_GB".UTF-8
Remove installation media before rebooting
First login will be; root - the root password you configured
For next steps refer to https://goo.gl/zst8nw, which explains how to configure sound, WiFi, set up a non-root user, and use the ports system to install packages.
Additional networking help can be found @
- /etc/rc.d/net ip-address
- /etc/hosts gateway/hostname
- /etc/resolv.conf domain/dns
Resources gathered from:
For troubleshooting advice consult:
Or e-mail me here.