Difference between revisions of "Mkinitcpio-btrfs"

From ArchWiki
Jump to: navigation, search
(Final)
Line 105: Line 105:
 
</pre>
 
</pre>
  
=== Final ===
+
== Final ==
  
 
We have almost done, don't forget to edit /etc/rc.conf, set root password, and other. Good luck with reboot!
 
We have almost done, don't forget to edit /etc/rc.conf, set root password, and other. Good luck with reboot!

Revision as of 01:23, 18 November 2010

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

This article explains how to install ArchLinux on a single Btrfs partition without separate boot using syslinux bootloader.

Warning: Btrfs is still experimental, this article provided only for academic use.

Preparation

System to use while installation

I recommend you to boot using Live ArchLinux image, or other ArchLinux system.

Btrfs-progs

To create Btrfs filesystem you will need a btrfs-progs package. There is the btrfs-progs-unstable in [extra], but I recommend you to install btrfs-progs-git from AUR.

Preparing hard drive

Make a partition for the installation.

Creating Btrfs filesystem

mkfs.btrfs /dev/sda1
mkdir /mnt/target
mount /dev/sda1 /mnt/target
btrfs subvolume create /mnt/target/archlinux
chmod 755 /mnt/target/archlinux # we don't want 700 for our / isn't it?
umount /mnt/target
mount -o subvol=archlinux /dev/sda1 /mnt/target
mkdir /mnt/target/boot
mount /dev/sda1 /mnt/target/boot

You now have a Btrfs formatted partition with subvolume named archlinux mounted on /mnt/target, and top-level volume mounted on /mnt/target/boot.

Note: /boot mount point is required to point to top-level Btrfs volume, because there is no subvolumes support in syslinux bootloader for now.

Installing the system

My favorite way of installing ArchLinux, the manual installation :-).

Base

cd /mnt/target/
mkdir -p dev proc sys var/lib/pacman
mount -o bind /dev dev
mount -t proc none proc
mount -t sysfs none sys
pacman -r . -Sy base syslinux

AUR Packages

You will need some additional packages - btrfs-progs-git and mkinitcpio-btrfs. Build them and install with:

pacman -r /mnt/target -U <pkg>

After installing the second, add "btrfs" hook in /etc/mkinitcpio.conf HOOKS and rebuild initrd:

chroot /mnt/target
mkinitcpio -p kernel26
exit

/etc/fstab

Don't forget to add this into /etc/fstab:

/dev/sda1	       /             btrfs     subvol=archlinux    0      0
/dev/sda1	       /boot         btrfs     default             0      0
Note: Fully functional fsck.btrfs is not released yet, and ArchLinux works with its limited version in wrong way.

Installing the bootloader

chroot /mnt/target
mkdir /boot/syslinux
extlinux --install /boot/syslinux
cat /usr/lib/syslinux/mbr.bin >/dev/sda
vi /boot/syslinux/syslinux.cfg
exit

Some sample syslinux.cfg:

PROMPT 0
TIMEOUT 0
DEFAULT arch

LABEL arch
	LINUX /vmlinuz26
	APPEND root=/dev/sda1 rootflags=subvol=archlinux ro
	INITRD /kernel26.img

Final

We have almost done, don't forget to edit /etc/rc.conf, set root password, and other. Good luck with reboot!

cd ~
umount /mnt/target/{dev,proc,sys,boot,}
reboot