Next: , Previous: , Up: System Installation   [Contents][Index]


6.1.4 Preparing for Installation

Once you have successfully booted the image on the USB stick, 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:

network={
  ssid="my-ssid"
  key_mgmt=WPA-PSK
  psk="the network's secret passphrase"
}

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).

Once you are done partitioning the target hard disk drive, you have to create a file system on the relevant partition(s)17.

Preferably, assign partitions 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:

cryptsetup luksFormat /dev/sda1
cryptsetup open --type luks /dev/sda1 my-partition
mkfs.ext4 -L my-root /dev/mapper/my-partition

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

mount LABEL=my-root /mnt

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 run18:

# This is 10 GiB of swap space.  Adjust "count" to change the size.
dd if=/dev/zero of=/mnt/swapfile bs=1MiB count=10240
# For security, make the file readable and writable only by root.
chmod 600 /mnt/swapfile
mkswap /mnt/swapfile
swapon /mnt/swapfile

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

(17)

Currently GuixSD only supports ext4 and btrfs file systems. In particular, code that reads partition UUIDs and labels only works for these file system types.

(18)

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.


Next: , Previous: , Up: System Installation   [Contents][Index]