Playing with ZFS filesystem

After coming back from Berlin, where I was on the OpenSolaris Developer Conference 2007, I have tried to use my set of USB flash drives to set up different configurations.

Here are some notes with modifications after Tim Foster and nacho comments:

#To create a pool for usb device without mirroring
zpool create nameofthepool device
#where device is taken for example from command `format -e` (like: c2t0d0p0)

#To add another storage to the pool, like another usb stick
zpool add nameofthepool device

#To create some pool "somename" under the nameofthepool
zfs create nameofthepool/somename

#To set the mountpoint for the "somename"
zfs set mountpoint=/test/mountpoint nameofthepool/somename

#Now time to get USB sticks out from your computer:
#Before removing the usb stick (sticks) from the computer
zpool export nameofthepool

#To get the list of pools to import
zpool import

#After pluggin the usb stick
zpool import nameofthepool

#To create snapshot of the filesystem
zfs snapshot nameofthepool/somename@SOMENAMELIKEDATE

#To create clone of the filesystem
#first make a snapshot of the filesystem and than
zfs clone nameofthesnapshotfromZFSlist nameofthepool/something

#To set/unset quota
zfs set quota=20M testpool/home/something
zfs set quota=none testpool/home/something

#To get list of the proporties that can be set
zfs get

#NFS
#To share the pool to the nfs
zfs set sharenfs=rw nameofthepool/somename
share /test/mountpoint rw ""

#ZFS on the file, changed from ZFS on the lofi, thanks to Tim Foster and nacho comments
#If you don't have USB stick, and just want to try out ZFS system, you can use
mkfile 1G /some_path/zfs.file
zpool create nameofthepool /some_path/zfs.file

#To export/import the nameofthepool created on the file
zpool export nameofthepool
zpool import nameofthepool -d /some_path/

Here are few pictures, how my lab computer looked, while I was playing with ZFS

Comments:

you dont actually need lofi to use zfs in a file, you can just mkfile 1G /some_path/zfs.file zpool create pool /some_path/zfs.file

Posted by nacho on March 02, 2007 at 09:06 AM UTC #

You don't need the lofiadm step - ZFS can use files as vdevs too, so having made a 1gb datafile using mkfile, you can do "zpool create pool /some_path/zfs.file". Having played with ZFS on USB sticks, you might be interested in Constantine's video here: http://blogs.sun.com/solarium/entry/solaris_zfs_auf_12_usb

Posted by Tim Foster on March 02, 2007 at 09:09 AM UTC #

woah nacho, great minds think alike :-)

Posted by Tim Foster on March 02, 2007 at 09:10 AM UTC #

>#To get the list of pools to import >zpool import haven't you to put sticks in, to see pools on it? >#ZFS on the lofi device which is the advance of lofi insted of use files directly Cheers Marco

Posted by Marco on March 02, 2007 at 01:23 PM UTC #

iurgisglskjg

Posted by guest on November 12, 2007 at 02:29 AM UTC #

good simple

Posted by Firoj on November 12, 2007 at 02:31 AM UTC #

Hi,
I have a question regarding to zpool import/export.
Is it possible to export a zpool in one system and than import it in another system? I have seen the zfs admin guide for this but there was not any example of actually doing it.Is it done by zfs set sharenfs=rw nameofthepool/somename first and then mount it on the second system? Do you have any guidance or examples of this?
Thanks

Posted by Dnzusb on March 21, 2008 at 08:39 AM UTC #

Yes it is possible.
You can do:
$ zpool export my_pool
On the other system
$ zpool import
This will list all available pools to import in this example my_pool
$ zpool import my_pool
This will import my_pool

The other option is to send/receive zfs filesystems between computers using for example ssh.

Posted by Michal_Pryc on March 22, 2008 at 05:11 AM UTC #

Hi Michal:
Good article, i have a question for you. I create a pool using file, i don't have a USB stick. The question is i created the pool, iscsi target without problem, but after reboot the iscsitarget show status "No Such file or directory".

Before reboot:
root#poseidon:/> iscsitadm list target -v
Target: volocr
iSCSI Name: iqn.1986-03.com.sun:02:825298bb-a3c0-6829-b311-e082c74ac791.volocr
Connections: 0
ACL list:
TPGT list:
LUN information:
LUN: 0
GUID: 0
VID: SUN
PID: SOLARIS
Type: disk
Size: 512M
Backing store: /dev/zvol/rdsk/pool_oracle/iscsi_luns/volocr
Status: online

After reboot:
root#poseidon:/> iscsitadm list target -v
Target: volocr
iSCSI Name: iqn.1986-03.com.sun:02:825298bb-a3c0-6829-b311-e082c74ac791.volocr
Connections: 0
ACL list:
TPGT list:
LUN information:
LUN: 0
GUID: 0
VID: SUN
PID: SOLARIS
Type: disk
Size: 512M
Backing store: /dev/zvol/rdsk/pool_oracle/iscsi_luns/volocr
Status: No such file or directory

You have a solution for this problem??

Posted by Angel Barra on July 24, 2009 at 11:07 AM UTC #

I also have this problem Angel. did you resolve it?

Posted by Justin on February 04, 2010 at 04:01 AM UTC #

Hi,
I would ask this question on the storage-discuss:
http://mail.opensolaris.org/mailman/listinfo/storage-discuss

OR zfs-discuss:
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Posted by Michal Pryc on February 04, 2010 at 04:08 AM UTC #

Post a Comment:
Comments are closed for this entry.
About

migi

Search

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