Solved

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

Posted on 2002-07-29
10
338 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
  • 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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 150 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
netstat -a in AIX unix 8 42
What are recommended OS for exim mail server? 10 109
help pulling data string using Awk 9 69
Solaris 10.  Nmap installation fails 2 58
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…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

770 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