Installing Arch Linux on a USB key (日本語)
このページでは標準的な Arch のインストールを USB キー (または"フラッシュドライブ") で行う方法を説明しています。USB インストールメディアで説明している LiveUSB の作り方と違って、HDD に通常インストールするのと同じように USB フラッシュドライブにインストールを行います。
Contents
準備
USB スティックに Arch をインストールする方法は様々ありますが、一番シンプルなのは Arch からインストールする方法です:
- If you are already running Arch, simply install arch-install-scripts and proceed with the installation guide just like you would from the iso, but you will not be using
/dev/sda
. Use$ lsblk
to get the/dev/sd*
name of your USB key prior to installation.
- An Arch Linux CD/USB can be used to install Arch onto the USB key, via booting the CD/USB and following the installation guide. If booting from a Live USB, the installation will have to be made on a different USB stick.
- Or, if you have another Linux computer available (it need not be Arch), you can follow the instructions to install from existing Linux, and then skip to the configuration section.
- If you have windows or a mac download VirtualBox, install VirtualBox Extensions, add the USB drive to a virtual machine running arch (for example running from an iso), point the installation into the USB drive.
インストール
Follow the installation guide as you normally would, with these exceptions:
- 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
), typefdisk /dev/sdX
(wheresdX
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 disk reads/writes on the SSD wiki article prior to selecting a filesystem. To sum up, ext4 without a journal should be fine, which can be created with
# mkfs.ext4 -O "^has_journal" /dev/sdXX
. 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 forget the swap partition. Note that this does not affect installing onto a USB hard drive. - Before creating the initial RAM disk
# mkinitcpio -p linux
, in/etc/mkinitcpio.conf
add theblock
hook to the hooks array right after udev. This is necessary for appropriate module loading in early userspace. - If you want to be able to continue to use the UFD device as a cross-platform removable drive, this can be accomplished by creating a partition housing an appropriate file system (most likely NTFS or exFAT). Note that the data partition may need to be the first partition on the device, as Windows assumes that there can only be one partition on a removable device, and will happily automount an EFI system partition otherwise. Remember to install dosfstools and ntfs-3g. Some tools are available online that may allow you to flip the removable media bit on your UFD device. This would trick operating systems into treating your UFD device as an external hard disk and allow you to use whichever partitioning scheme you choose.
- Install NetworkManager to control networks, it supports changing interface names of different hardware.
設定
- 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 UUID or label:
To get the proper UUIDs for your partitions issue blkid
GRUB legacy
menu.lst
, the GRUB legacy configuration file, should be edited to (loosely) match the following:
With the static /dev/sdaX
:
root (hd0,0) kernel /boot/vmlinuz-linux root=/dev/sda1 ro initrd /boot/initramfs-linux.img
When using label your menu.lst should look like this:
root (hd0,0) kernel /boot/vmlinuz-linux root=/dev/disk/by-label/Arch ro initrd /boot/initramfs-linux.img
And for UUID, it should be like this:
root (hd0,0) kernel /boot/vmlinuz-linux root=/dev/disk/by-uuid/3a9f8929-627b-4667-9db4-388c4eaaf9fa ro initrd /boot/initramfs-linux.img
Syslinux
With the static /dev/sdaX
:
LABEL Arch MENU LABEL Arch Linux LINUX ../vmlinuz-linux APPEND root=/dev/sdax ro INITRD ../initramfs-linux.img
Using your UUID:
LABEL Arch MENU LABEL Arch Linux LINUX ../vmlinuz-linux APPEND root=UUID=3a9f8929-627b-4667-9db4-388c4eaaf9fa ro INITRD ../initramfs-linux.img
Tips
複数のマシンで USB インストールを使う
アーキテクチャ
For the most versatile compatibility it is recommended that you install the i686 architecture because it will run on both 32 (IA-32) and 64 (amd64) bit architectures.
Additionally, due to the reduzed size of 32 bit binaries and the absence of (possible) multilib packages, an i686 installation typically consumes less space than an equivalent x86_64 one.
インプットドライバー
For laptop use (or use with a tactile screen) you will need the xf86-input-synaptics package for the touchpad/touchscreen to work.
For instructions on fine tuning or troubleshooting touchpad issues, see the Touchpad Synaptics article.
ビデオドライバー
The recommended video drivers are: xf86-video-vesa mesa xf86-video-ati xf86-video-intel xf86-video-nouveau xf86-video-nv.
For the most versatile compatibility install all of the open source video drivers include their multilib counterparts lib32-mesa-dri[broken link: replaced by lib32-mesa].
永続的なブロックデバイス命名
It is recommended to use UUID in both fstab and bootloader configuration. See Persistent block device naming for details.
Alternatively, you may create udev rule to create custom symlink for your usb key. Then use this symlink in fstab and bootloader configuration. See udev#Setting static device names for details.
カーネルパラメータ
You may want to disable KMS for various reasons, such as getting a blank screen or a "no signal" error from the display, when using some Intel video cards, etc. To disable KMS, add nomodeset
as a kernel parameter. See Kernel parameters for more info.
USB-3 メディアから起動
[1] を見て下さい。
互換性
The fallback image should be used for maximum compatibility.