I have a installed Ubuntu 22.04.1 (from 22.04.1-desktop-amd64.iso
), running at VirtualBox 7, with installed zfs-tools
.
I have an image file from a zfs pool called zfsfile01
.
I can look in this file with:
fdisk -l zfsfile01
and I get the value with 2 datasets: dataset01
and dataset02
- the file seems to be ok.
Now I have to mount the file zfsfile01
itself or the second dataset02
as a loopback device.
After reading some useful texts, I recognized that I have to first import the poolfile with zpool
and then mount a filesystem (a dataset?) from the poolfile with zfs mount
. Importing the pool with
zpool import <pathto>/zfsfile01
failed with:
cannot import <pathto>/zfsfile01: no such pool available
I guess because of the file and no right zfs pool.
Basically, I can go on with the mount
command in Linux and can mount a dumped file with sudo mount -o loop,offset=xxx image.dd /tmp/destination
and such stuff. But I don't know which options I have to use to mount a zfs pool file with dataset as a loop back device.
Here is the output of sudo fdisk -l zfsfile01
: (response to comment)
Festplatte ewf1: 1,82 TiB, 2000398934016 Bytes, 3907029168 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes
Festplattenbezeichnungstyp: gpt
Festplattenbezeichner: 44E0E83D-A9CA-11EC-xxxx-xxxxx
Gerät Anfang Ende Sektoren Größe Typ
dataset1 128 4194431 4194304 2G FreeBSD Swap
dataset2 4194432 3907029127 3902834696 1,8T FreeBSD ZFS
Here is the output of losetup
: (response to Artur's answer)
$ losetup -f
/dev/loop8
$ sudo losetup /dev/loop8 /media/sf_E_DRIVE/zfsfile01
losetup: /media/sf_E_DRIVE/zfsfile01: Loop-Gerät konnte nicht eingerichtet werden: Vorgang nicht zulässig
I can loop a dd
image with:
sudo losetup /dev/loop8 /media/image.dd
and then I can un-loop the device with:
sudo losetup -d /dev/loop8
But I get an error with zfsfile01
:
Loop-Gerät konnte nicht eingerichtet werden: Vorgang nicht zulässig
which means:
cannot setup loop-device: progress is not valid