In our earlier scenario we created a zpool and added extra storage to it. Here we would detail how to create a zpool with a hotspare. But before we could do this, we need to delete / destroy our previous pool. (Note - doing this would erase all your data in your zpool). Here's how we do it:
root@opensolaris:~# zpool destroy zpooldata
So with this, zpooldata is gone.
Now lets go ahead and a create one with a hotspare.
In our case, we would be using Disk 1 as a hotspare and Disk 7 and Disk 8 would form part of zpooldata. Here's how we do this:
root@opensolaris:~# zpool create zpooldata c5t4d0 c5t5d0 spare c3d1
(Note: For all practical purposes, make sure that the the disk which you allocate as a hot spare is larger than any of the disk on your pool.)
root@opensolaris:~# zpool status
pool: zpooldata
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
zpooldata ONLINE 0 0 0
c5t4d0 ONLINE 0 0 0
c5t5d0 ONLINE 0 0 0
spares
c3d1 AVAIL
errors: No known data errors
root@opensolaris:~#
the above shows that Disk 2 is a spare.
Now lets go ahead and add another disk to the hotspare. Here's how we do it.
root@opensolaris:~# zpool add zpooldata spare c4d1
root@opensolaris:~# zpool status
pool: zpooldata
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
zpooldata ONLINE 0 0 0
c5t4d0 ONLINE 0 0 0
c5t5d0 ONLINE 0 0 0
spares
c4d1 AVAIL
c3d1 AVAIL
errors: No known data errors
root@opensolaris:~#
Now, lets remove both of the hotspare disks.
root@opensolaris:~# zpool remove zpooldata c3d1 c4d1
root@opensolaris:~# zpool status
pool: zpooldata
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
zpooldata ONLINE 0 0 0
c5t4d0 ONLINE 0 0 0
c5t5d0 ONLINE 0 0 0
errors: No known data errors
root@opensolaris:~#
Remember, adding or removing hotspares from your zpool wont really affect the total available storage in your pool. These are just hotspare disks and would be used in an event when a disk in the main pool fails.
Categories
- Basics (11)
- Storage (SAN) (2)
- Veritas Volume Manager (2)
- ZFS (8)
- Zones (6)
Monday, April 6, 2009
Playing around with ZFS File system using Virtual Disk created from Sun xVM VirtualBox - Working with ZFS hotspares
Subscribe to:
Post Comments (Atom)
Subscribe to Solaris Guru
Browse Articles
-
▼
2009
(6)
-
▼
April
(6)
- How to create a RAIDZ2 pool with a hot spare
- Monitoring performance of ZFS file system using zf...
- Best Practises: Migrate your non-system data from ...
- Step by Step: Migrate root UFS file system to ZFS
- Playing around with ZFS File system using Virtual ...
- Playing around with ZFS File system using Virtual ...
-
▼
April
(6)
0 comments:
Post a Comment