6.1.4 Preparing for Installation

Once you have successfully booted your computer using the installation medium,
you should end up with a root prompt. Several console TTYs are configured
and can be used to run commands as root. TTY2 shows this documentation,
browsable using the Info reader commands (see Stand-alone GNU Info). The installation system runs the GPM mouse
daemon, which allows you to select text with the left mouse button and
to paste it with the middle button.

Note: Installation requires access to the Internet so that any missing
dependencies of your system configuration can be downloaded. See the
“Networking” section below.

The installation system includes many common tools needed for this task.
But it is also a full-blown GuixSD system, which means that you can
install additional packages, should you need it, using guix
package (see Invoking guix package).

6.1.4.1 Keyboard Layout

The installation image uses the US qwerty keyboard layout. If you want
to change it, you can use the loadkeys command. For example,
the following command selects the Dvorak keyboard layout:

loadkeys dvorak

See the files under /run/current-system/profile/share/keymaps for
a list of available keyboard layouts. Run man loadkeys for
more information.

6.1.4.2 Networking

Run the following command see what your network interfaces are called:

ifconfig -a

… or, using the GNU/Linux-specific ip command:

ip a

Wired interfaces have a name starting with ‘e’; for example, the
interface corresponding to the first on-board Ethernet controller is
called ‘eno1’. Wireless interfaces have a name starting with
‘w’, like ‘w1p2s0’.

Wired connection

To configure a wired network run the following command, substituting
interface with the name of the wired interface you want to use.

ifconfig interface up

Wireless connection

To configure wireless networking, you can create a configuration file
for the wpa_supplicant configuration tool (its location is not
important) using one of the available text editors such as
zile:

zile wpa_supplicant.conf

As an example, the following stanza can go to this file and will work
for many wireless networks, provided you give the actual SSID and
passphrase for the network you are connecting to:

Start the wireless service and run it in the background with the
following command (substitute interface with the name of the
network interface you want to use):

wpa_supplicant -c wpa_supplicant.conf -i interface -B

Run man wpa_supplicant for more information.

At this point, you need to acquire an IP address. On a network where IP
addresses are automatically assigned via DHCP, you can run:

dhclient -v interface

Try to ping a server to see if networking is up and running:

ping -c 3 gnu.org

Setting up network access is almost always a requirement because the
image does not contain all the software and tools that may be needed.

If you want to, you can continue the installation remotely by starting
an SSH server:

herd start ssh-daemon

Make sure to either set a password with passwd, or configure
OpenSSH public key authentication before logging in.

6.1.4.3 Disk Partitioning

Unless this has already been done, the next step is to partition, and
then format the target partition(s).

The installation image includes several partitioning tools, including
Parted (see Overview in GNU Parted User Manual),
fdisk, and cfdisk. Run it and set up your disk with
the partition layout you want:

cfdisk

If your disk uses the GUID Partition Table (GPT) format and you plan to
install BIOS-based GRUB (which is the default), make sure a BIOS Boot
Partition is available (see BIOS installation in GNU GRUB
manual).

If you instead wish to use EFI-based GRUB, a FAT32 EFI System Partition
(ESP) is required. This partition should be mounted at /boot/efi and
must have the esp flag set. E.g., for parted:

parted /dev/sda set 1 esp on

Once you are done partitioning the target hard disk drive, you have to
create a file system on the relevant partition(s)18. For the ESP, if you have one and assuming it is
/dev/sda2, run:

mkfs.fat -F32 /dev/sda2

Preferably, assign file systems a label so that you can easily and
reliably refer to them in file-system declarations (see File Systems). This is typically done using the -L option of
mkfs.ext4 and related commands. So, assuming the target root
partition lives at /dev/sda1, a file system with the label
my-root can be created with:

mkfs.ext4 -L my-root /dev/sda1

If you are instead planning to encrypt the root partition, you can use
the Cryptsetup/LUKS utilities to do that (see man cryptsetup for more information.) Assuming you want to
store the root partition on /dev/sda1, the command sequence would
be along these lines:

Once that is done, mount the target file system under /mnt
with a command like (again, assuming my-root is the label of the
root file system):

mount LABEL=my-root /mnt

Also mount any other partitions you would like to use on the target
system relative to this path. If you have /boot on a separate
partition for example, mount it at /mnt/boot now so it is found
by guix system init afterwards.

Finally, if you plan to use one or more swap partitions (see swap space in The GNU C Library Reference Manual), make
sure to initialize them with mkswap. Assuming you have one
swap partition on /dev/sda2, you would run:

mkswap /dev/sda2
swapon /dev/sda2

Alternatively, you may use a swap file. For example, assuming that in
the new system you want to use the file /swapfile as a swap file,
you would run19:

Note that if you have encrypted the root partition and created a swap
file in its file system as described above, then the encryption also
protects the swap file, just like any other file in that file system.

Footnotes

This example will work for many types of file
systems (e.g., ext4). However, for copy-on-write file systems (e.g.,
btrfs), the required steps may be different. For details, see the
manual pages for mkswap and swapon.