# df -k /home
/dev/dsk/c0t2d1s3 50700783 39746386 10530839 80% /home
First, on top of this physical mount point of the /home file system, create a metadevice named d101. Remember, the /home file system is still mounted.
# metainit -f d101 1 1 c0t2d1s3
Next, you need to initialize a one-way mirror metadevice, d100, with the submirror d101 you have created.
# metainit d100 -m d101
# metastat d100
d100: Mirror
Submirror 0: d101
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 102961152 blocks
d101: Submirror of d100
State: Okay
Size: 102961152 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c0t2d1s3 0 No Okay
Now it's time to create a single-stripe metadevice (in this example, d102 on c0t2d1s7), where the target file system would be. The size of the new partition should be the same as d101.
# metainit d102 1 1 c0t2d1s7
d102: Concat/Stripe is setup
# metastat d102
d102: Concat/Stripe
Size: 102975488 blocks
Stripe 0:
Device Start Block Dbase
c0t2d1s7 0 No
After that, you add the metadevice d102 as the second submirror to d100. Here the resynchronization will automatically take place in the background.
# metattach d100 d102
After the resynchronization has been completed successfully, here's an example of the two-way mirrors you would get:
# metastat d100
d100: Mirror
Submirror 0: d101
State: Okay
Submirror 1: d102
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 102961152 blocks
d101: Submirror of d100
State: Okay
Size: 102961152 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c0t2d1s3 0 No Okay
d102: Submirror of d100
State: Okay
Size: 102961152 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c0t2d1s7 0 No Okay
Now, you have a new partition for the /home file system, ready to swap at any time while it's still online.
# df -k /home
/dev/dsk/c0t2d1s7 50700783 39746386 10530839 80% /home
Finally, you'll detach and clean up all metadevices from your system:
# metadetach d100 d101
d100: submirror d101 is detached
# metaclear d101
d101: Concat/Stripe is cleared
# metaclear d100
d100: Concat/Stripe is cleared
# metaclear d102
d102: Concat/Stripe is cleared
Now you have performed fewer than 10 steps, and the /home file system has been moved dynamically.
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)