zfs won''t allow me to rm -rf a simple set of directories. For example: (# indicates root shell) # /usr/sbin/ramdiskadm -a forzfs 100m /dev/ramdisk/forzfs # zpool create testpool /dev/ramdisk/forzfs (this create took a long time!) # zfs list NAME USED AVAIL REFER MOUNTPOINT mpool 1.15G 59.9G 11.5K /mpool mpool/home 1.13G 59.9G 1.13G /mpool/home mpool/optcsw 17.2M 59.9G 17.2M /opt/csw testpool 31.5K 79.5M 8K /testpool # cd /testpool # umask 0 # mkdir al # chown al:208 al (now as user al): $ cd /testpool/al $ umask 0 $ mkdir -p -m 750 test2/test3 $ ls -alR .: total 6 drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . drwxr-xr-x 3 root sys 3 Nov 22 11:12 .. drwxrwxrwx 3 al supertra 3 Nov 22 11:13 test2 ./test2: total 6 drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . drwxrwxrwx 3 al supertra 3 Nov 22 11:13 .. drwxr-x--- 2 al supertra 2 Nov 22 11:13 test3 ./test2/test3: total 4 drwxr-x--- 2 al supertra 2 Nov 22 11:13 . drwxrwxrwx 3 al supertra 3 Nov 22 11:13 .. $ touch test2/test3/temp10 $ rm -rf test2 $ ls -al total 6 drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . drwxr-xr-x 3 root sys 3 Nov 22 11:12 .. drwxrwxrwx 3 al supertra 3 Nov 22 11:13 test2 (whoops - test2 is still there) $ ls -alR .: total 6 drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . drwxr-xr-x 3 root sys 3 Nov 22 11:12 .. drwxrwxrwx 3 al supertra 3 Nov 22 11:13 test2 ./test2: total 6 drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . drwxrwxrwx 3 al supertra 3 Nov 22 11:13 .. drwxr-x--- 2 al supertra 2 Nov 22 11:13 test3 ./test2/test3: total 4 drwxr-x--- 2 al supertra 2 Nov 22 11:13 . drwxrwxrwx 3 al supertra 3 Nov 22 11:13 .. $ So the file temp10 was removed, but not the directories. A truss indicates: .... getcwd("/testpool/al", 1024) = 0 open64(".", O_RDONLY) = 3 stat64(".", 0x080474C0) = 0 chdir("..") = 0 lstat64(".", 0x080474C0) = 0 chdir("..") Err#13 EACCES [file_dac_search] fchdir(3) = 0 openat(AT_FDCWD, "test2", O_RDONLY|O_NDELAY|O_LARGEFILE) = 4 ... What am I missing? Al Hopper Logical Approach Inc, Plano, TX. al at logical-approach.com Voice: 972.379.2133 Fax: 972.379.2134 Timezone: US CDT OpenSolaris.Org Community Advisory Board (CAB) Member - Apr 2005
On 11/22/05, Al Hopper <al at logical-approach.com> wrote:> > zfs won''t allow me to rm -rf a simple set of directories. For example: > > (# indicates root shell) > > # /usr/sbin/ramdiskadm -a forzfs 100m > /dev/ramdisk/forzfs > # zpool create testpool /dev/ramdisk/forzfs > > (this create took a long time!) > > # zfs list > NAME USED AVAIL REFER MOUNTPOINT > mpool 1.15G 59.9G 11.5K /mpool > mpool/home 1.13G 59.9G 1.13G /mpool/home > mpool/optcsw 17.2M 59.9G 17.2M /opt/csw > testpool 31.5K 79.5M 8K /testpool > > # cd /testpool > # umask 0 > # mkdir al > # chown al:208 al > > (now as user al): > > $ cd /testpool/al > $ umask 0 > $ mkdir -p -m 750 test2/test3 > $ ls -alR > .: > total 6 > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . > drwxr-xr-x 3 root sys 3 Nov 22 11:12 .. > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 test2 > > ./test2: > total 6 > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 .. > drwxr-x--- 2 al supertra 2 Nov 22 11:13 test3 > > ./test2/test3: > total 4 > drwxr-x--- 2 al supertra 2 Nov 22 11:13 . > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 .. > > $ touch test2/test3/temp10 > $ rm -rf test2 > $ ls -al > total 6 > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . > drwxr-xr-x 3 root sys 3 Nov 22 11:12 .. > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 test2 > > (whoops - test2 is still there)I replayed Al''s scenario on "SunOS mybox 5.11 snv_27 i86pc i386 i86pc" What I see after "rm -rf" is : $ rm -rf test2 $ ls -la total 4 drwxrwxrwx 2 leon sasl 2 Nov 22 19:49 . drwxr-xr-x 3 root sys 3 Nov 22 19:48 .. So rm -rf in my case worked fine -- Leon Koll IOSUG Member
On Tue, 22 Nov 2005, Leon Koll wrote:> > On 11/22/05, Al Hopper <al at logical-approach.com> wrote: > > > > zfs won''t allow me to rm -rf a simple set of directories. For example: > > > > (# indicates root shell) > > > > # /usr/sbin/ramdiskadm -a forzfs 100m > > /dev/ramdisk/forzfs > > # zpool create testpool /dev/ramdisk/forzfs > > > > (this create took a long time!) > > > > # zfs list > > NAME USED AVAIL REFER MOUNTPOINT > > mpool 1.15G 59.9G 11.5K /mpool > > mpool/home 1.13G 59.9G 1.13G /mpool/home > > mpool/optcsw 17.2M 59.9G 17.2M /opt/csw > > testpool 31.5K 79.5M 8K /testpool > > > > # cd /testpool > > # umask 0 > > # mkdir al > > # chown al:208 al > > > > (now as user al): > > > > $ cd /testpool/al > > $ umask 0 > > $ mkdir -p -m 750 test2/test3 > > $ ls -alR > > .: > > total 6 > > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . > > drwxr-xr-x 3 root sys 3 Nov 22 11:12 .. > > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 test2 > > > > ./test2: > > total 6 > > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . > > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 .. > > drwxr-x--- 2 al supertra 2 Nov 22 11:13 test3 > > > > ./test2/test3: > > total 4 > > drwxr-x--- 2 al supertra 2 Nov 22 11:13 . > > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 .. > > > > $ touch test2/test3/temp10 > > $ rm -rf test2 > > $ ls -al > > total 6 > > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . > > drwxr-xr-x 3 root sys 3 Nov 22 11:12 .. > > drwxrwxrwx 3 al supertra 3 Nov 22 11:13 test2 > > > > (whoops - test2 is still there) > > I replayed Al''s scenario on "SunOS mybox 5.11 snv_27 i86pc i386 i86pc" > What I see after "rm -rf" is : > $ rm -rf test2 > $ ls -la > total 4 > drwxrwxrwx 2 leon sasl 2 Nov 22 19:49 . > drwxr-xr-x 3 root sys 3 Nov 22 19:48 .. > > So rm -rf in my case worked fine > > -- Leon Koll > IOSUG MemberI compared notes with Leon via email, and it looks like we''re both running build 27 (Express) from the SDLC. Which had not been officially released at the time I downloaded it BTW. Or perhaps the build was "refreshed"? I''ve also duplicated the issue on two different systems: a w1100z (AMD 152 in 64-bit mode) and a 3GHz P4 (old style 512kb cache) on a mainstream Asus Motherboard (P4P800E) with 1Gb of RAM. Regards, Al Hopper Logical Approach Inc, Plano, TX. al at logical-approach.com Voice: 972.379.2133 Fax: 972.379.2134 Timezone: US CDT OpenSolaris.Org Community Advisory Board (CAB) Member - Apr 2005
Al Hopper wrote:> On Tue, 22 Nov 2005, Leon Koll wrote: > > >>>On 11/22/05, Al Hopper <al at logical-approach.com> wrote: >>> >>>zfs won''t allow me to rm -rf a simple set of directories. For example: >>> >>>(# indicates root shell) >>> >>># /usr/sbin/ramdiskadm -a forzfs 100m >>>/dev/ramdisk/forzfs >>># zpool create testpool /dev/ramdisk/forzfs >>> >>>(this create took a long time!) >>> >>># zfs list >>>NAME USED AVAIL REFER MOUNTPOINT >>>mpool 1.15G 59.9G 11.5K /mpool >>>mpool/home 1.13G 59.9G 1.13G /mpool/home >>>mpool/optcsw 17.2M 59.9G 17.2M /opt/csw >>>testpool 31.5K 79.5M 8K /testpool >>> >>># cd /testpool >>># umask 0 >>># mkdir al >>># chown al:208 al >>> >>>(now as user al): >>> >>>$ cd /testpool/al >>>$ umask 0 >>>$ mkdir -p -m 750 test2/test3 >>>$ ls -alR >>>.: >>>total 6 >>>drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . >>>drwxr-xr-x 3 root sys 3 Nov 22 11:12 .. >>>drwxrwxrwx 3 al supertra 3 Nov 22 11:13 test2 >>> >>>./test2: >>>total 6 >>>drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . >>>drwxrwxrwx 3 al supertra 3 Nov 22 11:13 .. >>>drwxr-x--- 2 al supertra 2 Nov 22 11:13 test3 >>> >>>./test2/test3: >>>total 4 >>>drwxr-x--- 2 al supertra 2 Nov 22 11:13 . >>>drwxrwxrwx 3 al supertra 3 Nov 22 11:13 .. >>> >>>$ touch test2/test3/temp10 >>>$ rm -rf test2 >>>$ ls -al >>>total 6 >>>drwxrwxrwx 3 al supertra 3 Nov 22 11:13 . >>>drwxr-xr-x 3 root sys 3 Nov 22 11:12 .. >>>drwxrwxrwx 3 al supertra 3 Nov 22 11:13 test2 >>> >>>(whoops - test2 is still there) >> >>I replayed Al''s scenario on "SunOS mybox 5.11 snv_27 i86pc i386 i86pc" >>What I see after "rm -rf" is : >>$ rm -rf test2 >>$ ls -la >>total 4 >>drwxrwxrwx 2 leon sasl 2 Nov 22 19:49 . >>drwxr-xr-x 3 root sys 3 Nov 22 19:48 .. >> >>So rm -rf in my case worked fine >> >>-- Leon Koll >> IOSUG Member > > > I compared notes with Leon via email, and it looks like we''re both running > build 27 (Express) from the SDLC. Which had not been officially released > at the time I downloaded it BTW. Or perhaps the build was "refreshed"? > > I''ve also duplicated the issue on two different systems: a w1100z (AMD 152 > in 64-bit mode) and a 3GHz P4 (old style 512kb cache) on a mainstream Asus > Motherboard (P4P800E) with 1Gb of RAM. >After exchanging some email with Al about this, the problem turned out to be an issue with the permissions on the directory that /testpool is mounted on. I''ve included the relevant part of the mail thread. >>> Can you unmount /testpool and look at the permissions on the >>> directory testpool is mounted on. I''m looking for an old Solaris >>> bug that will cause this sort of problem when the permissions on the >>> covered vnode are not permissive enough to allow traversing to the >>> above file system. >>>> >> >>>> >>Also, can you see if you can do the following >>>> >> >>>> >>rmdir test2/test3 >>>> >>rmdir test2 >> >>> > >>> > >>> > Yes - the rmdir commands worked as expected. >>> > I did a umount /testpool. Followed by: >>> > >>> > # ls -al /testpool >>> > total 4 >>> > drwxr-xr-- 2 root root 512 Nov 22 11:10 . >>> > drwxr-xr-x 39 root root 1024 Nov 23 07:46 .. >>> > > >> >> Here is the problem the permissions on "." don''t allow search >> permission. for users that aren''t "root" or in the "root" group. >> >> change the permission on the directory that testpool is mounted on to >> 755 rather than 754 which it currently has. >> >> This is the bug 4697677 which has the synopsis "permissions of >> underlying directory affect permissons of mount point". >> >> I''m kind of curious how the directory got created that way. Do you >> typically have a restrictive umask? >Yes that was it. I typically has a umask of 02 or 022. In this case it >was inadvertantly set to 01 - probably a typo. -Mark