ZFS on the go

UPDATE 19-Jul-2006:

It looks like this blog entry is still getting hits from search engines and the USB FAQ, so here's an update. Since I wrote the entry, the project I said was under way has now been integrated in Nevada Build 36, Solaris Express 4/06 and Solaris 10 6/06 Release. It is mentioned in Dan's what's new blog as:

\* Hotpluggable drives are now better able to accomodate EFI-labels and device IDs, both of which are very important to supporting ZFS on USB and Firewire disk drives. [6348407]

If you use one of these releases or later, the hack described below is not necessary (and as Brian noted, may cause some error messages).

END UPDATE

ZFS is awesome. I'd bust some zeerleading moves for y'all, but I misplaced my pom poms and it wasn't going to be pretty anyway. Instead I will tell you how to try ZFS on your laptop (or any computer without a spare fixed disk). There is no supported way to create ZFS pools on USB disks yet, although a project is under way to rectify this (you can have limited ZFS functionality using lofi(7D)). What follows is a hack, use it at your own risk.

Before we proceed, you should get vold(1M) out of the way:

# svcadm disable volfs

An important thing to know in this context is that you can't create a pool on removable media devices, i.e. the ones whose storage media can be removed. DVD drives and flash readers are removable media, hard disks are not. So you'll need one or more USB hard disks. Most USB hard disks and IDE-to-USB enclosures should work. Thumb drives are not likely to work. In this experiment I'm using two USB 2.0 disks: a 20GB LaCie and a 40GB IOGEAR.

For the reasons that are beyond this blog entry, the Solaris USB driver presents any USB storage device as removable media. A simple command to list removable and non-removable disks is format(1M). Quoting the man page:

     Removable media devices are listed only when  users  execute
     format  in expert mode (option -e).

Run format with and without -e and notice the difference:

# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c1d0 
          /pci@0,0/pci-ide@8/ide@0/cmdk@0,0
Specify disk (enter its number): \^C
# format -e
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c1d0 
          /pci@0,0/pci-ide@8/ide@0/cmdk@0,0
       1. c4t0d0 
          /pci@0,0/pci1297,a550@2,2/storage@6/disk@0,0
       2. c5t0d0 
          /pci@0,0/pci1297,a550@2,2/storage@5/disk@0,0
Specify disk (enter its number): \^C

c4t0d0 and c5t0d0 are USB disks.

What we're going to do is tell the USB driver not to treat hard disks as removable media. This can be done by appending the following line to /kernel/drv/scsa2usb.conf file:

attribute-override-list =
 "vid=\* removable=false";

Reboot for these changes to take effect. Now all your USB hard disks are going to be treated as fixed (but you can still hotplug them). You can verify that by running format without -e option - if it still doesn't list your USB disk, most likely it's one of the rare samples that pretends to be removable media and that's a hack for another day.

Now you can use these disks just like any fixed disk:

# zpool create usbpool mirror c4t0d0 c5t0d0
# zpool list
NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
usbpool                27.8G   33.0K   27.7G     0%  ONLINE     -
# zpool status
  pool: usbpool
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        usbpool     ONLINE       0     0     0
          mirror    ONLINE       0     0     0
            c4t0d0  ONLINE       0     0     0
            c5t0d0  ONLINE       0     0     0
# zfs list
NAME                   USED  AVAIL  REFER  MOUNTPOINT
usbpool                 32K  27.5G     8K  /usbpool

Tags:

Comments:

i am havin a problem with my flash disk. i am unable to save or delete information and it write the disk is write pritected. please help me on this

Posted by vincent saka on July 14, 2006 at 03:02 AM PDT #

The modification of scsa2usb.conf is no longer necessary. See http://blogs.sun.com/roller/page/blu/20060719

Posted by Brian Utterback on July 19, 2006 at 03:30 AM PDT #

i am unable to save information on my flash disk. Whenever i try to save or delete data, it writes ┬┤he disk is write protected.

Posted by vincent saka on August 03, 2006 at 12:21 AM PDT #

You rock. This worked like a charm. Found it via google search to solve this exact problem. Results? 5 minutes later, problem solved.

Posted by mikeh on December 08, 2006 at 02:51 AM PST #

Artem, Thank you very much! I have been trying to do this with 4 firewire/ieee1394 drives with Solaris 10 on x86_64, with no success at all. I'm going to try this tomorrow. So is it vold.volfs that prevents format -e from "seeing" usb and firewire hdd's? Or is it the scsa2usb.conf file (or not, as Brian U. suggests)? rmformat and fdisk see them as rmdisk0, rmdisk1, etc., but zfs complains about inserting media. I agree with mikeh: you rock. Gordon

Posted by GordonB on April 05, 2007 at 01:54 PM PDT #

I use Solaris 10 for X86.
my flash disk can not be detected and sound system also have the same problem.

thanks.

Posted by Hiruy on October 10, 2007 at 10:59 PM PDT #

Very nice! Works great with a WD ELEMENTS 160GB/Go mobile harddisk. SPEEED!

Posted by Patrick Blaas on October 12, 2007 at 05:41 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

artem

Search

Top Tags
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today