Monday, April 14, 2014

IOLVMPartitionScheme - Basic Linux LVM support in Mac OS X

Today I'm publishing a new project on github:
Some time ago I wrote a Mac OS X kernel extension for parsing and exposing simple Linux LVM volumes as partitions, mostly for my own use at home since I have various Linux distributions set up on many of my Macs. Many of those use an LVM layout for the root file system, which means Mac OS X cannot access it (e.g. using fuse-ext2).
Today the code is available on github under an LGPL v2.1 license. This should hopefully be usefeul to anyone having the same problem as I did.
This kernel extension simplifies an LVM layout into a partition scheme. This means that only single-PV LVM layouts are supported and only contiguous simple LVM volumes are exposed as partitions.
It has not been widely tested, only by myself internally. Feedback is much appreciated.
Possible future development may include extending this kernel extension to fully supporting LVM concatenated volumes spanning several drives, snapshots, etc. (This is not currently planned.)
Precompiled kernel extension:
IOLVMPartitionScheme-2014.11.15.tar.bz2 (source code)
Supported Mac OS X versions: 10.5 and higher (i386, x86_64 and ppc kernels are supported)
Please report any problems encountered as issues on github:
Old versions:
IOLVMPartitionScheme-2014.4.14f1.tar.bz2 (source code)
IOLVMPartitionScheme-2014.4.14.tar.bz2 (source code)


Dustin Wright said...

Would this work /w an iSCSI device? I installed your kext but the LVM volumes don't appear when I connect to iSCSI.

This would be really great feature.

Erik said...

Dustin Wright, November 19, 2014 at 6:52 PM:

I have never personally used iSCSI, but as long as it exposes the devices as if they were normal disks (i.e. as /dev/disk, /dev/rdisk) then I suppose it should work.

However please keep in mind the limitation of this kernel extension... you will only be able to access single-disk, non-fragmented LVM volumes... no mirrors, stripes, concatenated volumes.

I have made a few fixes recently and I just updated the kernel extension to version 2014.11.15. Please try again with the version... if it still does not work then please create a new issue on github including dmesg output.

Anonymous said...

I added the extension to the kernel now what is supposed to happen? Will the partitions mount automatically? How do I use the extension?

Erik said...

Mario Brenes, December 29, 2014 at 4:57 PM:

This partition scheme driver only parses the LVM layout and exposes it as partitions.
If it works, you you should see subvolumes appear under the LVM partition in Disk Utility.

You have to use a file system driver that supports the file system that is used on the LVM volume to actually mount it. In the Ext2/3/4 case, fuse-ext2 should do it.

Anonymous said...

hfsexplorer is not allowed by norton due to some ws.reputation.1 network threat.

Erik said...

@Anonymous: I think you should contact Norton about that if you're a paying customer. I can't really help with it since I am not.
In general if you're uncertain about a file you can upload it to VirusTotal to check it with all virus scanners.

DigIt said...

I'm afraid your Extension is not working for me on a 10.8.5 machine (although the KEXT is properly installed and active): I'm trying to mount a 'simple volume' from a Synology NAS.

As suggested when I first installed the NAS I did choose the SHR (you guessed it: Synology Hybrid RAID) and the DSM doesn't even tell me what kind of File System has been used but I suspect the [= brtf =].

I assume your KEXT will not be of any help here or am I missing something?

The HD has three partitions: the first is an ext3 with the system on it and it mounts straight away (I have a mac supporting both EXT and NTFS FS) but the other two partitions even if I can see them in discutils there is no way to mount them from there, and they are listed as empty.
Beside a proper Linux or VM systems, is there any hope?

Please let me know if you have any suggestions.


Erik said...

@DigIt: It has been a while now since I worked on this project, however if you are able to compile the project on your Mac, could you check the output of the LVMTest binary and run it on the LVM partition?

sudo LVMTest /dev/diskXsY

(X and Y replaced by the disk and partition number)

This binary should display the information that the code is able to retrieve from your LVM volume.