Installing Arch Linux on a USB key

From ArchWiki
Revision as of 17:02, 17 January 2007 by Drynish (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

First Step

Grab yourself a CD of arch linux that you want to install on the USB key. I suggest one with the mkinitcpio, so 0.8 should be a good idea.

Second Step

Boot with the CD, I had to boot with arch noscsi since it created an error when I tried to load the usb-storage module. On boot, you will have to load scsi module (I loaded sr, sg). I'm not too sure about which one should be loaded, I'm just telling you the steps I took. I also loaded the usb-storage. Now you can try to mount the usb key. When inserted, you should see it in your dmesg and the usb key should be on /dev/sda.

Now you could go right away into the /arch/setup file to reach the section List_HardDrives at line xxx and to comment two lines (the if / end if) so that all HD possible will shown up in the installer.

Third step

Launch the installer (/arch/setup). Select the method you prefer (I used the ftp one). When preparing the Hard Drives, select manual partitionning, select other hard drives and there you can select the /dev/sda (of your usb key). After you will see a long list of all partitions available, select the one coming from the usb key (me, /dev/sda1). Everything should go right from there.

Fourth step

The /etc/fstab must countains the /dev/sda1 and other partitions on the disk for the root.

The grub configuration must contains the following to work:

root (hd0,0) kernel /vmlinuz26 root=/dev/sda1 ro vga=773 initrd /kernel26-fallback.img

explanation: Since the key will be booted as a Hard Drive, this is the reason why the root is on hd0.

You must generate a new image of the kernel26.img. Modify the fallback ( /etc/mkinitcpio.d/fallback ), change in the hooks list the usbinput to usb. That way, it will load everything to use a usb drive as a hd­.

Regenerate your image by using this command : mkinitcpio -c /etc/mkinitcpio.d/fallback -g /boot/kernel26-fallback.img

That way I was able to boot on the usb key and install everything I want onto it.