Change inherit-pkg-dir to writable


 
Thread Tools Search this Thread
Operating Systems Solaris Change inherit-pkg-dir to writable
# 1  
Old 07-13-2009
Change inherit-pkg-dir to writable

/lib in my sparse zone is running and its inherit-pkg-dir due ti which its readonly is it possible to make it writable if yes how ?
# 2  
Old 07-24-2009
Please test this on an experimental zone first.

It looks like you run:
Code:
# zonecfg myzone

and then type in:
Code:
zonecfg:myzone> remove inherit-pkg-dir
zonecfg:myzone:inherit-pkg-dir> set dir=/lib
zonecfg:myzone:inherit-pkg-dir> end
zonecfg:myzone>

Then confiorm what you have asked for:
Code:
zonecfg:myzone> info

Then do:
Code:
zonecfg:myzone> verify
zonecfg:myzone> commit 
zonecfg:myzone> exit

Whether this has to be set during the zone creation stage rather than afterwards, I do not know, I imagine it has to be during the zone creation stage!

Please see:
Solaris Zone Management
and:
Create Sparse Root Solaris Zone
# 3  
Old 07-26-2009
Quote:
Originally Posted by fugitive
/lib in my sparse zone is running and its inherit-pkg-dir due ti which its readonly is it possible to make it writable if yes how ?

Hi,
FYI, that restriction in zone project that inherited package directory is read only was "NOT" accomplished in vain. it violates secirity model.
Anyway, the solution for your situation can be done as in procedure below. Hope it'll help u.

Good Luck.

Code:
 How can we have a read/write directory inside a IPD (Inherited Package Directory) or a readonly mount inside a zone 

 Often we need to have read/write directories inside the IPDs so that we can install packages in a specific sparse root zone. Consider a package which installs its binaries in /usr/local. Since /usr is readonly inside a sparse root zone /usr/local will also be readonly. But we can have a subdirectory of IPD which is writable, following the steps documented below: 
No need for this step if you have a free slice 
   # mkfile 100m /space/zones/local
  # lofiadm -a /space/zones/local
  /dev/lofi/2
Configure zone for adding a writable filesystem inside an IPD: 
   # zonecfg -z zone2
  zonecfg:zone2> add fs
  zonecfg:zone2:fs> set dir=/usr/local
  zonecfg:zone2:fs> set special=/dev/lofi/2
  zonecfg:zone2:fs> set raw=/dev/rlofi/2
  zonecfg:zone2:fs> set type=ufs
  zonecfg:zone2:fs> end
  zonecfg:zone2> commit
  zonecfg:zone2> info
  zonename: zone2
  zonepath: /space/zones/zone2
  autoboot: false
  bootargs:
  pool:
  limitpriv:
  inherit-pkg-dir:
          dir: /lib
  inherit-pkg-dir:
          dir: /platform
  inherit-pkg-dir:
          dir: /sbin
  inherit-pkg-dir:
          dir: /usr
  fs:
          dir: /usr/local
          special: /dev/lofi/2
          raw: /dev/rlofi/2
          type: ufs
          options: []
  zonecfg:zone2> exit
You need to create a /usr/local since zone utilities wont be able to create it inside the IPD as it is readonly: 
   # mkdir /usr/local/
  # newfs /dev/lofi/2
  newfs: construct a new file system /dev/rlofi/2: (y/n)? y
  /dev/rlofi/2:   204600 sectors in 341 cylinders of 1 tracks, 600 sectors
          99.9MB in 22 cyl groups (16 c/g, 4.69MB/g, 2240 i/g)
  super-block backups (for fsck -F ufs -o b=#) at:
   32, 9632, 19232, 28832, 38432, 48032, 57632, 67232, 76832, 86432,
   115232, 124832, 134432, 144032, 153632, 163232, 172832, 182432, 192032, 201632
Now Install the zone: 
   # zoneadm -z zone2 install
  Preparing to install zone <zone2>.
  Checking <ufs> file system on device </dev/rlofi/2> to be mounted at </space/zones/zone2/root>
  Creating list of files to copy from the global zone.
  Copying <2066> files to the zone.
  Initializing zone product registry.
  Determining zone package initialization order.
  Preparing to initialize <977> packages on the zone.
  Initialized <977> packages on zone.
  Zone <zone2> is initialized.
  The file </space/zones/zone2/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
Checking whether the /usr/local inside is writable: 
   # zoneadm -z zone2 boot
  # zlogin zone2
  [Connected to zone 'zone2' pts/3]
  Sun Microsystems Inc.   SunOS 5.11      snv_46  October 2007
  # cd /usr
  # touch a
  touch: a cannot create
  # cd local
  # touch a
  # ls
  a           lost+found

    Customize your zone specific package so that it gets installed in /usr/local

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

# pkg publisher gives bash: pkg: command not found

This is the operating system im using Oracle Solaris 10 9/10 s10s_u9wos_14a SPARC I need to install some packages by setting local repository While i run the below command # pkg publisher command returns bash: pkg: command not found while looking for /usr/bin/pkg i get bash:... (2 Replies)
Discussion started by: babinlonston
2 Replies

2. Solaris

Pkg problem, one zone trying pkg.Oracle.com on port 1008

Hi Solaris Experts, The pkg utility on one of my non-global zones has stopped working, it's trying to connect to port 1008 at pkg.oracle.com I was using pkg successfully from this zone, but now it's showing this error: lzone1 $ pkg search xterm pkg: Some repositories failed to respond... (4 Replies)
Discussion started by: ad101
4 Replies

3. Solaris

How extract SUNWexplo.7.1.pkg & SUNWexplu.7.1.pkg from install_stb.sh?

Hi all, Could please guideas how to extract SUNWexplo.7.2.pkg & SUNWexplu.7.2.pkg from install_stb.sh. I need to upgrade my Sun Explorer to 7.2 version from 7.1 . This what written in read me file about its installation: The Lightweight Availability Collection Tool (LWACT) is no... (1 Reply)
Discussion started by: manalisharmabe
1 Replies

4. Solaris

Change Dir doubt and some advice.

Hello, This is my first post in this forum. I need to change the owner of several directories and files in Solaris 10 Operating system, more than 500. The server is in production and my question is: If i change the owner of directories and files, the server can become unstable, i mean,... (2 Replies)
Discussion started by: checoturco
2 Replies

5. Shell Programming and Scripting

Generate a change list of files/dir

Is there a tool that can diff a directory and generate a change list of files in that directory based on a previous snapshot on the directory? For example /etc/a.txt:changed /etc/b.txt:removed /etc/c.txt:added Thanks! (1 Reply)
Discussion started by: overmindxp
1 Replies

6. HP-UX

could not able change permission of /home dir

Hi i am new to this admin area . i have created user with name as "ab" and gave home dir as /home/ab . when i tried to create the /home/ab dir , i got he following error. "mkdir: Failed to make directory "/home/ab"; Operation not applicable " Thanks in advance . (1 Reply)
Discussion started by: expert
1 Replies

7. Solaris

remove dir from inherit-pkg-dir

hi i configured zone and have 4 files /usr and /lib /platform /sbin from global zone and i want to exclude /usr/local from /usr any one has an idea ? (2 Replies)
Discussion started by: maxim42
2 Replies

8. Solaris

cant able to change permission in a DIR as root user

Hi my directory not accepting any commands. its simply telling permission denied. i tried ( cp, mv, rm ) as roor i want to set default permissons to this DIR please find the Logs below. dr-xr-xr-x 1 root root 1 Jun 1 09:04 AP1_ROP ( original dir) root> chmod 777... (5 Replies)
Discussion started by: vijayq8
5 Replies

9. Shell Programming and Scripting

how I change dir in dos

Hi I have a dos batch file in window server where I call a cmd command for creating some db. this cmd commad is located in e:\data\abcd\xyz.cmd. Now I call this batch file from unix ssh.sh but my access point is D in window server here I want to change the dos prompt to e:\data\abcd. in... (3 Replies)
Discussion started by: Jamil Qadir
3 Replies

10. UNIX for Dummies Questions & Answers

change login dir

Ok when I log in to my terminal I land in a dir. How can I change the dir that I start from when I login? Thanks for the help, sure it is a no brainer for you guys cd (5 Replies)
Discussion started by: lorcet222
5 Replies
Login or Register to Ask a Question