LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 11-26-2007, 08:20 AM   #1
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
How to share a ZFS file system between a global zone and a non global zone?


Hi.

I wanted to share a ZFS file system, managed in the global zone, in another zone. From what I've read, I understand that I could either loopback mount the ZFS file system in the non-global zone and in this case the mountpoint property must be "legacy", or mount via NFS the file system in the non-global zone.

Is there any difference between these two methods? It seems easier to me mounting the filesystem via NFS, because the other way I should mount the file system in the "legacy way" in the global zone.

What's your suggestion? Are there issues I'm not considering or I'm not aware of?

Thanks,
Enrico.

EDITED: I just found this
http://www.opensolaris.org/jive/thre...essageID=28645
which explains the problems I had yesterday when experimenting with the zone.
It seems I was lucky enough to hit the deadlock at first attempt.

Last edited by crisostomo_enrico; 11-26-2007 at 08:44 AM.
 
Old 11-26-2007, 12:07 PM   #2
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Original Poster
Rep: Reputation: 36
I've been googling around after reading the bug I've posted earlier and one thing isn't clear to me, yet: are ZFS mounts affected by this? Does nybody know?
 
Old 11-27-2007, 09:21 AM   #3
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Original Poster
Rep: Reputation: 36
There's another thing which is not clear to me. Here (http://www.opensolaris.org/os/community/zones/faq/) they state that:
Quote:
Q: How can I add a filesystem to an existing zone?
A: There are four methods. The following list uses UFS examples, but other types of file systems, such as HSFS and VxFS, can be used in the zonecfg "fs" resource type property or attached by mount(1M).

1. Create and mount the filesystem in the global zone and use LOFS to mount it into the non-global zone (very safe)
2. Create the filesystem in the global zone and use zonecfg to mount the filesystem into the zone as a UFS filesystem (very safe)
3. [...]
4. Mount a UFS filesystem directly into the non-global zone's directory structure (allows dynamic modifications to the mount without rebooting the non-global zone)
I'm digging the administration guide and it suggests to configure the zone with a lofs mount:
Quote:
zonecfg:my-zone> add fs
zonecfg:my-zone:fs> set dir=/path/to/mount/to
zonecfg:my-zone:fs> set special=/path/to/mount/from
zonecfg:my-zone:fs> set type=lofs
zonecfg:my-zone:fs> end
When I read point 1., even if zonecfg isn't explicitly named, I suppose they refer to the method suggested in the administration guide. There's no other way for a zone to mount a file system mounted in the global zone, is it?
Nevertheless, point 2. suggests to create the file system in the global zone and use zonecfg to mount a file system as UFS. What would be the advantage of this? And how would I do it? If the file system is not mounted in the global zone, and point 4. excludes that the file system it's into the non-global zone's directory structure, how can the non-global zone know about it (we're excluding access to the devices, which was point 3.)?

Thanks,
Enrico.

Last edited by crisostomo_enrico; 11-27-2007 at 09:23 AM.
 
Old 11-27-2007, 10:10 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by crisostomo_enrico View Post
When I read point 1., even if zonecfg isn't explicitly named, I suppose they refer to the method suggested in the administration guide. There's no other way for a zone to mount a file system mounted in the global zone, is it?
There is point 2 which is another way.
Quote:
Nevertheless, point 2. suggests to create the file system in the global zone and use zonecfg to mount a file system as UFS. What would be the advantage of this?
You are removing one layer of indirection, the zone deals with UFS instead of LOFS on top of UFS (or whatever). You can use tools like ufsdump/ufsrestore and ufs snapshots while you can't with lofs.
Quote:
And how would I do it?
set type=ufs
set special=/dev/dsk/c0t0d0s7
set raw=/dev/rdsk/c0t0d0s7
Quote:
If the file system is not mounted in the global zone, and point 4. excludes that the file system it's into the non-global zone's directory structure, how can the non-global zone know about it (we're excluding access to the devices, which was point 3.)?
The non-global zone doesn't knows about the mount but because it is done in the global zone. The non global zone accesses the files in the mount anyway.
 
Old 11-27-2007, 06:07 PM   #5
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Original Poster
Rep: Reputation: 36
Thanks jlliagre, things are clearer, just some doubts more.

About point 2: I didn't know about using the raw device, I excluded because I thought I had to propagate the device but it makes sense. This way, nonetheless, the zone configuration lets me mount a fs in the non-global zone but once mounted this way, it is not shared with global zone, right? Or better, it must not be mounted in global zone, right?

This approach is not possible with ZFS, I suppose. What I wanted to do was share some ZFS fs with a non-global zone and was looking for the best way to do this, that's why I first thought about NFS, before discovering that it's unsupported. With the options we discussed, it seems like the one option is lofs mounting the ZFS file systems into the zone. Can you confirm my suspicion?

Thanks,
Enrico.
 
Old 11-27-2007, 06:40 PM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by crisostomo_enrico View Post
About point 2: I didn't know about using the raw device, I excluded because I thought I had to propagate the device but it makes sense. This way, nonetheless, the zone configuration lets me mount a fs in the non-global zone but once mounted this way, it is not shared with global zone, right? Or better, it must not be mounted in global zone, right?
Yes, you can't mount it nor see its content from the global zone.
Quote:
This approach is not possible with ZFS, I suppose. What I wanted to do was share some ZFS fs with a non-global zone and was looking for the best way to do this, that's why I first thought about NFS, before discovering that it's unsupported. With the options we discussed, it seems like the one option is lofs mounting the ZFS file systems into the zone. Can you confirm my suspicion?
Yes, lofs allows sharing a directory between zones regardless of the underlying filesystems.
 
Old 11-28-2007, 03:30 AM   #7
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Original Poster
Rep: Reputation: 36
Thumbs up

Thanks again, jlliagre.

That's what I'll do.

Bye,
Enrico.
 
Old 11-28-2007, 08:20 AM   #8
pkochummen
LQ Newbie
 
Registered: Nov 2007
Distribution: SXCE
Posts: 3

Rep: Reputation: 0
You have the option of adding a dataset . Please check the link below

http://docs.sun.com/app/docs/doc/817...hahuooa?a=view

Check in "How to Configure a Zone" - Point 12

Rgds
PK
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS Zone x-fer - From one zone to another / Debian 3.1 + BIND9 kenwoodgt Linux - Software 0 11-01-2006 10:28 AM
Global File System Architecture... rajsun Programming 0 06-18-2006 10:17 PM
LXer: Munich Trade Fair Chooses Red Hat Global File System To Manage Web ... LXer Syndicated Linux News 0 12-26-2005 11:31 AM
Redhat Global File System -- What is it? w_thongchai Linux - General 1 10-09-2004 11:51 PM
linux firewall with internet zone, dmz and trusted zone ikhwan98 Linux - Security 1 11-27-2001 04:45 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 09:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration