Sie sind auf Seite 1von 5

Subscribe to Solaris Guru

Subscribe In Your Reader


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 ...
2008 (23)
Solaris Guru ~ Helps you Get Quick Start on Solaris
Solaris related quick tips and tricks.
mo n d a y , a p r i l 6 , 2 0 0 9
Playing around with ZFS File system using Virtual
Disk created from Sun xVM VirtualBox - Creating a
zpool and adding storage to it
ZFS organizes physical devices into logical pools called storage pools. Both
individual disks and array logical unit numbers (LUNs) visible to the
operating system may be included in a ZFS pools. ZFS can be based on other
less traditional storage structures as well.

Ideal way to practice and play around with ZFS is to install OpenSolaris as a
Guest OS on VMware or using Sun xVM VirtualBox. My examples would be all
based on Sun xVM VirtualBox. Its pretty easy and straight forward to add as
many virtual disk as you like. I wont cover that stuff here. So this can be an
ideal practice ground. You don't really have to run down a hardware store
and get some inexpensive disks to play around with ZFS.

In my scenario, i have created in all 9 different virtual disks. Below are the
details:

root@opensolaris:~# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c3d0 DEFAULT cyl 3668 alt 2 hd 128 sec 32
/pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
1. c3d1 VBOX HAR-ca698f65-ae2b945-0001-5.82GB
/pci@0,0/pci-ide@1,1/ide@0/cmdk@1,0
2. c4d1 VBOX HAR-fdacd661-6e2e166-0001-2.00GB
/pci@0,0/pci-ide@1,1/ide@1/cmdk@1,0
Page 1 of 5 Solaris Guru ~ Helps you Get Quick Start on Solaris: Playing around with ZFS File system using Virtual Disk created from Su...
4/27/2012 http://solarisguru.getquickstart.com/2009/04/playing-around-with-zfs-file-system.html
Categories
Basics (11)
(SAN) Storage (2)
BLOG Maintained by - Vishal Sharma |
GetQuickStart
Refresh hardware
storage
Provide cutting edge
features to your
existing legacy
hardware.
starwindsoftware.com/refre
SAN Storage
Used to optimise
storage! infrastructure
& high efficiency
www.dell.com/EqualLogic
Digital Power
Management
Single-chip solution.
Easy software
interface.
www.Latticesemi.com/Platfo
16 GB Pen Drive @
499
Sandisk 16GB at 67%
Off. Pay Cash on
Delivery. Free
Shipping. Buy Now
tradus.in/16GB-Pen-Drive-4
regulated power
supply design
Power Manage for
Indian Engineers
News, technical
papers, tools, more
www.eetindia.co.in
3. c5t0d0 ATA-VBOX HARDDISK-1.0-2.00GB
/pci@0,0/pci8086,2829@d/disk@0,0
4. c5t1d0 ATA-VBOX HARDDISK-1.0-2.00GB
/pci@0,0/pci8086,2829@d/disk@1,0
5. c5t2d0 ATA-VBOX HARDDISK-1.0-2.00GB
/pci@0,0/pci8086,2829@d/disk@2,0
6. c5t3d0 ATA-VBOX HARDDISK-1.0-2.00GB
/pci@0,0/pci8086,2829@d/disk@3,0
7. c5t4d0 ATA-VBOX HARDDISK-1.0-4.00GB
/pci@0,0/pci8086,2829@d/disk@4,0
8. c5t5d0 ATA-VBOX HARDDISK-1.0-3.11GB
/pci@0,0/pci8086,2829@d/disk@5,0
Specify disk (enter its number): ^C
root@opensolaris:~#


Disk 0 - is my boot disk and i wont be touching this at all.
Disk 1 - 5.82 GB disk.
Disk 2 - 2.00 GB disk.
Disk 3 - 2.00 GB disk
Disk 4 - 2.00 GB disk
Disk 5 - 2.00 GB disk
Disk 6 - 2.00 GB disk
Disk 7 - 4.00 GB disk
Disk 8 - 3.11 GB disk

All the 2.00 GB one's i would be using extensively for creating MIRROR and
RAID-Z zfs volumes. Rest of them would be for other purposes.

1. ZFS Pool

Lets first begin by creating a ZFS pool named "zpooldata". We would be
using disk 2 and disk 7 for this, for now. So here's how we do it:

root@opensolaris:~# zpool create zpooldata c4d1 c5t4d0

the command executes successfully and i have a new zpool created
Page 2 of 5 Solaris Guru ~ Helps you Get Quick Start on Solaris: Playing around with ZFS File system using Virtual Disk created from Su...
4/27/2012 http://solarisguru.getquickstart.com/2009/04/playing-around-with-zfs-file-system.html
Volume Manager Veritas (2)
ZFS (8)
Zones (6)
zpooldata with 5.9 GB of available storage to use.

root@opensolaris:~# df -h
Filesystem Size Used Avail Use% Mounted on
rpool/ROOT/opensolaris
6.2G 2.3G 3.9G 37% /
swap 540M 324K 539M 1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap3.so.1
6.2G 2.3G 3.9G 37% /lib/libc.so.1
swap 539M 12K 539M 1% /tmp
swap 539M 44K 539M 1% /var/run
rpool/export 3.9G 19K 3.9G 1% /export
rpool/export/home 3.9G 19K 3.9G 1% /export/home
rpool/export/home/vishal
3.9G 22M 3.9G 1% /export/home/vishal
rpool 3.9G 72K 3.9G 1% /rpool
zpooldata 5.9G 18K 5.9G 1% /zpooldata
root@opensolaris:~#


plain and simple, just one command and its done.

Now lets just go ahead and add Disk 8 to our zpool to get some extra
storage. Here's how we do it.

root@opensolaris:~# zpool add zpooldata c5t5d0
root@opensolaris:~# df -h
Filesystem Size Used Avail Use% Mounted on
rpool/ROOT/opensolaris
6.1G 2.3G 3.9G 37% /
swap 540M 324K 540M 1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap3.so.1
6.1G 2.3G 3.9G 37% /lib/libc.so.1
swap 540M 12K 540M 1% /tmp
swap 540M 44K 540M 1% /var/run
rpool/export 3.9G 19K 3.9G 1% /export
rpool/export/home 3.9G 19K 3.9G 1% /export/home
Page 3 of 5 Solaris Guru ~ Helps you Get Quick Start on Solaris: Playing around with ZFS File system using Virtual Disk created from Su...
4/27/2012 http://solarisguru.getquickstart.com/2009/04/playing-around-with-zfs-file-system.html
rpool/export/home/vishal
3.9G 31M 3.9G 1% /export/home/vishal
rpool 3.9G 72K 3.9G 1% /rpool
zpooldata 9.0G 18K 9.0G 1% /zpooldata

root@opensolaris:~# zpool status

pool: zpooldata
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
zpooldata ONLINE 0 0 0
c4d1 ONLINE 0 0 0
c5t4d0 ONLINE 0 0 0
c5t5d0 ONLINE 0 0 0

errors: No known data errors
root@opensolaris:~#


As of this writing, there is no provision to remove a disk from an existing
zpool. I heard this feature is coming up in the future releases. However,
what you could do is, to create a zpool with hotspares and then those
hotspares could be removed as and when need arises. I will cover this in the
next post.
Posted by Vishal Sharma at 1:54 AM
Labels: ZFS
0 comments:
Post a Comment
Page 4 of 5 Solaris Guru ~ Helps you Get Quick Start on Solaris: Playing around with ZFS File system using Virtual Disk created from Su...
4/27/2012 http://solarisguru.getquickstart.com/2009/04/playing-around-with-zfs-file-system.html
Newer Post Older Post
Links to this post
Create a Link
Home
Subscribe to: Post Comments (Atom)
ISO Certification India
Get ISO 9001, 14001, 22000, 27001, HACCP, OHSAS 18001 and CE
Marking
www.ICRindia.in
Page 5 of 5 Solaris Guru ~ Helps you Get Quick Start on Solaris: Playing around with ZFS File system using Virtual Disk created from Su...
4/27/2012 http://solarisguru.getquickstart.com/2009/04/playing-around-with-zfs-file-system.html