[SOLVED] ZFS: Importing and Mounting Failed Mirror from another PVE

eduncan911

Member
Mar 12, 2021
22
11
23
70
I need to obtain a single file from a drive that was previously in an PVE (Proxmox 6.2). It was an ZFS Mirror of the OS drive (partitioned per Proxmox installer).

Since both the existing ZFS-backed PVE I am on, and the old mirror'd drive, use the same rpool name, I had to use the ID of the pool, which seemed to work.

Code:
root@pve01:~# zfs list
NAME                               USED  AVAIL     REFER  MOUNTPOINT
rpool                             1.32G   214G      104K  /rpool
rpool/ROOT                        1.32G   214G       96K  /rpool/ROOT
rpool/ROOT/pve-1                  1.32G   214G     1.32G  /
rpool/data                          96K   214G       96K  /rpool/data
zpool_rschool                     3.17G  86.4G      104K  /zpool_rschool
zpool_rschool/ROOT                1.80G  86.4G       96K  /zpool_rschool/ROOT
zpool_rschool/ROOT/pve-1          1.80G  86.4G     1.80G  /
zpool_rschool/data                1.36G  86.4G       96K  /zpool_rschool/data
zpool_rschool/data/vm-100-disk-0  1.36G  86.4G     1.36G  -
zpool_rschool/data/vm-100-disk-1    88K  86.4G       88K  -

NOTE: I'm confused how zpool_rschool/ROOT/pve-1 can be mounted on /, when rpool/ROOT/pve-1 already is?

When trying to transverse the that mountmount, I get pretty much nothing:

Code:
# tree /zpool_rschool/
/zpool_rschool/
├── ROOT
│   └── pve-1
└── data

I'm new to ZFS so I am unsure how to mount and reach the data. Maybe I'm missing a step?
 
Yeah, when I rebooted I got the common issue of "Network Time Synchronization" of systemd that endlessly stops and starts. This reddit post help point me into the direction that basically, well, root / got hosed and is not mounting properly (as per the dual zfs pools above mounted at root /).

Removing the temp drive allows the system to boot again.

Any attempt to import continues to mount at /, which often freezes the system.

Take a look at the zfs values "canmount" and "mountpoint". With that you can disable automounting of a dataset or change the mountpoint so you dont mount 2 datasets to same same mountpoint.

https://docs.oracle.com/cd/E19253-01/819-5461/gaztn/index.html
https://docs.oracle.com/cd/E19253-01/819-5461/gamns/index.html
https://docs.oracle.com/cd/E19253-01/819-5461/gamnt/index.html

Thanks! Yes, I had already found canmount/mountpoint, but once it was -f forced import, it was on / - and often times froze the system. It seemed to be a chicken or egg thing: I had to import, in order to change the mount. But importing automounted at /, before I could change it and froze the system. Argh.

So more duckduckgo searching, and finally found the -R parameter on this page:

https://docs.oracle.com/cd/E53394_01/html/E54801/gbcgl.html

The solution is to import under an Alternate Root:

Code:
# this will not import, cause of the conflict (normally requires -f)
# however, you need the pool's ID
root@pve01:~# zpool import
# then grab the id with
root@pve01:~# zpool status

# now, you can import the pool under an "Alternate Root"
# which does not persist on reboot (so stick it in /tmp)
root@pve01:~# mkdir /tmp/zfs
root@pve01:~# zpool import -R /tmp/zfs 16035589164778545527 <alternate-pool-name>

Along the way, I somehow renamed my pool so it worked without that <alternate-pool-name> option. But, I think you still need to supply it for those of you that find this post down the road.
 
Last edited: