This example begins with a mirror, d1, with a mounted file system, and ends up with the file system mounted on a trans device named d1.
# metastat d1 d1: Mirror Submirror 0: d20 State: Okay Submirror 1: d2 State: Okay ... # umount /fs2 # metainit d21 -t d1 d21: Trans is setup # metarename -f -x d21 d1 d21 and d1 have exchanged identities # metastat d1 d1: Trans State: Detached Size: 5600 blocks Master Device: d21 ... # metattach d1 d0 d1: logging device d0 is attached # mount /fs2 |
The metastat command confirms that the mirror d1 is in the "Okay" state. You must unmount the file system before using the metainit command to create the trans device d21, with d1 as the master. The metarename -f -x command forces the switch of d21 and d1; d1 is now the top-level trans metadevice, as confirmed by the metastat command. A logging device d0 is attached with the metattach command. You then remount /fs2. Note that because the mount device for /fs2 has not changed (it is still d1), you do not have to edit the /etc/vfstab file.