[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Solved (kind of)] Re: Installing Wheezy on btrfs only (multi-device)



On Mon, May 28, 2012 at 6:44 AM, Tom H <tomh0665@gmail.com> wrote:
>
> I created a 2-disk device using a live disk ("mkfs.btrfs -L th -m
> raid1 -d raid1 /dev/sda1 /dev/sdb1") and Precise was installed on (I
> chose /dev/sda1 from the d-i partition menu) and was bootable, and sda
> was mirrored to sdb.
>
> I ran bootinfoscript after booting into the install and found that
> grub was installed in the MBR of sda but not of sdb. I ran
> "grub-install /dev/sdb", re-ran bootinfoscript, and found that grub2's
> installed on sdb, but it's "installed in the MBR of /dev/sdb and looks
> at sector 1 of the same hard drive for core.img. core.img is at this
> location and uses an embedded config file: ...". (For the record,
> running "grub-install /dev/sda" installs grub on sda "properly,"
> without embedding.)
>
> I rebooted without sda connected and was dropped to an initramfs
> shell, so "/boot"-on-btrfs isn't yet ready for a multidevice setup; at
> least not without some extra work like, possibly, installing grub on
> sdb while booted from a live or rescue disk.


1. "/boot" on btrfs

This is the changelog [a]. It's the first (last!) entry for 2011.

a. http://packages.debian.org/changelogs/pool/main/p/partman-btrfs/partman-btrfs_8/changelog


2. Booting from initramfs shell

I've tracked down the problem to the fact that "$rootmnt" is "/root"
but, in the case of booting from one device of a degraded array,
"$rootmnt" has to be "/root/@".


3. grub-install on sda and sdb

Even though the embedded config file isn't the reason for being dumped
to an initramfs shell, I thought that I'd try to have grub installed
the same way on both disks...

Booted from a live disk, grub-probe fails when querying "/" inside and
outside the chroot (for a an ext4 installs, it fails only outside the
chroot so there's a problem with btrfs...).

So I ran "grub-install --boot-directory=/mnt/@/boot/grub /dev/sda" and
"grub-install --boot-directory=/mnt/@/boot/grub /dev/sdb".

I rebooted and ended up at a "grub rescue" prompt because the prefix
was "(hd0.msdos1)/boot/grub" rather than "(hd0,msdos1)/@/boot/grub".
That pesky "@" again...

So I booted from a live disk, created a core.img with the correct
prefix, installed it with grub-setup, and the VM's booting fine with
both disks connected.


Reply to: