Project

General

Profile

Bug #11247

Updated by Joshua M. Clulow about 1 year ago

Adding devices to a ZFS pool is in some instances a one-way trip, so using @zpool add -n@ (the dry-run mode) is advisable. In theory, at least, this prints a hypothetical summary of the vdev configuration after adding the requested devices. In practice, it seems the command is somewhat confused about how to render the addition of the first @log@ device to a pool that previously had no slog:

<pre>
# zpool status extra
pool: extra
state: ONLINE
scan: none requested
config:

NAME STATE READ WRITE CKSUM
extra ONLINE 0 0 0
c3t0d0 ONLINE 0 0 0

# zpool add -n extra log /tmp/log0
would update 'extra' to the following configuration:
extra
c3t0d0
/tmp/log0

# zpool add extra log /tmp/log0

# zpool status extra
pool: extra
state: ONLINE
scan: none requested
config:

NAME STATE READ WRITE CKSUM
extra ONLINE 0 0 0
c3t0d0 ONLINE 0 0 0
logs
/tmp/log0 ONLINE 0 0 0

errors: No known data errors

# zpool add -n extra log /tmp/log1
would update 'extra' to the following configuration:
extra
c3t0d0
logs
/tmp/log0
/tmp/log1

# zpool remove extra /tmp/log0

# zpool add -n extra log /tmp/log1
would update 'extra' to the following configuration:
extra
c3t0d0
/tmp/log1
</pre>

Note that prior to adding a log device, the command rendered @/tmp/log0@ as if it were a regular top-level vdev. After @/tmp/log0@ was added, @/tmp/log1@ _does_ appear correctly under the "logs" heading in the output! Removing @/tmp/log0@ again returns the display to being incorrect. Curiously, adding a mirrored device _does_ show a @mirror@ vdev mirrored @vdev@ -- but still not under the "logs" heading:

<pre>
# zpool add -n extra log mirror /tmp/log1 /tmp/log0
would update 'extra' to the following configuration:
extra
c3t0d0
mirror
/tmp/log1
/tmp/log0
</pre>

Back