- 1
Click the terminal icon to open a terminal. It looks like a computer monitor.
- 2
Type the following to find out the device name for your USB external drive:
rmformat
It will have a format similar to c9t0d0p0
- 3
Type the following to find out the device names of any other disks:
sudo format
You will need to enter a password.
- 4
Type the following to set up the two disks as mirror pools of each other:
zpool create -f usbpool mirror c9t0d0p0 c7t1d0p0
Naturally, you should replace the two devices names (c9t0d0p0 and c7t1d0p0) with the names you discovered in steps 2 and 3. The two devices will be mirrored and mounted at /usbpool.
- 5
Type the following to get a status list on the pool:
zpool status
You should be able to see that usbpool is a mirror of the two drives. So long as both drives are connected and they are mirrored, all data is written to both drives simultaneously. As a bonus, data will also be read from both drives simultaneously, essentially doubling hard disk bandwidth.
- 6
Type the following to fill the pool with a little data:
cat /dev/random > random.dat
Let it run a few minutes, then press "Ctrl" and "C" to stop it. You can type: "ll -h" to see the results.
- 7
Type the following to remove the USB drive:
zpool detatch usbpool c9t0d0p0
Replace the device name at the end with the one for your USB drive. Write a little more data to the remaining disk by typing:
echo "new file" > new.txt
- 8
Sync the mirrored drive back up with this command:
zpool attach usbpool c7t1d0p0 c9t0d0p0
5/5/11
How to Use ZFS & USB External Drives as a Backup Pool
The ZFS file system that comes with Solaris makes it relatively simple to keep a backup pool always running, even allowing you to attach and detach drives from the pool with simple console commands. You don't even need to reboot the computer as you do it.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment