3

I have installed FreeBSD onto a raw image file using QEMU Emulator successfully. I have formatted the image file using the ZFS file system (ZFS POOL).

Using the following commands below I have successfully mounted the image file ready to be opened by zpool

sudo losetup /dev/loop0 [path-to-file].img
sudo kpartx -l /dev/loop0
sudo kpartx -av /dev/loop0

However with the next command show below....

sudo zpool import -R [MOUNT-PATH] -d /dev/mapper

I get the following error message

The pool can only be accessed in read-only mode on this system. It
    cannot be accessed in read-write mode because it uses the following
    feature(s) not supported on this system:
    com.delphix:spacemap_v2 (Space maps representing large segments are more efficient.)
The pool cannot be imported in read-write mode. Import the pool with
    "-o readonly=on", access the pool on a system that supports the
    required feature(s), or recreate the pool from backup.

I cannot find anywhere online about the feature called 'spacemap_v2'. How do I install this or how do I mount my zfs pool to be writable. I know I can mount it as read-only but that defeats the purpose of what I want to do as I want to be able to write data to copy/paste data in its mountable platform interface.

Does anyone know how to achieve this. I shall be grateful for a response.

Regards

1 Answers1

2

What version of FreeBSD are you using? And where did this ZFS pool come from?

I'm guessing it's a ZFS On Linux pool which, as the message says, is using a feature which FreeBSD's ZFS doesn't currently support.

The only way around it at the moment is to create another pool without the feature on a system that does support it, zfs send to the new pool and then import that pool into FreeBSD.

Note FreeBSD is going to support this feature Soon(tm).

Steve Wills
  • 740
  • 4
  • 8
  • Hi Steve I have used the following FreeBSD iso file for the cdrom file used by QEMU ..... FreeBSD-12.0-RELEASE-i386-dvd1.iso – greenelephant May 22 '19 at 07:23
  • I used the formatting facility in the FreeBSD setup to format the image file as ZFS . – greenelephant May 22 '19 at 07:24
  • I have begun to attempt to mount the image file using Xubuntu 18.04 terminal by typing in the 3 pre-requisite sudo commands found above. But the actual command to initiate mounting of the FreeBSD formatted img file as ZFS is not mounting successfully (as noted above concerning the com.delphix:spacemap_v2 issue) – greenelephant May 22 '19 at 07:29
  • One other point I would like to make is that I have used zfs-dkms to build the ZFS modules needed to attempt access to the image file and not zfs-fuse. (I have tried using zfs-fuse compiled modules but I get an error message stating that that the zpool cannot be imported as I need to update my system to a newer type.) I hope this extra information is is value to you. I look forward to any help I can receive :) – greenelephant May 22 '19 at 07:29
  • I don't think you answered my question about where the ZFS pool came from. And I don't know what `zfs-dkms` is, that may be a ZFS on Linux specific command. – Steve Wills May 22 '19 at 14:14
  • The ZFS pool was created during the freebsd installation setup. This was done using QEMU as the emulator running iso file "FreeBSD-12.0-RELEASE-i386-dvd1.iso" as cdrom inside QEMU. This meant (using Freebsd iso file) installing freebsd to an RAW image file that was created by qemu-img. It is on this RAW image file created by qemu-img that the ZFS pool resides on, I hope I have given you more clarity about my situation. If u can still help me, that would be great :) – greenelephant May 23 '19 at 14:26
  • BTW zfs-dkms is the program used by Xubuntu 18.04 to generate zfs module used by modprobe. This method (using zfs-dkms) is just another way of creating zfs modules apart from the orthodox method of installing zfs-fuse on Xubuntu using 'apt-get install' :) – greenelephant May 23 '19 at 14:28
  • I see, so I think I had things reversed. Doing more research that I should have done before, zfs on FreeBSD does support spacemap_v2. It seems you are created the pool on FreeBSD and are trying to use it on Linux, but it is Linux which doesn't support this feature. According to this page, currently only "master" branch of ZFS on Linux supports spacemap_v2: http://open-zfs.org/wiki/Feature_Flags So I think it's still correct that you need to move the data to a pool without that feature before it can be imported. – Steve Wills May 26 '19 at 13:18