虽然网上也有很多教程,但是我follow了很多还是没有成功,最后在同学的帮助下终于成功了。
首先说明一下基本情况:我是将arch linux装在一个16G的金士顿U盘里,利用了另外一个4G的U盘制作了一个LIVE CD,注意,做LIVE CD的U盘在启动linux之后是不能执行fdisk操作的,因此如果U盘A作为LIVE CD,则系统只能装在U盘B上或者其他硬盘上。
我是在windows下制作的LIVE CD,方法很多,这篇博客的内容很详细,很好操作。
==================注:以下内容转自(http://www.2cto.com/os/201207/143614.html)=======================================================
- ln -s /dev/sdd /dev/disk/by-label/ARCH_201306
Installation
Keyboard layout(绑定键盘,但是中国的键盘和美国标准键盘一致,所以可以跳过)
For many countries and keyboard types appropriate keymaps are available already, and a command like loadkeys uk
might do what you want. More available keymap files can be found in /usr/share/kbd/keymaps/
(you can omit the keymap path and file extension when using loadkeys).
Partition disks(为需要安装linux的盘分区)
用fdisk命令,具体可以man fdisk或者fdisk --help
Format the partitions(格式化分区)
用命令mkfs.ext4之类的,如果需要格式化为fat格式,则需要先安装dosfstools
Mount the partitions(挂载分区)
We now must mount the root partition on /mnt
. You should also create directories for and mount any other partitions (/mnt/boot
, /mnt/home
, ...) and mount your swap partition if you want them to be detected by genfstab
.
Connect to the internet(设置联网)
A DHCP service is already enabled for all available devices. If you need to setup a static IP or use management tools such as Netctl, you should stop this service first: systemctl stop dhcpcd.service
. For more information read configuring network.
Wireless
Run wifi-menu
to set up your wireless network. For details, see Wireless Setup and Netctl.
Install the base system
Before installing, you may want to edit /etc/pacman.d/mirrorlist
such that your preferred mirror is first. This copy of the mirrorlist will be installed on your new system by pacstrap
as well, so it's worth getting it right.
Using the pacstrap script we install the base system.
# pacstrap /mnt base
Other packages can be installed by appending their names to the above command (space seperated), including the bootloader if you want.
Configure the system
- Generate an fstab with the following command (if you prefer to use UUIDs or labels, add the
-U
or-L
option, respectively):
-
# genfstab -p /mnt >> /mnt/etc/fstab
- chroot into our newly installed system:
-
# arch-chroot /mnt
- Write your hostname to
/etc/hostname
.
- Symlink
/etc/localtime
to/usr/share/zoneinfo/Zone/SubZone
. ReplaceZone
andSubzone
to your liking. For example:
-
# ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime
- Uncomment the selected locale in
/etc/locale.gen
and generate it withlocale-gen
. - Set locale preferences in
/etc/locale.conf
. - Add console keymap and font preferences in
/etc/vconsole.conf
- Configure
/etc/mkinitcpio.conf
as needed (see mkinitcpio) and create an initial RAM disk with:
-
# mkinitcpio -p linux
- Set a root password with
passwd
. - Configure the network again for newly installed environment. See Network Configuration and Wireless Setup.
Install and configure a bootloader
You can choose GRUB or Syslinux.
GRUB
- For BIOS:
# pacman -S grub-bios
- For EFI (in rare cases you will need
grub-efi-i386
instead):
# pacman -S grub-efi-x86_64
See GRUB installation and Configuration
Syslinux
# pacman -S syslinux
不出意外的话,U盘就能引导U盘里面的系统启动了。
- # pacman -S grub-bios os-prober
- # grub-install /dev/sdc --boot-directory=/boot
- # grub-mkconfig > /boot/grub/grub.cfg
Unmount and reboot
If you are still in the chroot environment type exit
or press Ctrl+D
in order to exit. Earlier we mounted the partitions under /mnt
. In this step we will unmount them:
# umount /mnt/{boot,home,}
Now reboot and then login into the new system with the root account.
==================================================================================================================================