Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can't chgrp a raw device using itssymbolic link or its /dev  name

Posted on 2002-07-29
10
Medium Priority
?
347 Views
Last Modified: 2013-12-27

 I am trying to change the group and owner of raw device-
i.e., a slice - /dev/c0t4d0s4 - which has a symbolic link;(I'll have to come back and list the symbolic link.)
 Logged in as root, I cd to /dev and ls -al the contents; then I copy the symbolic link name that occurs after
/dev/c0t4d0s4 and do a chgrp, pasting in the symbolic link name. I don't get an error message; but when I check the file listing it still shows root as the group that /dev/c0t4d0s4 belongs to. This was the prescribed
procedure at an Informix site. I've tried using the device
name- /dev/c0t4d0s4 - with chgrp also.
0
Comment
Question by:defcon1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7187496
which file/link is wrong?
which file/link did you change?
Could you please post result of:

  ls -l real-file symbolik-link
0
 

Author Comment

by:defcon1
ID: 7190520

 Sorry, it took me so long. After more scruntiny, I belive
what I thought were raw devices are not. I think the file
permissions should start with a "c" indicating a  raw device ? Here is the result of an "ls -al" :

 # cd /dev/rdsk
# ls -al
total 42
drwxr-xr-x   2 root     sys          512 May 23 06:50 .
drwxr-xr-x  14 root     sys         3584 Jul 31 05:59 ..
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s0 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:a,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s1 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:b,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s2 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:c,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s3 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:d,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s4 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:e,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s5 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:f,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s6 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:g,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s7 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:h,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s0 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:a,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s1 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:b,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s2 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:c,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s3 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:d,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s4 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:e,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s5 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:f,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s6 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:g,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s7 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:h,raw
0
 

Author Comment

by:defcon1
ID: 7190673

 I think the device is raw unless you create a filesystem and mount it; the "l" in the permissions is just signifing
the link. I have not created any links; these are the ones present after partitioning the drive into slices.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 51

Expert Comment

by:ahoffmann
ID: 7190819
chgrp/chown do not work on the symbolic link, but on the target it points to.
This nasty behaviour has been changed some time ago in Solaris 2.x :-(

The application which checks the device needs to follow the link (real programmers use lstat() for that ;-)
0
 

Author Comment

by:defcon1
ID: 7191500

 The target is the devicename - /dev/rdsk/c0t4d0s4 ?
 I tried   chgrp informix /dev/rdsk/c0t4d0s4  and  chgrp 1001 /dev/rdsk/c0t4d0s4 (using informix's GID) with no success .
  I am trying to repeat a previous installation
by someone else ;and in this other instance's /dev/rdsk
directory, the device, c0t4d0s4, has informix as both the user and group owner.The entrys look like this :

# cd /dev/rdsk
# ls -al
total 42
drwxr-xr-x   2 root     sys          512 Feb 14  2001 .
drwxr-xr-x  15 root     sys         3584 Jul 30 09:55 ..
lrwxrwxrwx   1 root     root          50 Feb 13  2001 c0t0d0s0 -> ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw
lrwxrwxrwx   1 root     root          50 Feb 13  2001 c0t0d0s1 -> ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:b,raw
lrwxrwxrwx   1 root     root          50 Feb 13  2001 c0t0d0s2 -> ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:c,raw
lrwxrwxrwx   1 root     root          50 Feb 13  2001 c0t0d0s3 -> ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:d,raw
lrwxrwxrwx   1 informix informix      50 Feb 13  2001 c0t0d0s4 -> ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:e,raw
lrwxrwxrwx   1 informix informix      50 Feb 13  2001 c0t0d0s5 -> ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:f,raw
lrwxrwxrwx   1 informix informix      50 Feb 13  2001 c0t0d0s6 -> ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:g,raw
lrwxrwxrwx   1 informix informix      50 Feb 13  2001 c0t0d0s7 -> ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:h,raw
lrwxrwxrwx   1 root     root          49 Feb 13  2001 c0t2d0s0 -> ../../devices/pci@1f,0/pci@1,1/ide@3/sd@2,0:a,raw
lrwxrwxrwx   1 root     root          49 Feb 13  2001 c0t2d0s1 -> ../../devices/pci@1f,0/pci@1,1/ide@3/sd@2,0:b,raw
lrwxrwxrwx   1 root     root          49 Feb 13  2001 c0t2d0s2 -> ../../devices/pci@1f,0/pci@1,1/ide@3/sd@2,0:c,raw
lrwxrwxrwx   1 root     root          49 Feb 13  2001 c0t2d0s3 -> ../../devices/pci@1f,0/pci@1,1/ide@3/sd@2,0:d,raw
lrwxrwxrwx   1 root     root          49 Feb 13  2001 c0t2d0s4 -> ../../devices/pci@1f,0/pci@1,1/ide@3/sd@2,0:e,raw
lrwxrwxrwx   1 root     root          49 Feb 13  2001 c0t2d0s5 -> ../../devices/pci@1f,0/pci@1,1/ide@3/sd@2,0:f,raw
lrwxrwxrwx   1 root     root          49 Feb 13  2001 c0t2d0s6 -> ../../devices/pci@1f,0/pci@1,1/ide@3/sd@2,0:g,raw
lrwxrwxrwx   1 root     root          49 Feb 13  2001 c0t2d0s7 -> ../../devices/pci@1f,0/pci@1,1/ide@3/sd@2,0:h,raw

 
0
 

Author Comment

by:defcon1
ID: 7191522

 Just to be clear, the first thing I tried was :
chgrp informix ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:e,raw

 and :

chgrp informix /devices/pci@1f,0/pci@1/scsi@1/sd@4,0:e,raw

 from within the /dev/rdsk directory. The OS is Solaris 8.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 450 total points
ID: 7191553
remove the symbolic link, then login as informix and create the link again, then it will have user informix and primary group of informix
0
 

Author Comment

by:defcon1
ID: 7209474

 I did this :
 The second important thing to remember is that the device name in /dev/rdsk is really a link to a device name. This becomes important when you are setting permissions. For example c0t1d0s0 is linked to ../../devices/io-unit@f->...etc. By doing a ls -al /dev/rdsk you will see what I mean by the ../../devices/io-unit@f designation. You need to set permissions on each "chunk" or device as follows:


chmod 660 device
chgrp informix device
chown informix device
You would think that you simply do a chmod 660 c0t1d0s0. This is not correct. You need to use the following procedure which assumes you are at the console:

1. login as root

2. run openwin to get a graphical display if it is not running already.

3. cd /dev/rdsk

4. ls -al to see all links and physical device names

5. find the right device and highlight the actual device name

lrwxrwxrwx 1 root root 88 Mar 22 1995 c0t3d0s0 ->

../../devices/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0:a,raw

(i.e.: In the above example, you would highlight everything after the c0t3d0s0 -> designation: ../../devices/.........:a,raw

^ ^

|______ highlight _____|

6. Press the COPY key on the left hand side of the keyboard in the special function key section.

7. Set the permissions.


chmod 660 <press PASTE key><RETURN>
chgrp informix <press PASTE key><RETURN>
chown informix <press PASTE key><RETURN>
ls -al <press PASTE key><RETURN>
(the ls -al should reveal the modified permissions)
8. Setup your own links to insulate OnLine from any changes in device names in case a disk should be swapped out. Create your links in the informix directory or create a directory off of root like ifx_links in order to keep the path name short. DO NOT create your links in /dev. (Reason: In general, some systems rebuild /dev during boot up.) An example of a link might be the following:
ln -s /dev/rdsk/c0t1d0s0 /ifx_links/ifx7_rootdbs.

 but, when I do this last command(when logged in as informix), the error message says informix does not have permissions to this command. When I do an  " ls -Ll " 
I get :otal 4
crw-r-----   1 root     sys       32,  8 Aug  8 14:23 c0t1d0s0
crw-r-----   1 root     sys       32,  9 Aug  8 14:23 c0t1d0s1
crw-r-----   1 root     sys       32, 10 Aug  8 14:23 c0t1d0s2
crw-r-----   1 root     sys       32, 11 Aug  8 14:23 c0t1d0s3
crw-rw----   1 informix informix  32, 12 Aug  8 14:23 c0t1d0s4
crw-rw----   1 informix informix  32, 13 Aug  8 14:23 c0t1d0s5
crw-rw----   1 informix informix  32, 14 Aug  8 14:23 c0t1d0s6
crw-rw----   1 informix informix  32, 15 Aug  8 14:23 c0t1d0s7
crw-r-----   1 root     sys       32, 32 Aug  7 15:22 c0t4d0s0
crw-r-----   1 root     sys       32, 33 Aug  7 15:22 c0t4d0s1
crw-r-----   1 root     sys       32, 34 Aug  7 15:22 c0t4d0s2
crw-r-----   1 root     sys       32, 35 Aug  7 15:22 c0t4d0s3
crw-r-----   1 root     sys       32, 36 Aug  7 15:22 c0t4d0s4
crw-r-----   1 root     sys       32, 37 Aug  7 15:22 c0t4d0s5
crw-r-----   1 root     sys       32, 38 Aug  7 15:22 c0t4d0s6
crw-r-----   1 root     sys       32, 39 Aug  7 15:22 c0t4d0s7
crw-r-----   1 root     sys       32, 48 Aug  8 14:44 c0t6d0s0
crw-r-----   1 root     sys       32, 49 Aug  7 15:22 c0t6d0s1
crw-r-----   1 root     sys       32, 50 Aug  7 15:22 c0t6d0s2
crwxrwxrwx   1 informix informix  32, 51 Aug  7 15:22 c0t6d0s3
crw-r-----   1 root     sys       32, 52 Aug  7 15:22 c0t6d0s4
crw-r-----   1 root     sys       32, 53 Aug  7 15:22 c0t6d0s5
crw-r-----   1 root     sys       32, 54 Aug  7 15:22 c0t6d0s6
crw-r-----   1 root     sys       32, 55 Aug  7 15:22 c0t6d0s7
-rw-r--r--   1 root     other          0 Aug  9 07:45 me.txt
-rw-r--r--   1 root     other       1582 Aug  9 07:45 me.txx
 but, when I do an " ls -l or ls -al " I get :
drwxr-xr-x   2 root     sys          512 May 23 06:50 .
drwxr-xr-x  14 root     sys         3584 Jul 31 05:59 ..
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s0 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:a,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s1 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:b,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s2 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:c,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s3 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:d,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s4 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:e,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s5 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:f,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s6 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:g,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t4d0s7 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@4,0:h,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s0 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:a,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s1 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:b,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s2 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:c,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s3 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:d,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s4 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:e,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s5 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:f,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s6 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:g,raw
lrwxrwxrwx   1 root     root          48 May 23 06:50 c0t6d0s7 -> ../../devices/pci@1f,0/pci@1/scsi@1/sd@6,0:h,raw
 
Comment

0
 

Author Comment

by:defcon1
ID: 7222761

 ahoffmann did not read my last comment; but a least he tried; and I know he is all over the board; so, his time is thin.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7225438
did you mean the comment 08/09/2002?

Can't believe that this has to do with openwin and/or the special Sun-keyboard.
According to the description, you changed the target's permissions, that's what I already said.

Thanks anyway for finalizing this question.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question