Re: LVM support
2011/10/4 Robert Millan <rmh@debian.org>:
> 2011/10/2 Stefan Lippers-Hollmann <s.L-H@gmx.de>:
>> [ Unrelated to this, I have been playing with the idea of doing a
>> kFreeBSD-amd64/ unstable installation on real hardware, to allow me
>> some further wpasupplicant (or lirc) testing, but all of my systems
>> use lvm2 on top of MSDOS or GPT partition tables spanning the whole
>> drive (/ on lvm2, no dedicated /boot/). This configuration is
>> apparently not supported by Debian/ kFreeBSD yet, e.g. d-i/ partman
>> doesn't offer to use the volume group or existing logical volumes
>> therein and grub2 can't find the root device, if copied manually.
>> While I have tested to move kFreeBSD manually to a prepared ufs2
>> filesystem on top of a LVM2 logical volume, which works fine after
>> adapting fstab and setting
>> kfreebsd_module_elf /lib/modules/8.2-1-amd64/geom_linux_lvm.ko
>> in grub.cfg of an external grub2 install (either on a regular
>> partition or linux / on lvm2) in kvm, I didn't try to move such
>> an install to real hardware, yet. ]
>
> This patch should fix your grub.cfg problem, could you test?
And as for D-I support, this one should enable detection in partman
menu (or almost).
Could you verify it works? You can do a quick check with:
rmh@thorin:/tmp/partman-base-147$ gcc parted_devices.c -o
parted_devices -lparted && sudo ./parted_devices
and see if it lists your LVM volumes.
--
Robert Millan
Index: parted-2.3/libparted/arch/freebsd.c
===================================================================
--- parted-2.3.orig/libparted/arch/freebsd.c 2011-10-04 07:04:59.000000000 +0200
+++ parted-2.3/libparted/arch/freebsd.c 2011-10-04 07:08:39.589736010 +0200
@@ -1140,6 +1140,31 @@
return 1;
}
+static int
+_probe_lvm_volumes ()
+{
+ DIR* lvm_dir;
+ struct dirent* lvm_dent;
+ char buf[PATH_MAX];
+ struct stat st;
+
+ lvm_dir = opendir ("/dev/linux_lvm");
+ if (!lvm_dir)
+ return 0;
+
+ while ((lvm_dent = readdir (lvm_dir))) {
+ if (strcmp (lvm_dent->d_name, ".") == 0 || strcmp (lvm_dent->d_name, "..") == 0)
+ continue;
+ snprintf (buf, sizeof (buf), "/dev/linux_lvm/%s", lvm_dent->d_name);
+ if (stat (buf, &st) != 0)
+ continue;
+ _ped_device_probe (buf);
+ }
+ closedir (lvm_dir);
+
+ return 1;
+}
+
static void
freebsd_probe_all ()
{
@@ -1148,6 +1173,8 @@
_probe_kern_disks ();
_probe_zfs_volumes ();
+
+ _probe_lvm_volumes ();
}
static char*
Reply to: