Installing Parabola on a USB key

From ParabolaWiki
Jump to: navigation, search

This page discusses how to perform a regular Parabola installation onto a USB key (or "flash drive"). The result will be a system that will be updated through normal use. This is different from booting the installation media from a USB key.

1 Grab a big enough USB key

If installing KDE and a large amount of applications, 3 GiB is the recommended minimum. GNOME and Xfce4, along with a typical set of packages for a desktop (GIMP, Pidgin, LibreOffice, Firefox, Gnash) can be installed on a 2 GiB stick, leaving a small amount of room for user data.

2 Grab CD

An Parabola CD can be used to install Parabola onto the USB key, via booting the CD and launching AIF with /libre/setup. Or, if you have another GNU/Linux computer available (it needs not be Parabola, can be other free distro), you can follow the instructions to install from existing GNU/Linux, and then skip to the configuration section. In case you are already running Parabola, simply install aif-libre and launch it with: aif -p interactive.

3 Installation

Launch the installer /libre/setup. The setup process can be done normally, with only a few pointers:

  • It is best to manually partition the drive, as the auto partition may not work, and will create unnecessary partitions.
  • If cfdisk fails with "Partition ends in the final partial cylinder" fatal error, the only way to proceed is to kill all partitions on the drive. Open another terminal (Alt+F2), type fdisk /dev/sdX (where sdX is your usb drive), print partition table (p), check that it's ok, delete it (d) and write changes (w). Now return to cfdisk.
  • It is highly recommended to review the Tips for Minimizing SSD Read/Writes on the SSD wiki article prior to selecting a filesystem. To sum up, ext4 with a journal should be fine. Recognize that flash has a limited number of writes, and a journaling file system will take some of these as the journal is updated. For this same reason, it is best to forgo a swap partition. Note that this does not affect installing onto a USB hard drive.
  • When editing the /etc/mkinitcpio.conf, add the usb hook to the hooks array right after udev. This is necessary for appropriate module loading in early userspace. If USB key will be use on several machines, please remove the "autodetect" hook to the kernel recognize anywhere computer when start the Parabola System.

4 Configuration

  • Make sure that /etc/fstab includes the correct partition information for /, and for any other partitions on the USB key. If the usb key is to be booted on several machines, it is quite likely that devices and number of available hard disks vary. So it is advised to use BY-ID:

To get the proper UUIDs for your partitions issue blkid

  • menu.lst, the Grub configuration file, should be edited to (loosely) match the following:
Note: When grub is installed on the USB key, the key will always be hd0,0

With the static /dev/sdaX:

root (hd0,0)
kernel /boot/vmlinuz-linux-libre root=/dev/sda1 ro
initrd /boot/initramfs-linux-libre.img

When using label your menu.lst should look like this:

root (hd0,0)
kernel /boot/vmlinuz-linux-libre root=/dev/disk/by-label/Parabola ro
initrd /boot/initramfs-linux-libre.img

With for UUID, it should be like this:

root (hd0,0)
kernel /boot/vmlinuz-linux-libre root=/dev/disk/by-uuid/3a9f8929-627b-4667-9db4-388c4eaaf9fa ro
initrd /boot/initramfs-linux-libre.img

But using the BY-ID, is very important when to use on several machines, because it will be recognize by the hardware identification, it should be like this:

root   (hd0,0)
kernel /boot/vmlinuz-linux-libre root=/dev/disk/by-id/usb-Kingston_DT_100_G2_0013729B6EB8EB6115590179-0:0-part1 ro
initrd /boot/initramfs-linux-libre.img

5 Tips

5.1 Painless boot on different machines without using UUID

This article or section is out of date.
Please help improve the wiki by updating the article and correcting mistakes.

When using the USB key on various target machines, it is helpful to have multiple entries in GRUB, for machines with different setups. For example, the GRUB configuration could contain:

# (0) Parabola GNU/Linux-Libre
title  Parabola GNU/Linux-Libre (first drive)
root   (hd0,0)
kernel /boot/vmlinuz-linux-libre root=/dev/sda1 ro
initrd /boot/initramfs-linux-libre.img

As well as

# (1) Parabola GNU/Linux-Libre
title  Parabola GNU/Linux-Libre (second drive)
root   (hd0,0)
kernel /boot/vmlinuz-linux-libre root=/dev/sdb1 ro
initrd /boot/initramfs-linux-libre.img

And so forth, giving you the option to select a configuration for a wider variety of machines. However, changing the root= option in GRUB does not change /etc/fstab and you must do something (in our example using udev symlink), so the root partition will always be mounted correctly.

  • Run udevinfo -p /sys/block/sdx/ -a (where sdx is the device name of your usb key)
  • Find unique information pertaining to your usb key. I chose SYSFS{model}=="DataTraveler 2.0"
  • Make a new file: /etc/udev/udev.rules/10-my-usb-key.rules and insert:
KERNEL=="sd**", SYSFS{product}=="DataTraveler 2.0", SYMLINK+="WHATEVERYOUWANTOTCALLIT%n"
(KERNEL=="sd**" is because the kernel - 2.6.16 here - names all usb devices sd as it uses the scsi sub-system and you want to look at every sd device and apply the setting to every partition), with SYSFS{model}== being the unique identifier collected from udevinfo.
  • Run /etc/start-udev uevents and make sure the symlinks appears in /dev.
  • If so, edit /etc/fstab, replacing your old sdx with the new symlinks.

5.2 Optimizing for the lifespan of flash memory

5.3 F2FS flash friendly file-system

F2FS has been tested successfully with some Unices but reports of Parabola are yet to be posted.

6 See Also

7 Acknowledgement

This wiki article is based on ArchWiki. We may have removed non-FSDG bits from it.