pool import CLI vs GUI

asokolsky

Cadet
Joined
Mar 11, 2012
Messages
5
Problem statement: I created pool `tank` using `/dev/sdX`. I want to change it so that `dev/disk/by-id/` is used.

My solution: export pool using GUI, import using custom command line.

My problem: the newly imported pool is not detected by GUI

0. Before I begin:
Code:
root@nass[~]# zpool status tank
  pool: tank
 state: ONLINE
  scan: scrub repaired 0B in 07:12:57 with 0 errors on Tue Jan 17 18:12:00 2023
config:

    NAME        STATE     READ WRITE CKSUM
    tank        ONLINE       0     0     0
      raidz2-0  ONLINE       0     0     0
        sde     ONLINE       0     0     0
        sdd     ONLINE       0     0     0
        sdc     ONLINE       0     0     0
        sdb     ONLINE       0     0     0
        sda     ONLINE       0     0     0

errors: No known data errors
root@nass[~]# lsblk -o NAME,SIZE,SERIAL,WWN,LABEL,FSTYPE
NAME    SIZE SERIAL               WWN                LABEL     FSTYPE
sda     5.5T WD-WX31DB48X2ZY      0x50014ee260e0f1d2 tank      zfs_member
sdb     7.3T VR368JHK             0x5000cca0c3ed20c4 tank      zfs_member
sdc     5.5T WD-C81EX39K          0x50014ee2beea769c tank      zfs_member
sdd     5.5T WD-C81G6HGK          0x50014ee2143f42b0 tank      zfs_member
sde     5.5T ZCT2WLTH             0x5000c500c6881e0b tank      zfs_member
sdf    29.5G SMC0515D91120B964037 0x515d91120b000037
├─sdf1  260M                      0x515d91120b000037           vfat
└─sdf2 29.2G                      0x515d91120b000037 boot-pool zfs_member
root@nass[~]# ll /dev/disk/by-id
total 0
drwxr-xr-x 2 root 360 Jan 18 11:31 ./
drwxr-xr-x 7 root 140 Jan 18 11:31 ../
lrwxrwxrwx 1 root   9 Jan 18 19:23 ata-ST6000VN001-2BB186_ZCT2WLTH -> ../../sde
lrwxrwxrwx 1 root   9 Jan 18 11:31 ata-SuperMicro_SSD_SMC0515D91120B964037 -> ../../sdf
lrwxrwxrwx 1 root  10 Jan 18 11:31 ata-SuperMicro_SSD_SMC0515D91120B964037-part1 -> ../../sdf1
lrwxrwxrwx 1 root  10 Jan 18 11:31 ata-SuperMicro_SSD_SMC0515D91120B964037-part2 -> ../../sdf2
lrwxrwxrwx 1 root   9 Jan 18 19:23 ata-WDC_WD60EFRX-68MYMN1_WD-WX31DB48X2ZY -> ../../sda
lrwxrwxrwx 1 root   9 Jan 18 19:23 ata-WDC_WD60EFZX-68B3FN0_WD-C81EX39K -> ../../sdc
lrwxrwxrwx 1 root   9 Jan 18 19:23 ata-WDC_WD60EFZX-68B3FN0_WD-C81G6HGK -> ../../sdd
lrwxrwxrwx 1 root   9 Jan 18 19:23 ata-WDC_WD8003FFBX-68B9AN0_VR368JHK -> ../../sdb


1. Export pool tank using GUI.

2 Import pool using `dev/disk/by-id/`

Code:
root@nass[~]# zpool import \
  -d /dev/disk/by-id/ata-WDC_WD60EFRX-68MYMN1_WD-WX31DB48X2ZY \
  -d /dev/disk/by-id/ata-WDC_WD8003FFBX-68B9AN0_VR368JHK \
  -d /dev/disk/by-id/ata-WDC_WD60EFZX-68B3FN0_WD-C81EX39K \
  -d /dev/disk/by-id/ata-WDC_WD60EFZX-68B3FN0_WD-C81G6HGK \
  -d /dev/disk/by-id/ata-ST6000VN001-2BB186_ZCT2WLTH \
  tank


3. GUI does not detect the pool `tank` being available.

Is there any way I can tell GUI to reread pool data from disks?

When I do step 2 (pool import) in GUI there is no way to specify CLI. Any workaround?

Similar: https://www.reddit.com/r/truenas/comments/rvnif8/truenas_scale_import_zpool_by_devdiskbyid/
 
Last edited:

Arwen

MVP
Joined
May 17, 2014
Messages
3,600
From the command line, simply export the pool. Then use the GUI to import it.
 

asokolsky

Cadet
Joined
Mar 11, 2012
Messages
5
> From the command line, simply export the pool. Then use the GUI to import it.

Pool import via GUI results in the pool using `/dev/sdX` not `dev/disk/by-id/`
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,600
Actually I think you are suppose to use /dev/disk/by-partuuid/ not /dev/disk/by-id/.

However, the pool cache file might be messing you up, /etc/zfs/zpool.cache. I don't know the fix. Perhaps someone else can suggest a fix.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,462
Problem statement: I created pool `tank` using `/dev/sdX`. I want to change it so that `dev/disk/by-id/` is used.
So you created the pool incorrectly, and you want to change it to something else that's also incorrect?
When I do step 2 (pool import) in GUI there is no way to specify CLI.
No, of course there isn't.

The only solution I know of (and note that I don't say it's the only solution that exists) is to, one at a time, take a disk offline, wipe its partition table, and then replace the disk using the GUI--which is how you should have been managing your pool all along.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,600
So you created the pool incorrectly, and you want to change it to something else that's also incorrect?

No, of course there isn't.

The only solution I know of (and note that I don't say it's the only solution that exists) is to, one at a time, take a disk offline, wipe its partition table, and then replace the disk using the GUI--which is how you should have been managing your pool all along.
Hmm, I missed that he was using the whole disk. That likely means he can't use the GUI for replacement, which will want to partition the disks, thus the "replacement disk" will be too small. And can't use the import using /dev/disk/by-partuuid/ because their is NO partition.

Oh well, create by CLI, live by the CLI... If @danb35 solution does not work, then it is likely that the pool will have to be destroyed and re-created correctly with the GUI.
 
Top