Thursday Feb 28, 2008

 

Update 2/28: Made some minor corrections.  Provided an English and high quality version of the German video.  Added a ZFS GUI screenshot and instructions.  Added a link to Constantin's ZFS and Virtual Box blog entry.


This week I am at "Immersion Week" in suburban Chicago.  Immersion Week is an annual training event for Sun Technical staff in the field sales and professional services organizations.  Included in our "goodie bags" was a USB hub and three USB memory sticks along with the suggestion that we use them to demonstrate the open source ZFS file system included with Solaris 10.

Being a Solaris (and Mac) propeller head and fueled by a few Coronas, I found it hard to refuse this challenge. For an advanced version of this, check out this YouTube video (high quality MP4 version) from my colleagues across the pond.  Here are the steps that I followed.

System under test:  MacBook Pro running MacOS 10.5.2, VMware Fusion 1.1.1 and Solaris 10 08/07.

 1. Enable USB device access per the VMware Fusion instructions: 

2
Choose Virtual Machine > Settings or click the Settings button in the toolbar to open the virtual machine Settings sheet.
3
Select + and Add USB controller.
5
Click Apply.

2. Boot the Solaris VM. Login. Open a Solaris terminal window.  Assume root privileges.  Disable the Volume Management service volfs.  This prevents Solaris from automounting the removable disks. This stays in effect across reboots until you "enable" it.

    svcadm disable volfs 

3. Insert the USB hub with 3 sticks into the Mac's USB port

4. Fusion menus: Virtual Machine > USB > Connect ....  for each of the 3 USB devices.  This "grabs" them away from MacOS into Solaris control.

5. Find out the device names for the three USB disks:

# rmformat
Looking for devices...
     1. Logical Node: /dev/rdsk/c0t0d0p0
        Physical Node: /pci@0,0/pci-ide@7,1/ide@1/sd@0,0
        Connected Device: NECVMWar VMware IDE CDR10 1.00
        Device Type: DVD Reader/Writer
     2. Logical Node: /dev/rdsk/c2t0d0p0
        Physical Node: /pci@0,0/pci15ad,790@11/pci15ad,770@2/storage@1/disk@0,0
        Connected Device: CBM      Flash Disk       5.00
        Device Type: Removable
     3. Logical Node: /dev/rdsk/c3t0d0p0
        Physical Node: /pci@0,0/pci15ad,790@11/pci15ad,770@2/storage@2/disk@0,0
        Connected Device: USB      Flash Disk       1100
        Device Type: Removable
     4. Logical Node: /dev/rdsk/c4t0d0p0
        Physical Node: /pci@0,0/pci15ad,790@11/pci15ad,770@2/storage@3/disk@0,0
        Connected Device: CBM      Flash Disk       5.00
        Device Type: Removable

6.  Create a zpool using RAID Z on the three devices.

# zpool create usbdisk raidz c2t0d0p0 c3t0d0p0 c4t0d0p0
invalid vdev specification
use '-f' to override the following errors:
raidz contains devices of different sizes

Wasn't that nice of ZFS to warn us!
# zpool create -f usbdisk raidz c2t0d0p0 c3t0d0p0 c4t0d0p0
# # zpool status

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

        NAME          STATE     READ WRITE CKSUM
        usbdisk       ONLINE       0     0     0
          raidz1      ONLINE       0     0     0
            c3t0d0p0  ONLINE       0     0     0
            c2t0d0p0  ONLINE       0     0     0
            c4t0d0p0  ONLINE       0     0     0

errors: No known data errors

# zpool list
NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
usbdisk                 360M     91K    360M     0%  ONLINE     -


7.  Now lets have some fun......

8. Create a 5 MB file

cd /usbdisk
mkfile 5m test
# ls -l
total 10245
-rw------T   1 root     root     5242880 Feb 27 23:43 test
# du -ak
5122    ./test
5124    .

Notice how du and ls agree on sizes.

9. Enable compresssion

zfs set compression=on usbdisk
# pwd
/usbdisk
# mkfile 5m testcompression
# ls -l
total 10246
-rw------T   1 root     root     5242880 Feb 27 23:43 test
-rw------T   1 root     root     5242880 Feb 27 23:48 testcompression
# du -ak
5122    ./test
0       ./testcompression
5124    .

 Notice that ls shows a 5 MB file but du -ak shows a zero size file because zero filled files compress so well.

10.  Now remove one of the USB memory sticks from the hub and attempt to create file.

# mkfile 5m test2
# zpool status

  pool: usbdisk
 state: ONLINE
status: One or more devices has experienced an unrecoverable error.  An
        attempt was made to correct the error.  Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or replace the device with 'zpool replace'.
   see: http://www.sun.com/msg/ZFS-8000-9P
 scrub: none requested
config:

        NAME          STATE     READ WRITE CKSUM
        usbdisk       ONLINE       0     0     0
          raidz1      ONLINE       0     0     0
            c2t0d0p0  ONLINE       0     0     0
            c3t0d0p0  ONLINE       0   156     0
            c4t0d0p0  ONLINE       0     0     0

errors: No known data errors

zpool status reports that although a device is missing, data is intact.

Re-insert the removed memory stick and...

# zpool scrub usbdisk
# zpool status

  pool: usbdisk
 state: ONLINE
status: One or more devices has experienced an unrecoverable error.  An
        attempt was made to correct the error.  Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or replace the device with 'zpool replace'.
   see: http://www.sun.com/msg/ZFS-8000-9P
 scrub: resilver completed with 0 errors on Thu Feb 28 00:37:03 2008
config:

        NAME          STATE     READ WRITE CKSUM
        usbdisk       ONLINE       0     0     0
          raidz1      ONLINE       0     0     0
            c2t0d0p0  ONLINE       0     0     0
            c3t0d0p0  ONLINE       0   254     0
            c4t0d0p0  ONLINE       0     0     0

errors: No known data errors
# zpool clear usbdisk
# zpool status

  pool: usbdisk
 state: ONLINE
 scrub: resilver completed with 0 errors on Thu Feb 28 00:37:03 2008
config:

        NAME          STATE     READ WRITE CKSUM
        usbdisk       ONLINE       0     0     0
          raidz1      ONLINE       0     0     0
            c2t0d0p0  ONLINE       0     0     0
            c3t0d0p0  ONLINE       0     0     0
            c4t0d0p0  ONLINE       0     0     0

errors: No known data errors

zpool scrub examines all data in the specified pools to verify that it checksums correctly. For  replicated  (mirror  or raidz)  devices,  ZFS  automatically  repairs any damage discovered during the scrub.

11.  Now for some real fun with export and import.

# cd /
# zpool export usbdisk
# zpool list

Note that the pool usbdisk is no longer listed.  Remove all three memory sticks.  Mix them up.  Re-insert them.

# zpool import
  pool: usbdisk
    id: 13155150575270542445
 state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

        usbdisk       ONLINE
          raidz1      ONLINE
            c2t0d0p0  ONLINE
            c4t0d0p0  ONLINE
            c3t0d0p0  ONLINE
# zpool import usbdisk
# zpool status
 
  pool: usbdisk
 state: ONLINE
 scrub: none requested
config:

        NAME          STATE     READ WRITE CKSUM
        usbdisk       ONLINE       0     0     0
          raidz1      ONLINE       0     0     0
            c2t0d0p0  ONLINE       0     0     0
            c4t0d0p0  ONLINE       0     0     0
            c3t0d0p0  ONLINE       0     0     0

errors: No known data errors

Notice how politely, ZFS tells you the name of the pool (even if you forgot it) and asks you to import it by name.  It doesn't matter that the actual "disks" have changed location.

12.  Transfer the disks to another systems (in this case a MacOS system). First note the files that exist and then export the file system. 

 On the Solaris system....

# ls -l
total 20473
-rw------T   1 root     root     5242880 Feb 28 00:32 test
-rw------T   1 root     root     5242880 Feb 28 00:49 testcompression
# du -a
10236   ./test
1       ./testcompression
20477   .
# cd /
# zpool export usbdisk

Shutdown the virtual machine and exit VMware to avoid confusion. Remove the USB hub from the Mac.

Now on Mac OS X 10.5 Re-insert the USB hub. MacOS X Finder produces an error: "Disk inserted was not readable by this computer."

Click "Ignore." Open the MacOS X terminal applications.

$ sudo -s
Password:
bash-3.2# zpool import
  pool: usbdisk
    id: 13155150575270542445
 state: ONLINE
status: The pool is formatted using an older on-disk version.
action: The pool can be imported using its name or numeric identifier, though
    some features will not be available without an explicit 'zpool upgrade'.
config:

    usbdisk     ONLINE
      raidz1    ONLINE
        disk4   ONLINE
        disk3   ONLINE
        disk5   ONLINE
bash-3.2# zpool import usbdisk
bash-3.2# cd /Volumes/usbdisk
bash-3.2# ls
test        testcompression
bash-3.2# du -a
10236    ./test
1    ./testcompression
10241    .

# zfs get all usbdisk
NAME     PROPERTY       VALUE                  SOURCE
usbdisk  type           filesystem             -
usbdisk  creation       Thu Feb 28  0:32 2008  -
usbdisk  used           5.14M                  -
usbdisk  available      200M                   -
usbdisk  referenced     5.03M                  -
usbdisk  compressratio  1.00x                  -
usbdisk  mounted        yes                    -
usbdisk  quota          none                   default
usbdisk  reservation    none                   default
usbdisk  recordsize     128K                   default
usbdisk  mountpoint     /Volumes/usbdisk       default
usbdisk  sharenfs       off                    default
usbdisk  checksum       on                     default
usbdisk  compression    on                     local
usbdisk  atime          on                     default
usbdisk  devices        on                     default
usbdisk  exec           on                     default
usbdisk  setuid         on                     default
usbdisk  readonly       off                    default
usbdisk  zoned          off                    default
usbdisk  snapdir        hidden                 default
usbdisk  aclmode        groupmask              default
usbdisk  aclinherit     secure                 default
usbdisk  canmount       on                     default
usbdisk  shareiscsi     off                    default
usbdisk  xattr          on                     default
usbdisk  copies         1                      default


Like magic, the USB-based ZFS array is now accessible (read-only) to MacOS X 10.5.  A future update is expected to support R/W access. The compression property is still turned on as it was in Solaris.

PS.  I tried mounting the devices in Solaris using Virtual Box by Innotek (recently acquired by Sun).  This software for MacOS X is currently in Beta test.  I received some rather nasty messages about: Failing to create proxy device for USB device.  Virtual Box also runs on Linux, Windows and OpenSolaris hosts.

 See here what Constantin has done with Virtual Box on Open Solaris with ZFS.

Using the ZFS GUI.

I used the command line but ZFS also has a fully capable browser interface.  To use it the webconsole service must be enabled:

 

# svcadm enable webconsole

Point your browser to:  https://localhost:6789.  Login with the root username and password.

ZFS BUI Screenshot








Comments:

Just a typo, I suppose the step 6 should be:

# zpool create -f usbdisk raidz c2t0d0p0 c3t0d0p0 c4t0d0p0

And the output of 'zpool status' should be the type of raidz1,
otherwise it may hard to survive from step 10 :)

It's cool to see the on-disk data keeps well cross differnt OS, nice experiment!

Posted by Robin Guo on February 28, 2008 at 10:26 AM EST #

[Trackback] OK, this post may not be for the faint of heart...put on your propeller beanies, because here we go.Jim Laurent over at Sun has a really cool post over on his blog about using a VMware Fusion hosted Solaris 10

Posted by Team Fusion on February 29, 2008 at 03:17 PM EST #

interesting. very very interesting. maybe you could put up the virtual machine up so that it would be easier for people to try this out ?? just an idea

Posted by vij on March 06, 2008 at 10:48 AM EST #

There are already pre-built VMs at the Sun Download Center

http://developers.sun.com/solaris/downloads/solaris_apps/index.jsp

You just need to enable the USB access.

Posted by Jim Laurent on March 06, 2008 at 01:42 PM EST #

Thanks for this Jim. Not being a Solaris guy myself I was struggling a bit to use my new USB hub/sticks in this exact manner. I did find though that volfs has been removed and replaced with rmvolmgr as of the 12/06 release of Solaris Express (which I am using).

Posted by Steve Lloyd on March 06, 2008 at 04:24 PM EST #

Thank you Solaris , I think that is evolving day after day
In theory it might be best ever!!
Congratulating you and all engaged in the project is more wonderful

Posted by دردشة on May 14, 2008 at 10:33 PM EDT #

I found your post really interesting and it has really improved my knowledge on the matter.

Posted by Mark23 on May 15, 2008 at 08:13 PM EDT #

thanks for that
but <p>&nbsp;</p><p><font color="#ff1d1d">Update 2/28: </font>Made some minor corrections.&nbsp; Provided an English and high quality version of the German video.&nbsp; Added a ZFS GUI screenshot and instructions.&nbsp; Added a link to Constantin's ZFS and Virtual Box blog entry.<br /></p><hr width="100%" size="2" />This week I am at &quot;Immersion Week&quot; in suburban Chicago.&nbsp; Immersion Week is an annual training event for <a title="Sun Microsystems" href="http://www.sun.com">Sun</a> Technical staff in the field sales and professional services organizations.&nbsp; Included in our &quot;goodie bags&quot; was a USB hub and three USB memory sticks along with the suggestion that we use them to demonstrate the open source <a title="? web site" href="http://www.rtl.com/">?</a> file system included with Solaris 10.<p>Being a <a title="Solaris web site" href="http://www.sun.com/solaris">Solaris</a> (and Mac) propeller head and fueled by a few Coronas, I found it hard !!how can that

Posted by suber on May 25, 2008 at 06:18 PM EDT #

I surfed all the web till found the best searcher. Films, picts, mp3’s, videos and lots more at http://newfileengine.com/

Posted by matasano blogpost on October 24, 2008 at 04:06 PM EDT #

Now I'm looking for a replacement, inexpensive NAS device that I can put in my closet to act as a backup server for my family of Macs in the house. If anyone has any favorites, post a comment.
http://www.watchrolexshop.com
http://www.gamegoldme.com
http://www.cheap-lotrogold.com
http://www.globalsale.me/Aion-gold-083.aspx
http://www.cheap-gamegold.org
http://www.gamegoldvip.org

Posted by lotro gold on June 24, 2009 at 11:12 PM EDT #

plastic card printer
plastic card printer is a leader and innovator in the plastic card printer industry catering for all your membership cards and any custom size plastic card printer required from small to big quantity. We are a one-stop center for your entire plastic card printer requirement. <a href="http://www.7days-printing.com ">plastic card printer</a>.Have your cards ready in less than 1 hour if necessary in high laminated plastic card printer quality without compromising on quality and durability! The plastic card printer will be highly glossy laminated, very falt, non peeling and very sharp!
[URL=http://www.7days-printing.com]plastic card printer[/URL].We are also the authorized distributor for all range of plastic card printer as well as javelin plastic card printer in malaysia for personalizing the plastic card printer with thermal printing of text and barcode as well as encoding the magnetic stripe and plastic card printer.
Plastic business card
As a leading company in the plastic business card printing industry, our factory has paseed many certificate and produces over two million plastic business card per year. Our plastic business card is exactly like the credit cards.
<a href="http://www.7days-plasticcards.co.uk">Plastic business card</a> We produce plastic business card. our plastic business card is four color litho printed with heidilberg machines. If you order our plastic business card, we will offer you the best value for your money without any waste. Prices available for both private and trade customers with a minimum order starting from only100.
[URL=http://www.7days-plasticcards.co.uk]Plastic business card[/URL]
Ordering plastic business card from us directly over the phone or internet, we can give you the best price which you can not find elsewhere!Today, plastic business card is various and the company supplies more than 5oo million plastic business cards annually to customers all over th world. But our plastic business card has many advantages.
plastic card manufacturer
As a corporate has plastic card manufacturer facility manager or security professinal, you meet hundreds of plastic card manufacturer every day. It’s your job to identify plastic card manufacturer, but can you be expected to recognize every plastic card manufacturer in your facility? You’re going to need a little help from identification plastic card manufacturer, so take your pick: use standard size plastic card manufacturer like you’ll find at [URL=http://www.7daysprinting.com]plastic card manufacturer[/URL] or oversized photo ID badges like you’ll find at <a href="http://www.7daysprinting.com"> plastic card manufacturer </a >to verify identities. Use proximity or plastic card manufacturer to grant access to unattended building entries and bar codes or magnetic stripe plastic card manufacturer for accurate time and attendance tracking and more. Fargo systems integrators like us offer complete plastic card manufacturer personalization systems to help solve these challenges.
sticker printing
sticker printing is the most fundamental marketing tool that you always have with you. sticker printing contains business information about you and your company. sticker printing communicate the primary information of your company to your prospective customers- in a compact and simple way. sticker printing is a proven method which effectively advertises your business. Whether you are launching a new product or marketing an existing one, a sticker printing will always help you do it right.
[URL=http://www.hologram-sticker.co.uk]sticker printing[/URL]
sticker printing is used for presentation of your marketing materials in a superior way. sticker printing contains multiple pockets inside to hold your marketing materials. By utilizing folders, you can enhance the presentation of your sticker printing.
<a href="http://www.hologram-sticker.co.uk">sticker printing</a> sticker printing is a significant part of any company’s distinctiveness to others.
plastic card design
We can supply from stock a complete range of plastic card design for use with card printers. <a href="http://www.dynamicworldwide.co.uk"> plastic card design </a>.The recently updated plastic card design fooers all the features required to create and design card layouts with ease of set up and simplified operation. Four editons of plastic card design are available from the entry level plastic card design which allows for connection to external databases and the encoding of contactless plastic card design.
[URL=http://www.dynamicworldwide.co.uk]plastic card design[/URL]Whatever your requirement, plastic card design has the solution. A plastic card design personalisation bureau service is offered, where pre-printed or plastic card design can be thermally printed, embossed and encoded to your specific requirements. plastic card design can also be produced by digital or litho print methods. Other brands of plastic card design can also be supplied and supported.
metal business card
Businesses of all sizes rely on a powerful but tiy tool to communicate their business information: the metal business card. <a href="http://www.metal-card.co.uk"> metal business card </a>Whether you’re a business behemoth or one-man-brand consultant, the appropriate metal business card is a must. metal business card printing can be a daunting task because metal business card come in all shapes and sizes. There are your standard dorizontal facing metal business card, and even metal business card with the rounded deges. That depends on what exactly you are trying to communicate with your metal business card.The appropriate content is very important for your metal business card selection. [URL=http://www.metal-card.co.uk]metal business card[/URL]Your customers should be able to easily remember what it is you offer and also be able to contact you from the information on your metal business card. The last thing you want to do is hand a potential customer a brilliantly designed metal business card that does not help them find you when they need you. metal business card printing goes beyong metal business card design.
printing gift
printing gift is the key to promoting your business. printing gift also increase the number of new customers coming in to redeem their gifts. printing gift offers bring in customers seeking discounts on new purchases. As one of the leading manufacturers of printing gift. <a href="http://www.printing-gift.co.uk">printing gift</a>Our company has supplied printing gift for top retall companies. Generating new printing gift is a big benefit to a successful printing gift. Not only will your existing customers find printing gift appealing, they will in turn tell other new potential customers about printing gift. Branding on your new printing gift raise awareness.
[URL=http://www.printing-gift.co.uk]printing gift[/URL] There are many advertising and branding opportunities with printing gift. This is because of the many diverse things printing gift can be used for today. printing gift for business has been increasing in popularity for several years. We offer affordable custom printing gift at the lowest prices around.
smart card supplier
Since our smart card supplier is produced with unique equipment, you can be sure that your smart card supplier will be of high quality. In addition, our smart card supplier options are fully customizable to meet any specific needs. Your smart card supplier can also be ordered in combination with the convenient key smart card supplier, which is a smaller version of your smart card supplier that can be easily attached to a key chain. [URL=http://www.smartcard-supplier.co.uk]smart card supplier[/URL]Our smart card supplier helps companies that need a new design creat smart card supplier. For companies that already have a smart card supplier ,we can print directly from your own supplied smart card supplier artwork.
<a href="http://www.smartcard-supplier.co.uk"> smart card supplier</a>All of our custom printed smart card supplier offer high resolution graphics. We offer options for smart card supplier production such as unique smart card supplier textures or transparent smart card supplier for or a highly appealing visual appearance. Your customers will truly see your new smart card supplier as an outstanding them or high value.

Posted by molly on July 26, 2009 at 11:53 PM EDT #

Dear Sir or Ma’am,

This is Kathy Liu, Market sales from Shenzhen Feihe Electronics Co., Ltd., our factory locate in Shenzhen of China, professional produce USB HUB products including Sim card backup device, Multifunctional LED Flashlight, Multifunctional Pedometer, Stationery Gifts, and Home Decorations Gifts etc.

By Google research I got good luck to know your respect company deal with USB HUB products, today I contact you hope to get cooperation with good luck. Our product series are popular widely the world, if you're interested in our products kindly please don't hesitate to contact us, we’ll offer you highly quality, cheap price and best service.

More informations, kindly please visit our website http://www.szhanzhong.com to select your favorite products are appreciated.

If you have any requirement and query kindly please don’t hesitate to contact us.TKS!

B & rgds,

Kathy Liu
Shenzhen Feihe Electronics Co., Ltd.
Tel: 86-755-33653822
Fax: 86-755-33653833
Mob: +86-13537556176
Trade Manager: cn209674478
Email: sales02@szhanzhong.com
Skype: szhanzhong1
Website:http://www.szhanzhong.com
Add:3/F Bldg 3,Hongfa Innovation Park,Jiuwei Community,Xixiang Town,Bao'an District,Shenzhen,China

Posted by Kathy Liu on July 30, 2009 at 08:01 AM EDT #

Girls and women of Saudi Arabia
<p><a href="http://www.saudiagirls.org">
http://www.saudiagirls.org </a></p>
<p><a href="http://www.saudiagirls.org">بنات السعودية فتيات
بنات&nbsp;نساء حريم طالبات جامعيات سعوديات اكبر شبكة تضم بنات المملكة
العربية السعودية

Posted by بنات السعودية on September 25, 2009 at 11:37 PM EDT #

http://www.jsjyyb.cn

Posted by 电磁流量计 on September 27, 2009 at 04:24 AM EDT #

http://www.shanghaimassages.net

Posted by shanghai massage on September 27, 2009 at 04:28 AM EDT #

By the way, if you are interested in high qualities but low price replica watches, Please contact us via our website http://www.progiftstore.com/.

Posted by progiftstore on October 12, 2009 at 03:31 AM EDT #

Thank you

Great site

And very useful

Posted by بنات السعودية on October 14, 2009 at 06:22 AM EDT #

Ralph Lauren Windbreaker
Moncler Down Jacket
Moncler womens Filled Fashion Down Jackets/parka
Moncler Women’s Soft Fur down Jackets/parka in shiny black
moncler Womens Soft Fur Short Winter Parka Jackets
NFL Jerseys
football jerseys
<a href="http//www.mybrandclothing.com" rel="nofollow">http//www.mybrandclothing.com</a>

Posted by mybrandclothing on December 18, 2009 at 06:15 AM EST #

Ralph Lauren Windbreaker
Moncler Down Jacket
Moncler womens Filled Fashion Down Jackets/parka
Moncler Women’s Soft Fur down Jackets/parka in shiny black
moncler Womens Soft Fur Short Winter Parka Jackets
NFL Jerseys
football jerseys
http//www.mybrandclothing.com

Posted by jackwills on December 18, 2009 at 06:16 AM EST #

Post a Comment:
  • HTML Syntax: NOT allowed