Creation of zone based on zfs root file system


 
Thread Tools Search this Thread
Operating Systems Solaris Creation of zone based on zfs root file system
# 1  
Old 06-24-2012
Creation of zone based on zfs root file system

Hi all

I want to know if suppose my global zone has UFS root file system & now I want to create non global zone with ZFS root file system. Is it possible.....If this is possible then how will I able to create zone based on ZFS root file system in global zone having UFS based root file system
# 2  
Old 06-24-2012
Yes, it is possible. Just create zpool on which you want your zones to reside (for example "zones") and then specify zonepath property for your zones to be under "/zones/".
This User Gave Thanks to bartus11 For This Post:
# 3  
Old 06-25-2012
Hi bartus11

As you said I tried to create a zone in zpool but still zone is getting created with UFS root FS. Please find the below logs:




Code:
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c1t0d0s0      7.8G   4.5G   3.2G    59%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   783M   968K   782M     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
                       7.8G   4.5G   3.2G    59%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   782M    40K   782M     1%    /tmp
swap                   782M    32K   782M     1%    /var/run
/dev/dsk/c1t0d0s7      3.5G   3.6M   3.5G     1%    /export/home
rootpool                16G    44K   9.6G     1%    /rootpool
bash-3.2# 
bash-3.2# 


bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# echo |format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <DEFAULT cyl 1563 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@0,0
       1. c1t1d0 <DEFAULT cyl 2085 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@1,0
       2. c1t2d0 <DEFAULT cyl 4093 alt 2 hd 128 sec 32>
          /pci@0,0/pci15ad,1976@10/sd@2,0
Specify disk (enter its number): Specify disk (enter its number): 
bash-3.2# 
bash-3.2# zpool status
  pool: rootpool
 state: ONLINE
 scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        rootpool    ONLINE       0     0     0
          c1t1d0s0  ONLINE       0     0     0

errors: No known data errors
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# zpool create pool1 c1t2d0
bash-3.2# 
bash-3.2# zpool status
  pool: pool1
 state: ONLINE
 scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        pool1       ONLINE       0     0     0
          c1t2d0    ONLINE       0     0     0

errors: No known data errors

  pool: rootpool
 state: ONLINE
 scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        rootpool    ONLINE       0     0     0
          c1t1d0s0  ONLINE       0     0     0

errors: No known data errors
bash-3.2# 
bash-3.2# zfs create pool1/fs1
bash-3.2# 
bash-3.2# zfs list
NAME                              USED  AVAIL  REFER  MOUNTPOINT
pool1                             131K  7.81G    31K  /pool1
pool1/fs1                          31K  7.81G    31K  /pool1/fs1
rootpool                         5.98G  9.64G    44K  /rootpool
rootpool/ROOT                    4.96G  9.64G    31K  legacy
rootpool/ROOT/zfsBE              66.3M  9.64G  4.62G  /tmp/.liveupgrade.281.471/lu_zone_update.471
rootpool/ROOT/zfsBE/var           592K  9.64G  86.2M  /tmp/.liveupgrade.281.471/lu_zone_update.471/var
rootpool/ROOT/zfsBE2             4.90G  9.64G  4.62G  /
rootpool/ROOT/zfsBE2@zfsBE2       188M      -  4.62G  -
rootpool/ROOT/zfsBE2/var         91.7M  9.64G  86.8M  /var
rootpool/ROOT/zfsBE2/var@zfsBE2  4.96M      -  86.2M  -
rootpool/dump                     512M  9.64G   512M  -
rootpool/swap                     535M  10.2G  6.10M  -
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# zpool list
NAME       SIZE  ALLOC   FREE    CAP  HEALTH  ALTROOT
pool1     7.94G   182K  7.94G     0%  ONLINE  -
rootpool  15.9G  5.47G  10.4G    34%  ONLINE  -
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# zonecfg -z zone3
zone3: No such zone configured
Use 'create' to begin configuring a new zone.

zonecfg:zone3> create

zonecfg:zone3> set autoboot=true

zonecfg:zone3> set zonepath=/pool1/fs1/zone3

zonecfg:zone3> add net

zonecfg:zone3:net> set physical=hme0

zonecfg:zone3:net> set address=192.168.1.140

zonecfg:zone3:net> end

zonecfg:zone3> verify

zonecfg:zone3> commit

zonecfg:zone3> exit
bash-3.2# 
bash-3.2# 
bash-3.2# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   1 zone1            running    /export/zone1                  native   shared
   - zone3            configured /pool1/fs1/zone3               native   shared
bash-3.2# mkdir /pool1/fs1/zone3
bash-3.2# chmod 700 /pool1/fs1/zone3
bash-3.2# zoneadm -z zone3 verify
bash-3.2# 
bash-3.2# zoneadm -z zone3 install
A ZFS file system has been created for this zone.
Preparing to install zone <zone3>.
Creating list of files to copy from the global zone.
Copying <2883> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1111> packages on the zone.

Initializing package <0> of <1111>: percent complete: 0%         
Initializing package <1> of <1111>: percent complete: 0%         
Initializing package <2> of <1111>: percent complete: 0%         
Initializing package <3> of <1111>: percent complete: 0%         
Initializing package <4> of <1111>: percent complete: 0%         
Initializing package <5> of <1111>: percent complete: 0%         
Initializing package <6> of <1111>: percent complete: 0%         
Initializing package <7> of <1111>: percent complete: 0%         
.....
.....
.....       
Initializing package <1109> of <1111>: percent complete: 99%         
Initializing package <1110> of <1111>: percent complete: 99%         
Initialized <1111> packages on zone.                                
Zone <zone3> is initialized.
The file </pool1/fs1/zone3/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
bash-3.2# 
bash-3.2# 
bash-3.2# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   1 zone1            running    /export/zone1                  native   shared
   - zone3            installed  /pool1/fs1/zone3               native   shared
bash-3.2# zoneadm -z zone3 boot
bash-3.2# 
bash-3.2# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   1 zone1            running    /export/zone1                  native   shared
   2 zone3            running    /pool1/fs1/zone3               native   shared
bash-3.2# 
bash-3.2# zlogin zone3
[Connected to zone 'zone3' pts/3]
Oracle Corporation	SunOS 5.10	Generic Patch	January 2005
# df -h
Filesystem             size   used  avail capacity  Mounted on
/                      7.8G   106M   7.7G     2%    /
/dev                   7.8G   106M   7.7G     2%    /dev
/lib                   7.8G   4.5G   3.2G    59%    /lib
/platform              7.8G   4.5G   3.2G    59%    /platform
/sbin                  7.8G   4.5G   3.2G    59%    /sbin
/usr                   7.8G   4.5G   3.2G    59%    /usr
proc                     0K     0K     0K     0%    /proc
ctfs                     0K     0K     0K     0%    /system/contract
mnttab                   0K     0K     0K     0%    /etc/mnttab
objfs                    0K     0K     0K     0%    /system/object
swap                   478M   292K   478M     1%    /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1
                       7.8G   4.5G   3.2G    59%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   478M     4K   478M     1%    /tmp
swap                   478M     4K   478M     1%    /var/run
# 
# 
[Connection to zone 'zone3' pts/3 closed]
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# zlogin zone3
[Connected to zone 'zone3' pts/3]
Last login: Mon Jun 25 11:42:21 on pts/3
Oracle Corporation	SunOS 5.10	Generic Patch	January 2005
# 
# zpool status
no pools available
# 
# df -h
Filesystem             size   used  avail capacity  Mounted on
/                      7.8G   106M   7.7G     2%    /
/dev                   7.8G   106M   7.7G     2%    /dev
/lib                   7.8G   4.5G   3.2G    59%    /lib
/platform              7.8G   4.5G   3.2G    59%    /platform
/sbin                  7.8G   4.5G   3.2G    59%    /sbin
/usr                   7.8G   4.5G   3.2G    59%    /usr
proc                     0K     0K     0K     0%    /proc
ctfs                     0K     0K     0K     0%    /system/contract
mnttab                   0K     0K     0K     0%    /etc/mnttab
objfs                    0K     0K     0K     0%    /system/object
swap                   480M   292K   480M     1%    /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1
                       7.8G   4.5G   3.2G    59%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   480M     4K   480M     1%    /tmp
swap                   480M     4K   480M     1%    /var/run
# 
[Connection to zone 'zone3' pts/3 closed]
bash-3.2# 
bash-3.2# 
bash-3.2# zlogin  -C zone3
[Connected to zone 'zone3' console]


You did not enter a selection.
What type of terminal are you using?
 1) ANSI Standard CRT
 2) DEC VT52
 3) DEC VT100
 4) Heathkit 19
 5) Lear Siegler ADM31
 6) PC Console
 7) Sun Command Tool
 8) Sun Workstation
 9) Televideo 910
 10) Televideo 925
 11) Wyse Model 50
 12) X Terminal Emulator (xterms)
 13) CDE Terminal Emulator (dtterm)
 14) Other
Type the number of your choice and press Return: 1

                                                                        

Creating new rsa public/private host key pair
Creating new dsa public/private host key pair
Configuring network interface addresses:.

                                                                        

- Host Name --------------------------------------------------------------------
  Enter the host name which identifies this system on the network.  The name
  must be unique within your domain; creating a duplicate host name will cause
  problems on the network after you install Solaris.

  A host name must have at least one character; it can contain letters,
  digits, and minus signs (-).Host name                                 
--------------------------------------------------------------------------------    Esc-2_Continue    Esc-6_Helpsunzonesunzonesunzone                         


  > Press F2 to go to the next screen.
    Esc-2_Continue    Esc-6_Help
    Esc-2_Continue    Esc-6_Helpsunzone


  - Confirm Information ----------------------------------------------------------
  > Confirm the following information.  If it is correct, press F2;
to change any information, press F4.Host name: sunzone
--------------------------------------------------------------------------------    Esc-2_Continue    Esc-4_Change    Esc-6_Help
    Esc-2_Continue    Esc-4_Change    Esc-6_Help
  Just a moment...



- Time Zone --------------------------------------------------------------------
  On this screen you must specify your default time zone.  You can specify a
  time zone in three ways:  select one of the continents or oceans from the
  list, select other - offset from GMT, or other - specify time zone file.

  > To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].Continents and Oceans
----------------------------------
  -   [ ] Africa
  |   [ ] Americas
  |   [ ] Antarctica
  |   [ ] Arctic Ocean
  |   [ ] Asia
  |   [ ] Atlantic Ocean
  |   [ ] Australia
  |   [ ] Europe
  v   [ ] Indian Ocean

--------------------------------------------------------------------------------    Esc-2_Continue    Esc-6_Help[[[[
    Esc-2_Continue    Esc-6_Help- Country or Region ------------------------------------------------------------
  > To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].Countries and Regions
------------------------
  -   [ ] Afghanistan
  |   [ ] Armenia
  |   [ ] Azerbaijan
  |   [ ] Bahrain
  |   [ ] Bangladesh
  |   [ ] Bhutan
  |   [ ] Brunei
  |   [ ] Cambodia
  |   [ ] China
  |   [ ] Cyprus
  |   [ ] East Timor
  |   [ ] Georgia
  v   [ ] Hong Kong

--------------------------------------------------------------------------------    Esc-2_Continue    Esc-6_Help[[[[[[[[[[[[^rmenia
zerbaijan
Bahrain
ngladesh
hutan
runei
Cambodia
hyprus
East Timor
Georgia
Hong Kong
India


    Esc-2_Continue    Esc-6_Help- Confirm Information ----------------------------------------------------------
  > Confirm the following information.  If it is correct, press F2;
to change any information, press F4.Time zone: Asia/Calcutta
--------------------------------------------------------------------------------    Esc-2_Continue    Esc-4_Change    Esc-6_Help
    Esc-2_Continue    Esc-4_Change    Esc-6_Help
  Please wait...



- Root Password ----------------------------------------------------------------
  Please enter the root password for this system.

  The root password may contain alphanumeric and special characters.  For
  security, the password will not be displayed on the screen as you type it.

  > If you do not want a root password, leave both entries blank.Root password:                  
Root password:
--------------------------------------------------------------------------------    Esc-2_Continue    Esc-6_Help****                
    Esc-2_Continue    Esc-6_Help****
    Esc-2_Continue    Esc-6_****
rebooting system due to change(s) in /etc/default/init


[NOTICE: Zone rebooting]


SunOS Release 5.10 Version Generic_147441-01 64-bit
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
Hostname: sunzone


sunzone console login: root
Password: 
Last login: Tue Jun 26 00:13:08 on pts/3
Jun 26 00:15:15 sunzone login: ROOT LOGIN /dev/console

Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
# df -h
Filesystem             size   used  avail capacity  Mounted on
/                      7.8G   106M   7.7G     2%    /
/dev                   7.8G   106M   7.7G     2%    /dev
/lib                   7.8G   4.5G   3.2G    59%    /lib
/platform              7.8G   4.5G   3.2G    59%    /platform
/sbin                  7.8G   4.5G   3.2G    59%    /sbin
/usr                   7.8G   4.5G   3.2G    59%    /usr
proc                     0K     0K     0K     0%    /proc
ctfs                     0K     0K     0K     0%    /system/contract
mnttab                   0K     0K     0K     0%    /etc/mnttab
objfs                    0K     0K     0K     0%    /system/object
swap                   401M   304K   400M     1%    /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1
                       7.8G   4.5G   3.2G    59%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   400M    36K   400M     1%    /tmp
swap                   400M    16K   400M     1%    /var/run
# 

sunzone console login: ~.
Password: 
Login incorrect
sunzone console login: ~.
[Connection to zone 'zone3' console closed]
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2# 
bash-3.2#

Please let me know where I went wrong
# 4  
Old 06-25-2012
Do df -h from global zone and you will see that zone root is on ZFS pool.
# 5  
Old 06-25-2012
Hi bartus11

Thanks for the quick reply. You mean

Code:
bash-3.2# df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c1t0d0s0      7.8G   4.5G   3.2G    59%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   350M   968K   349M     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
                       7.8G   4.5G   3.2G    59%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   349M    52K   349M     1%    /tmp
swap                   349M    40K   349M     1%    /var/run
/dev/dsk/c1t0d0s7      3.5G   3.6M   3.5G     1%    /export/home
rootpool                16G    44K   9.6G     1%    /rootpool
pool1                  7.8G    32K   7.7G     1%    /pool1
pool1/fs1              7.8G    32K   7.7G     1%    /pool1/fs1
pool1/fs1/zone3        7.8G   110M   7.7G     2%    /pool1/fs1/zone3
bash-3.2# 
bash-3.2# zoneadm list -iv
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   1 zone1            running    /export/zone1                  native   shared
   3 zone3            running    /pool1/fs1/zone3               native   shared
bash-3.2#

Can't it be possibly like below output as suppose user is directly login into zone3 & he is not aware of that zone is above zpool & user might me thinking that this is just a UFS root FS as below output will be more helpfull to explain that it is ZFS root FS or UFS root FS.

Code:
bash-3.2# df -h
Filesystem             size   used  avail capacity  Mounted on
rootpool/ROOT/zfsBE     16G   4.6G   9.9G    32%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   397M   972K   396M     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
                        15G   4.6G   9.9G    32%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
rootpool/ROOT/zfsBE/var
                        16G    86M   9.9G     1%    /var
swap                   396M    40K   396M     1%    /tmp
swap                   396M    36K   396M     1%    /var/run
/dev/dsk/c1t0d0s7      3.5G   3.6M   3.5G     1%    /export/home
rootpool                16G    42K   9.9G     1%    /rootpool
bash-3.2#

# 6  
Old 06-25-2012
It is not possible. Solaris is hiding that information from zone users.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Host file to dns zone creation solution?

We are currently using the famous script H2N to create our DNS zone files from a host file. However, we are moving to IPV6 soon and this script doesnt support IPV6. Is there another script/solution to creating DNS zones via a host file input? Is there another solution or way to do things that I may... (0 Replies)
Discussion started by: jpolachak
0 Replies

2. UNIX for Dummies Questions & Answers

Host file to DNS zone creation

We are currently using the famous script H2N to create our DNS zone files from a host file. However, we are moving to IPV6 soon and this script doesnt support IPV6. Is there another script/solution to creating DNS zones via a host file input? (0 Replies)
Discussion started by: jpolachak
0 Replies

3. Shell Programming and Scripting

Moving files based on file creation

Hi, I have a directory having so many number of files. Now I want to move the files which are older than one month (lets say) from this directory to another directory (say BKP dir). Simply, if file is olderthan one month move it from source1 dir to BKP1 dir. My file names doesn't have... (7 Replies)
Discussion started by: karumudi7
7 Replies

4. Solaris

Migration of system having UFS root FS with zones root to ZFS root FS

Hi All After downloading ZFS documentation from oracle site, I am able to successfully migrate UFS root FS without zones to ZFS root FS. But in case of UFS root file system with zones , I am successfully able to migrate global zone to zfs root file system but zone are still in UFS root file... (2 Replies)
Discussion started by: sb200
2 Replies

5. Emergency UNIX and Linux Support

Not able to extend ZFS file system

Hi All, I have Solaris-10 configured with two non-global zones. All file-systems are mounted on global zone and data file-systems are mounted on non-global zone as lofs. I have added 4 luns of 100 GB each and still not able to extend a file-system. This is production server, so I can not... (5 Replies)
Discussion started by: solaris_1977
5 Replies

6. Solaris

Patching on ZFS file-system

Hi, I have Solaris-10 (Update-7). This is having ZFS file-system and 10 sparse-root zones are there. I want to install Solaris-10 recommended patch cluster on it, but not sure, how to go ahead with procedure. I want to patch one side of the mirror and keep intact another side safe in case of... (6 Replies)
Discussion started by: solaris_1977
6 Replies

7. UNIX for Dummies Questions & Answers

zfs file system

Hi, I try add a new file system: #zfs create dsk1/mqm it came back with: #cannot create 'dsk1/mqm': no such pool 'dsk1' what do I have to do? Kind regards Mehrdad (2 Replies)
Discussion started by: mehrdad68
2 Replies

8. HP-UX

file system creation

I won't to remove a filesystem /dev/vg01/lvo1 and copy the same to different vg ex:- /dev/vg02. Pls give the required step to be followed to complete the said process (3 Replies)
Discussion started by: kamlesh_k
3 Replies
Login or Register to Ask a Question