5

I have a FreeBSD drive that I want to retrieve a file from with Ubuntu 14.04 desktop.

I installed ubuntu-zfs from this PPA and have been through several tutorials, all of which have covered installing Ubuntu to ZFS or establishing a ZFS RAID, but all I want to do is mount a drive and retrieve a file.

I seem to be stuck on step one, where I can't even get Ubuntu to see a zpool, much less mount the drive.

More info:

# dmesg | egrep "\<sd[a-g]|SPL|ZFS"
[    1.525674] sd 2:0:0:0: [sda] 15465744 512-byte logical blocks: (7.91 GB/7.37 GiB)
[    1.525747] sd 2:0:0:0: [sda] Write Protect is off
[    1.525751] sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    1.525782] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.526605] sd 2:0:1:0: [sdb] 293046768 512-byte logical blocks: (150 GB/139 GiB)
[    1.526885]  sda: sda1
[    1.526885]  sda1: <bsd:bad subpartition - ignored
[    1.526885]  sda5 >
[    1.526937] sd 2:0:1:0: [sdb] Write Protect is off
[    1.526942] sd 2:0:1:0: [sdb] Mode Sense: 00 3a 00 00
[    1.526968] sd 2:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.527275] sd 2:0:0:0: [sda] Attached SCSI disk
[    1.536835]  sdb: sdb1 sdb2 < sdb5 >
[    1.537272] sd 2:0:1:0: [sdb] Attached SCSI disk
[   29.183853] SPL: Loaded module v0.6.5.3-1~trusty
[   29.383056] ZFS: Loaded module v0.6.5.3-1~trusty, ZFS pool version 5000, ZFS filesystem version 5
[   37.384244] EXT4-fs (sdb1): mounting ext2 file system using the ext4 subsystem
[   37.414432] EXT4-fs (sdb1): mounted filesystem without journal. Opts: (null)
Paul
  • 4,511
  • The seems to be an issue here sda1: <bsd:bad subpartition - ignored. Anyway, what says zpool import /dev/sda1 and zpool import /dev/sda5? – jlliagre Nov 07 '15 at 03:08
  • @jlliagre For both of them it says cannot import '/dev/sda1' : no such pool available (sda5 for other partition). – Paul Nov 07 '15 at 03:11
  • If you are sure there is a zpool the sda disk, run od -c /dev/sda | grep "\a v e r s i o n" and post its output Note that there should be three spaces between each letter in the string: a...v...e...r...s...i...o...n. – jlliagre Nov 07 '15 at 04:40
  • @jlliagre I tracked down a hardware issue causing data corruption on the drive, but I appreciate your helping me. – Paul Nov 10 '15 at 03:30

1 Answers1

7

The first (and often only) step required is to import the pool associated with the disk.

sudo zpool import with no other arguments scans all the devices (whole disks and partitions) to identify ZFS pools.

FreeBSD is using its own kind of partitions inside the fdisk primary partitions (similar but different than logical partitions in an extended one). Your Linux kernel might not detect them for some reason, have a look to the system log messages:

dmesg | egrep "\<sd[a-g]|SPL|ZFS"

There might also be issues with missing feature flags support on the target machine. That would make the pool not importable.

Flimm
  • 41,766
jlliagre
  • 5,833
  • 1
    I really wish they had not used the verb "import" because this seems to imply to me at least that this is unsuitable if I want to mount the disk back in its original system (as a boot drive) at a later time as if nothing had every happened. – Michael May 06 '23 at 19:50