Make USB Stick Bootable

In various forums one reads that one should use dd to copy a ISO image to an USB stick. Although this works, more often you do not want to use a ISO image but rather copy a Linux system at hand. First you mount the root filesystem of the new USB stick, then mount /boot within a chroot. Finally use grub commands. I.e., type

mount /dev/sdc2 /mnt/stick
arch-chroot /mnt/stick
mount /dev/sdc1 /boot           <--- /boot is local to chroot!
grub-install --target=i386-pc --boot-directory=/boot /dev/sdc
grub-mkconfig -o /boot/grub/grub.cfg
umount /boot                    <--- umount "local" /boot

Also see GRUB in the Arch Wiki.

Setting the bootable flag in the partition table one either uses gparted, a graphical tool, or, as the task at hand is so simple, one just uses parted.

parted /dev/sdc
set 1 boot on
print

Unrelated, but often useful. Just in case you changed something in the initial RAM disk, use

mkinitcpio -p linux

Re-installing Grub when MS Windows Destroyed It

I have now done it a couple of times, but always have to look it up. Here are the steps to re-install Grub from a live Ubuntu CD, when you have Windows and Linux on your hard disk. You must be root, or run these commands with sudo. Change /dev/sdaXY accordingly.

  1. mount /dev/sda2 /mnt
  2. mount /dev/sda3 /mnt/boot, if you have a separate boot partition
  3. mount -o bind /dev /mnt/dev
  4. mount -o bind /sys /mnt/sys
  5. mount -t proc /proc /mnt/proc
  6. chroot /mnt /bin/bash
  7. grub-install /dev/sda

Above commands are from method 3 in GRUB (in German).