User:Cdwijs/Bootable stick with low-latency audio and DJ tools

From ArchWiki

Category:Sound

It's possible to run an arch linux system from a thumb drive. This page is a step-by-step guide to create a system that's geared towards low-latency audio and DJ work running from a thumb drive

goals

-Runs from a memory stick -Runs on as many machines as possible -persistent home directory -persistent program directories -some dirs in RAM

Optimized for low-latency Music programs like Ardour, mixxx audacity and the like included

Method

Use LVM to use 1 or more files on a fat32 partition as physical volumes, and start arch linux from there


Part 1 install base system on a memory stick

Download arch linux image

Download archlinux-2017.08.01-x86_64.iso For more information see Arch Linux Downloads

[optional] virtual box

Install virtualbox and the extension pack from VirtualBox.org and install it. Create a new virtual machine with the following options:

name: archUSB
memory: 1GB
hard disk: create, VDI, dynamocally allocated, 8GB, create
Settings: storage, controller:IDE empty: choose virtual optical disk file, archlinux-2017.08.01-x86_64.iso

Boot the (virtual) PC

Insert the target memory stick. Optionally, disconnect all other drives from the system to prevent accidental installation on the wrong disk. Boot the PC

Partition and format the memory stick

fdisk /dev/sda
mkfs.vfat /dev/sda1

Create 4 files of 1GB each that will hold the LVM pysical volumes:

mkdir /mnt/targetstick
mount /dev/sda1 /mnt/targetstick
cd /mnt/targetstick
dd if=/dev/zero of=./ArchPV1.img bs=1024 count=1M
dd if=/dev/zero of=./ArchPV2.img bs=1024 count=1M
dd if=/dev/zero of=./ArchPV3.img bs=1024 count=1M
dd if=/dev/zero of=./ArchPV4.img bs=1024 count=1M

Loop mount the files. /dev/loop0 is already in use, therefore loop 1 true 4 are used here

losetup /dev/loop1 ArchPV1.img
losetup /dev/loop2 ArchPV2.img
losetup /dev/loop3 ArchPV3.img
losetup /dev/loop4 ArchPV4.img

Partition the 4 loop devices. Create one primary partition with type 8e (Linux LVM)

fdisk /dev/loop1 and then enter the commands: n,p,1,Enter,Enter,t,8e,w,q
fdisk /dev/loop2 and then enter the commands: n,p,1,Enter,Enter,t,8e,w,q
fdisk /dev/loop3 and then enter the commands: n,p,1,Enter,Enter,t,8e,w,q
fdisk /dev/loop4 and then enter the commands: n,p,1,Enter,Enter,t,8e,w,q
partprobe /dev/loop1
partprobe /dev/loop2
partprobe /dev/loop3
partprobe /dev/loop4

Create the physical volumes:

pvcreate /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4and wipe the dos signature

Create and extend the volume group

vgcreate ArchVG /dev/loop1
vgextend ArchVG /dev/loop2
vgextend ArchVG /dev/loop3
vgextend ArchVG /dev/loop4

Create the logical volume

 lvcreate -l 100%VG -nArchLV ArchVG
mkfs.ext4 /dev/mapper/ArchVG-ArchLV (reports an IO error dev loop1, sector 2048)

Mount the filesystem

mkdir /mnt/target
mount /dev/mapper/ArchVG-ArchLV /mnt/target

Install the base system and lvm2

pacstrap /mnt/target base lvm2
genfstab -U /mnt/target /mnt/target/etc/fstab
arch-chroot /mnt/target
Add lvm in /etc/mkinitcpio.conf
mkinitcpio -p linux
passwd


Sources

This page uses information from the following sources:

http://valleycat.org/foo/arch-usb.html?i=1
https://wiki.archlinux.org/index.php/Installing_Arch_Linux_on_a_USB_key
https://www.linuxmusicians.com/viewtopic.php?f=19&t=10837
https://wiki.archlinux.org/index.php/Archiso
https://wiki.archlinux.org/index.php/Remastering_the_Install_ISO
https://bitbucket.org/patatetom/didjix/wiki/Home
http://easy.open.and.free.fr/didjix/faq.html
http://www.anthonyldechiaro.com/blog/2010/12/19/lvm-loopback-how-to/
https://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/LV_create.html
https://wiki.archlinux.org/index.php/LVM
https://wiki.archlinux.org/index.php/GRUB

Forum discussions

https://bbs.archlinux.org/viewtopic.php?id=95663 

Aspects of this wiki page is discussed at the following forum threads

https://bbs.archlinux.org/viewtopic.php?id=228644