Skip to content
This repository has been archived by the owner. It is now read-only.

ZFS rootfs disk drives are different #569

Open
mrcarembole opened this issue Mar 22, 2016 · 6 comments
Open

ZFS rootfs disk drives are different #569

mrcarembole opened this issue Mar 22, 2016 · 6 comments

Comments

@mrcarembole
Copy link

@mrcarembole mrcarembole commented Mar 22, 2016

Problem:

When doing a fresh install in a VM, i've noticted that the drives used for my rootfs were not partionned the same way :
(GPT SCHEME, Cnchi 0.14.68)
sda is a VDI of 8G
sda1 2M part
sda2 512M part (mounted at /install/boot)
sda3 7.5G part (zfs member of the mirror rootfs)

sdb is a VDI of 8G
sdb1 8G part
sdb9 8M part

looks like the whole sdb disk was added to the rootfs zpool, instead of being partitionned like sda.

After a quick look in zfs.py file, around line 687, it looks like it's only using the first device in the list of install drives, that may be why it's not partioning//formating like it should

 for device_path in device_paths[1:]:
            self.init_device(device_path, "GPT")

        device_path = device_paths[0]

Steps To Reproduce:

  1. Get vbox + latest antergos iso
  2. Create a standard linux vm with 2 identical virtual drives
  3. Choose zfs auto install with mirror rootfs pool of the two drives
  4. lsblk + zpool status during install shows the problem.

Additional Notes:

After reboot im not able to login : /

Regards,

@mrcarembole

This comment has been minimized.

Copy link
Author

@mrcarembole mrcarembole commented Mar 22, 2016

After thinking a bit more, if we dont create the /boot partition on each disk of the rpool, if we loose the one with the /boot, we're doomed and can't boot without any recovery environnement, but it forces us to maintain every /boot up to date, the easiest way to fix that, and to not have to are about big problems, is to make all /boot partition agreggated in a mdadm raid1 array if we can't make it a zfs volume.
After creating and mounting the raid1 array it should be a piece of cake (installing mbr on all drives and voila)

@mrcarembole

This comment has been minimized.

Copy link
Author

@mrcarembole mrcarembole commented Mar 24, 2016

Got a working install with raid1 /boot in mbr (not tried gpt as i don't need it for now, and don't have the time right now to test it)
How did i do :
- Automated install to /dev/sda
- After install reboot to livecd (was having issues with zpool import//export after install was complete)
- Copy the partition scheme of /dev/sda to /dev/sdb
- Create a degraded mirror /dev/md0 with /dev/sdb1
- Formated /dev/md0 like /dev/sda1 was and copied the content.
- Added /dev/sda1 to /dev/md0, and added /dev/sdb2 to rpool as a mirror
- Updated /install/etc/mdadm.conf, updated /install/etc/zpool.cache
- Updated /install/etc/mkinitcpio.conf HOOKS for mdadm
- Updated /install/etc/fstab
- Updated /install/etc/default/grub for mdadm
- chrooted in /install and grub-install /dev/md0 + Updated /etc/grub/grub.cfg (of chroot)
- Rebooted and enjoyed.

@karasu

This comment has been minimized.

Copy link
Member

@karasu karasu commented Mar 24, 2016

Main problem is that grub version didn't boot zfs directly, so we had to create a /boot partition outside zfs. @lots0logs has packaged a special version of grub. I have to do some tests with it. If this still does not work we might take your approach. Thanks a lot for sharing it.

@mrcarembole

This comment has been minimized.

Copy link
Author

@mrcarembole mrcarembole commented Mar 24, 2016

No problems :) I've been testing some stuff too with a custom version of grub, different version of the zpool (read something somewhere about version 28 that worked with grub, and a special mix of features of zfs that were supported), different setup (one rpool + one boot pool) no success so far, apparently the only way i have to have zfs only use one part, and grub install detecting zfs well, is to make a small 8MiB part at the end of the disk. will do some more testing and if i find something interesting ill post it here.

@danboid

This comment has been minimized.

Copy link

@danboid danboid commented Apr 8, 2016

Hi mrcarembole

I too would like to get Antergos/Arch installed and booting from a ZFS pool without having to use a separate /boot partition then going to all the hassle of setting that up as a separate software RAID1 etc. Have you made any progress with this? Did the 8MB part trick work?

karasu:

Has lots0logs made his special grub code/package/PKGBUILD public?

@danboid

This comment has been minimized.

Copy link

@danboid danboid commented Apr 9, 2016

I am now running Arch using ZFS installed to a single Solaris partition that fills my drive. NO boot partition or small padding partition at the end of the drive is required at all, at least not on a BIOS/MBR machine using GRUB. I can't comment on UEFI as I don't have a UEFI machine to test.

I have just updated the Arch ZFS install guide to fix and add a few things I discovered along the way:

https://wiki.archlinux.org/index.php/Installing_Arch_Linux_on_ZFS

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.