You are not logged in.

#1 2011-11-04 17:30:33

Azendale
Member
Registered: 2011-11-04
Posts: 3

[SOLVED] Install to BtrFS already existing (but empty) subvolume

I currently have a Btrfs filesystem made up of /dev/sda5 and /dev/sda6. On that filesystem, there is an Ubuntu 11.10 install in the @oneiric_main subvolume and a data subvolume (with Ubuntu /home) in the @Data subvolume. Grub2 is installed in the @oneiric_main subvolume and works fine.

I would like to install arch to a new subvolume on the existing BtrFS filesystem. I would probably make a subvolume named @arch_2011.08 to install it on. (@arch is taken--I already tried to do this myself, installing using pacman -r <subvol_mount_point> -Sy base --ignore grub. Didn't work, has no initrd, kernel panics with VFS not syncing error) I would like to then boot Arch with Ubuntu's Grub2 since that install is working off BtrFS. How do I go about doing this?

On the install that failed, I generally tried to follow https://wiki.archlinux.org/index.php/In … Btrfs_root, but I didn't really need/want automatic snapshots, so I didn't think I wanted to install mkinitcpio-btrfs. For it my Grub2 entry is

menuentry "Arch (on /dev/sda6)" --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod btrfs
	set root='(hd0,msdos6)'
	search --no-floppy --fs-uuid --set=root d551dbac-3c7f-4f8f-a0d4-2d1f242cc42f
	linux /@arch/boot/vmlinuz-linux root=/dev/disk/by-uuid/d551dbac-3c7f-4f8f-a0d4-2d1f242cc42f rootflags=subvol=@arch ro 
}

I've tried to chroot to the Arch install from Ubuntu and run mkinitcpio, but that gave an error that some directory was not valid. The directory it complained about had the Ubuntu kernel version in its name, so I figured I was doing something majorly wrong. Edit:I suppose it would help if I updated the /etc/fstab. I did, but I still get the same error. The first line is "Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)"

I'm not sure if I should try to fix the first install or just start again. Either way would get the goal:Arch installed on the BtrFS subvolume, booted with Ubuntu's Grub2.

Last edited by Azendale (2011-12-17 22:34:16)

Offline

#2 2011-11-04 23:12:26

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [SOLVED] Install to BtrFS already existing (but empty) subvolume

If /@arch/boot/vmlinuz-linux is a standard arch kernel, then you miss an initrd.
Did you mount /proc, /sys and /dev into the @arch subvolume before chrooting. mkinitcpio will not work without it.

Literal error output would be helpful.

Offline

#3 2011-11-05 05:57:16

Azendale
Member
Registered: 2011-11-04
Posts: 3

Re: [SOLVED] Install to BtrFS already existing (but empty) subvolume

@Teekay:I did mount /proc, /sys and /dev into the @arch subvolume before chrooting.
Here's what happens when I try to chroot into the Arch install to make an initrd:

[root@dynl:~]# mount -o subvol=@arch /dev/sda5 /mnt
[root@dynl:~]# cd /mnt
[root@dynl:/mnt]# mount -o bind /dev dev
[root@dynl:/mnt]# mount -o bind /sys sys
[root@dynl:/mnt]# mount -o bind /proc proc
[root@dynl:/mnt]# chroot .
chroot: failed to run command `/bin/zsh': No such file or directory
[root@dynl:/mnt]# chroot . bash
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[root@dynl /]# ls
bin   dev  home  lib64  mnt  proc  run   srv  tmp  var
boot  etc  lib   media  opt  root  sbin  sys  usr
[root@dynl /]# mount
/dev/sda5 on / type btrfs (rw,relatime)
udev on /dev type devtmpfs (rw,relatime,size=693104k,nr_inodes=173276,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
[root@dynl /]# mkinitcpio
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
==> ERROR: '/lib/modules/3.1.0-030100rc10-generic' is not a valid kernel module directory

--------------

Update: I've made progress. Instead of chrooting from Ubuntu, I chooted from the arch installation live image. I was able to run mkinitcpio -p linux. I added an initrd line to grub2:

menuentry "Arch (on /dev/sda6)" --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod btrfs
	set root='(hd0,msdos6)'
	search --no-floppy --fs-uuid --set=root d551dbac-3c7f-4f8f-a0d4-2d1f242cc42f
	linux /@arch/boot/vmlinuz-linux root=/dev/disk/by-uuid/d551dbac-3c7f-4f8f-a0d4-2d1f242cc42f rootflags=subvol=@arch ro 
        initrd /@arch/boot/initramfs-linux.img
}

The new error is :

Decompressing Linux... Parsing ELF... done.
Booting the kernel.
:: Starting udevd...
done.
:: Running Hook [udev]
:: Triggering uevents...done.
Waiting 10 seconds for device /dev/sda6 ...
mount: mounting dev/sda6 on /new_root failed: Invalid argument
ERROR: Failed to mount the real root device. 
bailing out, you are on your own. Good luck.

sh: can't access tty; job control turned off
[ramfs /]#

Also, the Arch /etc/fstab is:

# 
# /etc/fstab: static file system information
#
# <file system>	                             <dir>	<type>	<options>              <dump>	<pass>
tmpfs                                        /tmp	tmpfs	nodev,nosuid           0	0
UUID=d551dbac-3c7f-4f8f-a0d4-2d1f242cc42f    /          btrfs   defaults,subvol=@arch  0        0

Last edited by Azendale (2011-11-05 06:43:49)

Offline

#4 2011-11-11 08:47:13

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [SOLVED] Install to BtrFS already existing (but empty) subvolume

It looks like Grub can find the kernel, which is good.

You will also need the btrfs module in the initrd image.
Adjust your /etc/mkinitcpio.conf and add btrfs to the MODULES section. (I also did put the pata_atiixp module in there for my SATA controller, just to be safe)

MODULES="btrfs"

Then re-run mkinitcpio.

Last edited by teekay (2011-11-11 08:48:10)

Offline

#5 2011-11-15 17:49:18

Azendale
Member
Registered: 2011-11-04
Posts: 3

Re: [SOLVED] Install to BtrFS already existing (but empty) subvolume

Thanks teekay! Editing /etc/mkinitcpio.conf to have "btrfs" in the MODULES section, and running "mkinitcpio -p linux" from a chroot of the LiveUSB image worked.

Offline

#6 2011-11-15 20:07:46

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [SOLVED] Install to BtrFS already existing (but empty) subvolume

Azendale, please mark this thread [SOLVED] by editing the title of your first post.


To know or not to know ...
... the questions remain forever.

Offline

Board footer

Powered by FluxBB