Question
========
How can I find out why this fails with a permission error?
$ ls -la
./..: No permission
However the mounted filesystem shows I have enough permission:
$ ls -ld /backup
drwxr-xr-x 4 root system 4096 Mar 10 17:07 /backup
Answer
It’s possible to view these permissions in kdb, the kernel debugger. Here’s a quick run through.
# kdb
(0)> vfs
GFS DATA TYPE FLAGS
1 F1000A10008C0910 02D829B0 F1000A0027A90080 JFS2 DEVMOUNT
… /dev/hd4 mounted over /
…
10 F1000A10008C1510 02D829B0 F1000A002DA9F080 JFS2 DEVMOUNT
… /dev/fslv01 mounted over /backup
Now find the gnode in the VFS_MNTDOVER section:
(0)> vfs 10
…
VFS_MNTDOVER.. F1000A0027BD3820
v_flag…. 00000000 v_count… 00000001
v_vfsgen.. 00000000 v_vfsp…. F1000A10008C0910
v_lock@… F1000A0027BD3830 v_lock…. 0000000000000000
v_mvfsp… F1000A10008C1510 v_gnode… F1000A0027BD34B0
v_next…. 0000000000000000 v_vfsnext. F1000A002A073420
v_vfsprev. F1000A0029B53820 v_pfsvnode 0000000000000000
v_audit… 0000000000000000
…
Get the inode, which is in the gn_data field:
(0)> gnode F1000A0027BD34B0
GNODE………… F1000A0027BD34B0 F1000A0027BD34B0
gn_type……. 00000002 gn_flags…… FFFF8000
gn_seg…….. 0000000000000000
gn_mwrcnt….. 00000000 gn_mrdcnt….. 00000000 gn_rdcnt…… 00000000
gn_wrcnt…… 00000000 gn_excnt…… 00000000 gn_rshcnt….. 00000000
gn_ops…….. 0000000002D25898 j2_vnops
gn_vnode…… F1000A0027BD3820 gn_rdev……. 8000000A00000004
gn_chan……. 00000000 gn_reclk_event 00000000FFFFFFFF
gn_reclk_lock@ F1000A0027BD34F8 gn_reclk_lock. 0000000000000000
gn_filocks…. 0000000000000000 gn_data……. F1000A0027BD3480
gn_type……. DIR gn_flags…… XPAGER
(0)> i2 F1000A0027BD3480
ADDRESS DEVICE I_NUM/FS COUNT TYPE FLAGS
F1000A0027BD3480 8000000A00000004 21290/16 00001 VDIR
…
Persistent Inode @ 0xF1000A0027BD3620:
number……. 0x000000000000532A
gen………. 0x61BBD3AA fileset…… 0x00000010 inostamp….. 0x528268E5
uid………. 0x000000CC gid………. 0x00000000 nlink…….. 0x00000002
mode……… 0x000141C0 mode………drwx——- mode……… 0040700
0xCC – 204
# grep 204 /etc/passwd
mgilpin:!:204:1::/home/mgilpin:/usr/bin/ksh