[SOLVED] PBS doesn't import one of my ZFS pool at start. Manualy import post boot works great

Fixit

Member
Nov 18, 2022
10
0
6
Hello everybody.

I have a (wonderfull) Proxmox Backup Server 3.2-7 with 7 zfs pool :


Code:
#zpool list

NAME            SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT

ATH            1.81T   936G   920G        -         -     7%    50%  1.00x    ONLINE  -

B-D            8.72T  5.79T  2.93T        -      368G     9%    66%  1.00x    ONLINE  -

BEL-OEIL       1.81T  1.50T   321G        -         -     8%    82%  1.00x    ONLINE  -

EMCC           1.81T   786G  1.04T        -         -     0%    42%  1.00x    ONLINE  -

ERADES-BOUZAT  7.27T  4.38T  2.89T        -         -    23%    60%  1.00x    ONLINE  -

FIXIT          7.27T  4.72T  2.55T        -         -     5%    64%  1.00x    ONLINE  -

rpool           111G  37.6G  73.4G        -         -    37%    33%  1.00x    ONLINE  -


But the 'B-D' one is never import at boot and i have to import it (zpool import B-D) manually each time we restart the server.


I have try a lot of things to fix the problem but without any result

I want to precise that this pool was created manually (in shell mode) because of different sized disks.


My last try was to create de cachefile as follow:

Code:
zpool set cachefile=/etc/systemd/system/zfs-import.target.wants/'zfs-import@B\x2dD.service' B-D

Is somebody have an idea?


PS: - First post to me : hope i did it well

- I'm french so my english is like that :) :) :)
 
Last edited:
zpool set cachefile=/etc/systemd/system/zfs-import.target.wants/'zfs-import@B\x2dD.service' B-D
That will not work

Please post the output of zpool get cachefile and systemctl status zfs-import.target zfs-import.service zfs-import-cache.service zfs-import-scan.service
 
Hi Chris !!
Thanks a lot for your reply !!
Here are the results:
Code:
root@pbs1:/# zpool get cachefile
NAME           PROPERTY   VALUE                                                                  SOURCE
ATH            cachefile  none                                                                   local
B-D            cachefile  /etc/systemd/system/zfs-import.target.wants/zfs-import@B\x2dD.service  local
BEL-OEIL       cachefile  none                                                                   local
EMCC           cachefile  none                                                                   local
ERADES-BOUZAT  cachefile  none                                                                   local
FIXIT          cachefile  none                                                                   local
rpool          cachefile  -                                                                      default


Code:
root@pbs1:/# systemctl status zfs-import.target zfs-import.service zfs-import-cache.service zfs-import-scan.service
● zfs-import.target - ZFS pool import target
     Loaded: loaded (/lib/systemd/system/zfs-import.target; enabled; preset: enabled)
     Active: active since Tue 2024-10-08 19:24:15 CEST; 14h ago

oct. 08 19:24:15 pbs1 systemd[1]: Reached target zfs-import.target - ZFS pool import target.

○ zfs-import.service
     Loaded: masked (Reason: Unit zfs-import.service is masked.)
     Active: inactive (dead)

● zfs-import-cache.service - Import ZFS pools by cache file
     Loaded: loaded (/lib/systemd/system/zfs-import-cache.service; enabled; preset: enabled)
     Active: active (exited) since Tue 2024-10-08 19:24:15 CEST; 14h ago
       Docs: man:zpool(8)
    Process: 6038 ExecStart=/sbin/zpool import -c /etc/zfs/zpool.cache -aN $ZPOOL_IMPORT_OPTS (code=exited, status=0/SUCCESS)
   Main PID: 6038 (code=exited, status=0/SUCCESS)
        CPU: 15ms

oct. 08 19:24:15 pbs1 systemd[1]: Starting zfs-import-cache.service - Import ZFS pools by cache file...
oct. 08 19:24:15 pbs1 zpool[6038]: no pools available to import
oct. 08 19:24:15 pbs1 systemd[1]: Finished zfs-import-cache.service - Import ZFS pools by cache file.

○ zfs-import-scan.service - Import ZFS pools by device scanning
     Loaded: loaded (/lib/systemd/system/zfs-import-scan.service; enabled; preset: disabled)
     Active: inactive (dead)
  Condition: start condition failed at Tue 2024-10-08 19:24:15 CEST; 14h ago
             └─ ConditionFileNotEmpty=!/etc/zfs/zpool.cache was not met
       Docs: man:zpool(8)

oct. 08 19:24:15 pbs1 systemd[1]: zfs-import-scan.service - Import ZFS pools by device scanning was skipped because of an unmet condition check (ConditionFileNotEmpty=!/etc/zfs/zpool.cache).

Well done.

Thanks a lot for any help !!
Stef
 
Last edited:
So it seems you import the pools via the zfs-import.target. Try to unset the incorrect cache file by running zpool set cachefile=none B-D and enable the import service for it via systemctl enable zfs-import@B-D.service. On reboot, the pool should be imported, otherwise post the output of systemctl status zfs-import@B-D.service after the reboot.
 
Last edited:
Thanks Chris.

Same problem:
here is the result:
Code:
root@pbs1:~# systemctl status zfs-import@B-D.service
× zfs-import@B-D.service - Import ZFS pool B-D
     Loaded: loaded (/lib/systemd/system/zfs-import@.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Wed 2024-10-09 10:19:20 CEST; 2min 53s ago
       Docs: man:zpool(8)
    Process: 3496 ExecStart=/sbin/zpool import -N -d /dev/disk/by-id -o cachefile=none B/D (code=exited, status=1/FAILURE)
   Main PID: 3496 (code=exited, status=1/FAILURE)
        CPU: 269ms

oct. 09 10:19:19 pbs1 systemd[1]: Starting zfs-import@B-D.service - Import ZFS pool B-D...
oct. 09 10:19:20 pbs1 zpool[3496]: cannot import 'B/D': no such pool available
oct. 09 10:19:20 pbs1 systemd[1]: zfs-import@B-D.service: Main process exited, code=exited, status=1/FAILURE
oct. 09 10:19:20 pbs1 systemd[1]: zfs-import@B-D.service: Failed with result 'exit-code'.
oct. 09 10:19:20 pbs1 systemd[1]: Failed to start zfs-import@B-D.service - Import ZFS pool B-D.

:-( :-(
 
cannot import 'B/D': no such pool available
Ah well the hypen gets escaped, yes.

Please try to run systemctl enable zfs-import@B\\x2D.service and systemctl disable zfs-import@B-D.service. Like that the pool should be found by its correct name. Best is to not use pool names containing such characters to avoid these issues.
 
Hi Chris
I take note of your recommendation about the naming of datastore.
But the other one are imported perfectly well.
It's the same after systemctl enable zfs-import@B\\x2D.service and systemctl disable zfs-import@B-D.service
 
Last edited:
What is the output of the systemctl status for that service now? Also, you can compare the service file to the ones for the other pools, they are all a symlink located in the folder as shown when enabling the serivce via the template.
 
Chris, sorry for the time to answer:

Here is the output:
Code:
root@pbs1:~# systemctl status zfs-import.target zfs-import.service zfs-import-cache.service zfs-import-scan.service
 
● zfs-import.target - ZFS pool import target
     Loaded: loaded (/lib/systemd/system/zfs-import.target; enabled; preset: enabled)
     Active: active since Wed 2024-10-09 14:35:08 CEST; 10min ago

oct. 09 14:35:08 pbs1 systemd[1]: Reached target zfs-import.target - ZFS pool import target.

○ zfs-import.service
     Loaded: masked (Reason: Unit zfs-import.service is masked.)
     Active: inactive (dead)

● zfs-import-cache.service - Import ZFS pools by cache file
     Loaded: loaded (/lib/systemd/system/zfs-import-cache.service; enabled; preset: enabled)
     Active: active (exited) since Wed 2024-10-09 14:35:08 CEST; 10min ago
       Docs: man:zpool(8)
    Process: 6040 ExecStart=/sbin/zpool import -c /etc/zfs/zpool.cache -aN $ZPOOL_IMPORT_OPTS (code=exited, status=0/SUCCESS)
   Main PID: 6040 (code=exited, status=0/SUCCESS)
        CPU: 15ms

oct. 09 14:35:08 pbs1 systemd[1]: Starting zfs-import-cache.service - Import ZFS pools by cache file...
oct. 09 14:35:08 pbs1 zpool[6040]: no pools available to import
oct. 09 14:35:08 pbs1 systemd[1]: Finished zfs-import-cache.service - Import ZFS pools by cache file.

○ zfs-import-scan.service - Import ZFS pools by device scanning
     Loaded: loaded (/lib/systemd/system/zfs-import-scan.service; enabled; preset: disabled)
     Active: inactive (dead)
  Condition: start condition failed at Wed 2024-10-09 14:35:08 CEST; 10min ago
             └─ ConditionFileNotEmpty=!/etc/zfs/zpool.cache was not met
       Docs: man:zpool(8)

oct. 09 14:35:08 pbs1 systemd[1]: zfs-import-scan.service - Import ZFS pools by device scanning was skipped because of an unmet condition check (ConditionFileNotEmpty=!/etc/zfs/zpool.cache).
 
I was referring to the output of systemctl status zfs-import@B\\x2D.service. Sorry if that was not clear from the context.
 
No no, my fault. Sorry:
I think it's just a syntax problem?

Code:
root@pbs1:~# systemctl status zfs-import@B\\x2D.service
× zfs-import@B\x2D.service - Import ZFS pool B\x2D
     Loaded: loaded (/lib/systemd/system/zfs-import@.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Wed 2024-10-09 14:35:06 CEST; 52min ago
       Docs: man:zpool(8)
    Process: 3495 ExecStart=/sbin/zpool import -N -d /dev/disk/by-id -o cachefile=none B- (code=exited, status=1/FAILURE)
   Main PID: 3495 (code=exited, status=1/FAILURE)
        CPU: 303ms

oct. 09 14:35:06 pbs1 systemd[1]: Starting zfs-import@B\x2D.service - Import ZFS pool B\x2D...
oct. 09 14:35:06 pbs1 zpool[3495]: cannot import 'B-': no such pool available
oct. 09 14:35:06 pbs1 systemd[1]: zfs-import@B\x2D.service: Main process exited, code=exited, status=1/FAILURE
oct. 09 14:35:06 pbs1 systemd[1]: zfs-import@B\x2D.service: Failed with result 'exit-code'.
oct. 09 14:35:06 pbs1 systemd[1]: Failed to start zfs-import@B\x2D.service - Import ZFS pool B\x2D.
root@pbs1:~#
 
Ah yes, there still is a missing d in the escape sequence, this should be escaped correctly systemctl enable zfs-import@B\\x2dD.service. Disable the old one so it does not interfere
 
Yesssssss !!!
It works like a charm !!!
Thank U so much Chris !!!
Have a good day !!
 
Yesssssss !!!
It works like a charm !!!
Thank U so much Chris !!!
Have a good day !!
Glad it worked in the end, please mark the thread as solved for others to find a solution more easily, thanks.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!