• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Solaris ZFS : How to import 2 pools that have the same names

by admin

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  -

Filed Under: Solaris, ZFS

Some more articles you might also be interested in …

  1. How to set boot-device with luxadm command in Solaris
  2. The ultimate Solaris jumpstart troubleshooting guide
  3. How to Set the TimeZone in Solaris 10,11
  4. Resolving File System Full Situations in Solaris
  5. Solaris : How to validate that the crash dump was created properly
  6. SVM : How to Use Metadevadm to Maintain Device Relocation Information After Disk Replacement
  7. Solaris : Troubleshooting startup (rc init) scripts
  8. Solaris ZFS : How to Offline / Online / Detach / Replace device in a storage pool
  9. Solaris Interview Questions and Answers
  10. Solaris : How to start syslogd in debug mode

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright