Reattaching a ZFS Pool Drive Array: A Comprehensive Guide
In this article, we will discuss the process of reattaching a ZFS pool drive array on a system where the pool has not crashed, and the operating system is functioning properly. The system in question may have different pools, drives, or SATA buses. Our focus will be on copying key files required for the reattachment process.
What is ZFS and Why Reattach a Pool Drive Array?
ZFS is a combined file system and logical volume manager designed by Sun Microsystems. ZFS provides several features such as data integrity, pooling, snapshots, and copy-on-write. Over time, drive arrays in a ZFS pool might need reattachment due to various reasons, such as drive failure or maintenance.
Determining Key Files for Reattachment
To successfully reattach a ZFS pool drive array, you will need to copy key files from the original system or an existing healthy system. These files are crucial for maintaining the ZFS pool's configuration and metadata. The following files are essential:
rpool/ROOT/: This directory contains the root file system.rpool/data/: This directory contains user data.rpool/dump/: This directory holds the system dumps.rpool/swap/: This directory contains the swap space.rpool/meta/: This directory stores the metadata for the pool.
Steps to Reattach a ZFS Pool Drive Array
Now that we've identified the key files, let's outline the steps required for reattaching a ZFS pool drive array:
-
Connect the new drive array or replace the damaged drive.
# zpool replace <pool-name> old-device new-device
For example:
# zpool replace tank c1t0d0 c1t1d0 -
Ensure the new drive array's configuration matches the original.
Use a utility likeformat(on Solaris) orfdisk(on Linux) to examine the drive array. -
Copy the key files to the new system.
Use a secure copy protocol likescpor a shared storage device.
For example:
# scp user@source-system:/rpool/* /rpool/ -
Import the ZFS pool.
Once the drive array is connected, and the key files are copied, import the pool usingzpool importmore information onzpool importcan be found in the zfs(1M) man page.
Reattaching a ZFS pool drive array is a delicate process that requires attention to detail. When reattaching a pool, make sure to:
- Identify the key files from the original or healthy system.
- Replace or attach new drive arrays, and ensure their configuration matches the original.
- Copy the key files to the new system.
- Import/check the pool.
References
- ZFS Administration Guide Oracle
- FreeBSD Wiki: ZFS FreeBSD
- Illumos and ZFS Administration Guide Illumos Project