It is possible that you may have to manage 2 pools that have the same name. For example, if you have a pool name “datapool” and you have another from some other storage array called “datapool”. You may wish to import this second pool (with the same name) to your system. ZFS will not allow the system to have 2 pools with the same name. Therefore we have to rename one of the pool to some other name. There are 2 scenarios when importing pools with same name.
1. One pool is already imported 2. Both pools are exported
Scenario 1 : One pool is already imported
In this case one pool is already imported with name datapool and other pool is yet to be imported.
# zpool list NAME SIZE ALLOC FREE CAP HEALTH ALTROOT datapool 1008M 154K 1008M 0% ONLINE -
In order to import the other datapool, we have to import it with some other name.
# zpool import datapool datapool_other
Verify that you have both the pools with different names.
# zpool list NAME SIZE ALLOC FREE CAP HEALTH ALTROOT datapool 1008M 97K 1008M 0% ONLINE - datapool_other 1008M 115K 1008M 0% ONLINE -
Scenario 2 : Both pools are exported
Consider a case where neither of the 2 pools have been imported. All the vdevs are visible to the operating system. If we try to import, zfs does not know which one to import therefore you would get an error as below :
# zpool import datapool cannot import 'datapool': more than one matching pool import by numeric ID instead
In this case we need to import the first pool by ID. This pool will be import with original name. To get Pool ID do:
# zpool import pool: datapool id: 4752417439350054830 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: datapool ONLINE c1t2d0 ONLINE pool: datapool id: 10561124909390930773 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: datapool ONLINE c1t3d0 ONLINE
Now import first pool with pool ID :
# zpool import -f 4752417439350054830
We will have to import the second datapool with a new name.
# zpool import datapool datapool_other
Verify the zpool list to see the 2 pools datapool and datapool_other imported at the same time.
# zpool list NAME SIZE ALLOC FREE CAP HEALTH ALTROOT datapool 1008M 95.5K 1008M 0% ONLINE - datapool_other 1008M 356K 1008M 0% ONLINE -