LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-01-2002, 12:24 PM   #1
Rob Ellsworth
LQ Newbie
 
Registered: Aug 2002
Posts: 18

Rep: Reputation: 0
Question cannot unlink cannot remove


I am having a problem when I try to rename or delete files. Most of our access to the server is through Samba. However, I tried rm and mv in linux and the problem is still there.

All our users are in the group associated with these files.
Permission for the files is 777.
lsattr shows no attributes.
The owner of the file and root can mv and rm.
Any other users cannot even though they they are in the same group.

The mv command results in the following messages.
mv: cannot unlink `ACH99': Operation not permitted
mv: cannot remove `ACH99': Operation not permitted

We have been running on linux/samba for over a month. I think we this problem just started in the last day or two. I am sure we would have noticed it earlier if it had been happening the whole time. I think I have only touched the smb.conf recently. None of this makes sense to me.

Help!
 
Old 10-01-2002, 12:29 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Is it only that one file that you cannot use the mv command ? Do you get the same error when logged in as root and trying to move ?
 
Old 10-01-2002, 12:46 PM   #3
Rob Ellsworth
LQ Newbie
 
Registered: Aug 2002
Posts: 18

Original Poster
Rep: Reputation: 0
The same file for any file. Only the owner can rm or mv.
 
Old 10-01-2002, 01:09 PM   #4
Rob Ellsworth
LQ Newbie
 
Registered: Aug 2002
Posts: 18

Original Poster
Rep: Reputation: 0
Root can still mv and rm.
I have users running batch files that rename and delete all the time. If I don't resolve this, they don't work correctly.
 
Old 10-01-2002, 01:39 PM   #5
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Does this occur anywhere on the filesystem? (try it on a file in /tmp, for
example)

Can you post the results from following:

ls -la /

ls -la /home
(you can remove the actual user directories from the output, the only
important thing is the permissions field)

Cheers,
Moses
 
Old 10-01-2002, 02:34 PM   #6
Rob Ellsworth
LQ Newbie
 
Registered: Aug 2002
Posts: 18

Original Poster
Rep: Reputation: 0
I have a subdirectory of home called main and a share setup for Samba that points to it. I can mv in main. The problem occurs in the subdirectory OPERATE. Here is the results of ls -l.
drwsrwsrwt 4 useridx Groupz 20480 Oct 1 14:21 OPERATE

Here is what a file and an attempt to move looks like.
-rwsrwsrwt 1 useridx Groupz 590 May 31 1995 LC5.OLD
[useridy@servername OPERATE]$ mv LC5.OLD LC5.BAK
mv: cannot unlink `LC5.OLD': Operation not permitted
mv: cannot remove `LC5.OLD': Operation not permitted
 
Old 10-01-2002, 02:42 PM   #7
Rob Ellsworth
LQ Newbie
 
Registered: Aug 2002
Posts: 18

Original Poster
Rep: Reputation: 0
Here is the rest of the information you asked for Moses.

[usery@servername /]$ ls -la /
total 188
drwxr-xr-x 19 root root 1024 Aug 6 08:47 .
drwxr-xr-x 19 root root 1024 Aug 6 08:47 ..
-rw-r--r-- 1 root root 0 Aug 6 08:47 .autofsck
drwxr-xr-x 2 root root 2048 Apr 5 12:08 bin
drwxr-xr-x 4 root root 1024 Mar 26 2002 boot
drwxr-xr-x 17 root root 77824 Aug 6 08:47 dev
drwxr-xr-x 48 root root 4096 Oct 1 13:25 etc
drwxr-xr-x 30 root root 4096 Aug 26 11:18 home
drwxr-xr-x 2 root root 1024 Jun 21 2001 initrd
drwxr-xr-x 7 root root 3072 Mar 2 2002 lib
drwxr-xr-x 2 root root 12288 Mar 2 2002 lost+found
drwxr-xr-x 2 root root 1024 Aug 29 2001 misc
drwxr-xr-x 4 root root 1024 Mar 2 2002 mnt
drwxr-xr-x 3 root root 1024 May 31 02:22 opt
dr-xr-xr-x 134 root root 0 Aug 6 08:46 proc
drwxr-x--- 17 root root 2048 Sep 20 09:48 root
drwxr-xr-x 2 root root 4096 Apr 5 12:08 sbin
drwxrwxrwt 7 root root 68608 Oct 1 13:17 tmp
drwxr-xr-x 16 root root 4096 Jul 9 15:34 usr
drwxr-xr-x 20 root root 1024 Jun 27 15:15 var

[usery@servername /]$ ls -la /home
total 129
drwxr-xr-x 30 root root 4096 Aug 26 11:18 .
drwxr-xr-x 19 root root 1024 Aug 6 08:47 ..
drwx------ 3
drwx------ 3
drwx------ 3
drwx------ 2
drwx------ 3
drwx------ 3
drwx------ 2
drwx------ 2
drwx------ 3
drwx------ 3
drwx------ 2
drwxr-xr-x 2 root root 16384 Mar 2 2002 lost+found
drwxrwxrwx 62 root Admin 4096 Oct 1 14:20 main
drwx------ 3
drwx------ 2
drwx------ 16
drwx------ 3
drwx------ 2
drwx------ 2
drwx------ 3
drwx------ 3
drwx------ 3
drwxr-xr-x 3
drwx------ 3
drwxrwxrwx 2
drwx------ 3
drwx------ 2
drwx------ 2
 
Old 10-01-2002, 02:46 PM   #8
Rob Ellsworth
LQ Newbie
 
Registered: Aug 2002
Posts: 18

Original Poster
Rep: Reputation: 0
After additional testing it appears to be any subdirectory of main that has the problem.
 
Old 10-01-2002, 02:47 PM   #9
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Ok, try this:

in the directory above OPERATE (main?),

chmod ug-s OPERATE
chmod ug+x OPERATE
chmod ug-s LC5.OLD
mv LC5.OLD LC5.BAK
 
Old 10-01-2002, 02:50 PM   #10
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Ooops,
I didn't wait long enough to reply, but I guess doing the above would still
be informative. Of course, I forgot to mention that you should do the
chmod as root and the mv as a user who's been having problems with mv.
 
Old 10-01-2002, 02:55 PM   #11
Rob Ellsworth
LQ Newbie
 
Registered: Aug 2002
Posts: 18

Original Poster
Rep: Reputation: 0
Moses,

The first two lines appear to have worked.
I will have to read the documentation to understand what I did and apply it to the rest of main.

Thank You Very Much
 
Old 10-01-2002, 03:05 PM   #12
Rob Ellsworth
LQ Newbie
 
Registered: Aug 2002
Posts: 18

Original Poster
Rep: Reputation: 0
Ooops! Spoke too soon.
Thanks for reminding me to test from a user other than root. I should have known better. It still is not working.
 
Old 10-01-2002, 03:12 PM   #13
Rob Ellsworth
LQ Newbie
 
Registered: Aug 2002
Posts: 18

Original Poster
Rep: Reputation: 0
Here is what it looked like. (The test file is now LC5.BAK because the move worked for root.)

[root@servername main]# chmod ug-s OPERATE
[root@servername main]# chmod ug+x OPERATE
[root@servername main]# cd OPERATE
[root@servername OPERATE]# chmod ug-s LC5.BAK

[usery@servername OPERATE]$ ls -l LC5.BAK
-rwxrwxrwt 1 userx Groupz 590 May 31 1995 LC5.BAK
[usery@servername OPERATE]$ mv LC5.BAK LC5.OLD
mv: cannot unlink `LC5.BAK': Operation not permitted
mv: cannot remove `LC5.BAK': Operation not permitted
 
Old 10-01-2002, 03:48 PM   #14
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Ok,

try changing the sticky bit in OPERATE

chmod -t OPERATE
chmod -t LC5.BAK
become a different user
mv LC5.BAK LC5.OLD
 
Old 10-01-2002, 03:54 PM   #15
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
That what I was going to suggest, remove the sticky bit - the purpose of sticky bit is to emphasize the ownership of the files on a filesystem, so with it in place only root or the owner of the file has perms to do whatever they should do, even having -rwxrwxrwt won't let others to write to the file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RM: Cannot Unlink margolik Linux - Software 0 04-17-2004 12:03 PM
perl unlink? sk8guitar Programming 11 08-13-2003 11:44 AM
cannot unlink messages TruckStuff Linux - General 5 02-13-2003 03:04 PM
cannot unlink cannot remove Rob Ellsworth Linux - General 1 10-01-2002 12:27 PM
cannot unlink simon Linux - General 1 07-31-2001 08:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration