Skip to contentSkip to conversation

Query - Regarding strange behaviour.

DISCUSSION Pankaj Agarwal 6 participants 12 messages Feb 3, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

In my system there's a strange behaviour.... its not allowing me to create any file in /usr/bin even as root. Its chmod is set to 755. Its even not allowing me to change the chmod value of /usr/bin. The strangest part which i felt is ...its shows the owner and group as root when i issue command "ls -ld /usr/bin" and not allowing root to create any file or directory under /usr/bin and not even allowing to change the chmod value. The error is access permission denied... I can change the chmod value of /usr and other directories under /usr/...but not of bin....

I need your help/support. kindly let me know what all can i try to resolve this problem.

Thanks and Regards,

Pankaj Agarwal

#1 lore raw

Try:

lsattr /usr/bin

Hope this helps,

Quoted 22 lines · Pankaj Agarwal

Hi,

In my system there's a strange behaviour.... its not allowing me to create any file in /usr/bin even as root. Its chmod is set to 755. Its even not allowing me to change the chmod value of /usr/bin. The strangest part which i felt is ...its shows the owner and group as root when i issue command "ls -ld /usr/bin" and not allowing root to create any file or directory under /usr/bin and not even allowing to change the chmod value. The error is access permission denied... I can change the chmod value of /usr and other directories under /usr/...but not of bin....

I need your help/support. kindly let me know what all can i try to resolve this problem.

Thanks and Regards,

Pankaj Agarwal

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Martijn van Oosterhout   <[email protected]>   http://svana.org/kleptog/
Quoted 3 lines

Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a tool for doing 5% of the work and then sitting around waiting for someone else to do the other 95% so you can sue them.

#2 lore raw
In reply to Pankaj Agarwal
Quoted 8 lines · Pankaj Agarwal

In my system there's a strange behaviour.... its not allowing me to create any file in /usr/bin even as root. Its chmod is set to 755. Its even not allowing me to change the chmod value of /usr/bin. The strangest part which i felt is ...its shows the owner and group as root when i issue command "ls -ld /usr/bin" and not allowing root to create any file or directory under /usr/bin and not even allowing to change the chmod value. The error is access permission denied... I can change the chmod value of /usr and other directories under /usr/...but not of bin....

Maybe /usr is mounted read-only?

#5 lore raw
In reply to Pankaj Agarwal
Quoted 9 lines · Pankaj Agarwal

Hi,

In my system there's a strange behaviour.... its not allowing me to create any file in /usr/bin even as root. Its chmod is set to 755. Its even not allowing me to change the chmod value of /usr/bin. The strangest part which i felt is ...its shows the owner and group as root when i issue command "ls -ld /usr/bin" and not allowing root to create any file or directory under /usr/bin and not even allowing to change the chmod value. The error is access permission denied... I can change the chmod value of /usr and other directories under /usr/...but not of bin....

I need your help/support. kindly let me know what all can i try to resolve this problem.

Thanks and Regards,

Pankaj Agarwal

See if your file-system has gotten hurt. Boot with init=/bin/bash and execute /sbin/fsck -f / to force a check of the root file-system.

The next check is to see if you can fix the protections when you are the only one accessing the file-system:

# mount -n -o remount /	# re-mount root r/w
# cd /usr
# chmod 755 bin
# ls -la		# See if it worked
# unmount /

The next check is to replace the /usr/bin directory. Since mv and mkdir are in /bin, the following should work.

# mount -n -o remount /  # re-mount root r/w
# cd /usr
# mv bin foo		# Rename 'strange' directory
# mkdir bin		# Make a new one
# cd foo		# Change to original
# mv * ../bin		# Rename all contents to new
# cd .. # rmdir foo		# Remove bad directory
# chmod 755 bin		# Fix protection
# umount /

After you have fixed things, you don't have to re-boot. Just execute:

# exec /sbin/init auto

Cheers,
Dick Johnson
Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.

#3 lore raw
In reply to Tim Schmielau

this isn't the case as i am able to create, edit and delete files in other directories under /usr.

----- Original Message ----- From: "Tim Schmielau" <[email protected]>
To: "Pankaj Agarwal" <[email protected]>
Cc: <[email protected]>; "Linux Net" <[email protected]>
Sent: Thursday, February 03, 2005 9:01 PM
Subject: Re: Query - Regarding strange behaviour.

Quoted 12 lines · Pankaj Agarwal
Quoted 9 lines

In my system there's a strange behaviour.... its not allowing me to create any file in /usr/bin even as root. Its chmod is set to 755. Its even not allowing me to change the chmod value of /usr/bin. The strangest part which i felt is ...its shows the owner and group as root when i issue command "ls -ld /usr/bin" and not allowing root to create any file or directory under /usr/bin and not even allowing to change the chmod value. The error is access permission denied... I can change the chmod value of /usr and other directories under /usr/...but not of bin....

Maybe /usr is mounted read-only?

#4 lore raw
In reply to Tim Schmielau
Quoted 11 lines · Tim Schmielau
Quoted 8 lines · Pankaj Agarwal

In my system there's a strange behaviour.... its not allowing me to create any file in /usr/bin even as root. Its chmod is set to 755. Its even not allowing me to change the chmod value of /usr/bin. The strangest part which i felt is ...its shows the owner and group as root when i issue command "ls -ld /usr/bin" and not allowing root to create any file or directory under /usr/bin and not even allowing to change the chmod value. The error is access permission denied... I can change the chmod value of /usr and other directories under /usr/...but not of bin....

Quoted 1 line

Maybe /usr is mounted read-only?

Hmmm, are distros still 'slicing up' the root file-system? Good point!

Cheers,
Dick Johnson
Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.

#6 lore raw
In reply to linux-os

its not even allowing me to copy it ...then surely it wont allow me mv as well... what else can i try...

[root@test root]# mount
/dev/hda2 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)

[root@test /]# cd /usr
[root@test usr]# cp bin testbin
cp: omitting directory `bin'
[root@test usr]# ls

bin   etc    include  kerberos  libexec  sbin   src   test121212  X11R6
dict  games  java     lib       local    share  test  tmp

[root@test usr]#

----- Original Message ----- From: "linux-os" <[email protected]>
To: "Pankaj Agarwal" <[email protected]>
Cc: <[email protected]>; "Linux Net" <[email protected]>
Sent: Thursday, February 03, 2005 9:05 PM
Subject: Re: Query - Regarding strange behaviour.

Quoted 48 lines · Pankaj Agarwal
Quoted 10 lines

Hi,

In my system there's a strange behaviour.... its not allowing me to create any file in /usr/bin even as root. Its chmod is set to 755. Its even not allowing me to change the chmod value of /usr/bin. The strangest part which i felt is ...its shows the owner and group as root when i issue command "ls -ld /usr/bin" and not allowing root to create any file or directory under /usr/bin and not even allowing to change the chmod value. The error is access permission denied... I can change the chmod value of /usr and other directories under /usr/...but not of bin....

I need your help/support. kindly let me know what all can i try to resolve this problem.

Thanks and Regards,

Pankaj Agarwal

See if your file-system has gotten hurt. Boot with init=/bin/bash and execute /sbin/fsck -f / to force a check of the root file-system.

The next check is to see if you can fix the protections when you are the only one accessing the file-system:

# mount -n -o remount / # re-mount root r/w
# cd /usr
# chmod 755 bin
# ls -la # See if it worked
# unmount /

The next check is to replace the /usr/bin directory. Since mv and mkdir are in /bin, the following should work.

# mount -n -o remount /  # re-mount root r/w
# cd /usr
# mv bin foo # Rename 'strange' directory
# mkdir bin # Make a new one
# cd foo # Change to original
# mv * ../bin # Rename all contents to new
# cd .. # rmdir foo # Remove bad directory
# chmod 755 bin # Fix protection
# umount /

After you have fixed things, you don't have to re-boot. Just execute:

# exec /sbin/init auto

Cheers,
Dick Johnson
Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.

#7 lore raw
Quoted 2 lines · Pankaj Agarwal

its not even allowing me to copy it ...then surely it wont allow me mv as well... what else can i try...

You didn't even bother to follow my carefully-written instructions!

**PLONK**

Since you seem to know everything, go to pound sand.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.

#8 lore raw
In reply to Pankaj Agarwal
Quoted 7 lines

its not even allowing me to copy it ...then surely it wont allow me mv as well... what else can i try...
[root@test root]# mount
/dev/hda2 on / type ext3 (rw)
[root@test /]# cd /usr
[root@test usr]# cp bin testbin
cp: omitting directory `bin'

"cp" does not normally copy direcrories as such by DEFAULT.

Use the "-R" flag on "cp" to make it 'recurse' and copy the whole
directory and directory/files under it.

e.g. "cp -R bin bincopy"

And, show us all the results of the following 2 commands, please.

ls -ld /usr/bin
lsattr -d /usr/bin

--S Iremonger <[email protected]>

#9 lore raw

my fault...i'm able to copy it using -rf with CP. So, solution given by Dick Johnson (Linux-OS) can be used, if all are unable to find what's the problem...

here's the output of the two commands you've asked for..

[root@test usr]# ls -ld /usr/bin
drwxr-xr-x 2 root root 61440 Nov 21 20:30 /usr/bin

[root@test usr]# lsattr -d /usr/bin
su--ia------- /usr/bin

----- Original Message ----- From: "S Iremonger" <[email protected]>
To: "Pankaj Agarwal" <[email protected]>
Cc: <[email protected]>; <[email protected]>; "Linux Net" <[email protected]>
Sent: Thursday, February 03, 2005 9:37 PM
Subject: Re: Query - Regarding strange behaviour.

Quoted 23 lines
Quoted 7 lines

its not even allowing me to copy it ...then surely it wont allow me mv as well... what else can i try...
[root@test root]# mount
/dev/hda2 on / type ext3 (rw)
[root@test /]# cd /usr
[root@test usr]# cp bin testbin
cp: omitting directory `bin'

"cp" does not normally copy direcrories as such by DEFAULT.

Use the "-R" flag on "cp" to make it 'recurse' and copy the whole
directory and directory/files under it.

e.g. "cp -R bin bincopy"

And, show us all the results of the following 2 commands, please.

ls -ld /usr/bin
lsattr -d /usr/bin

--S Iremonger <[email protected]>

#10 lore raw
Quoted 2 lines · Pankaj Agarwal

[root@test usr]# lsattr -d /usr/bin
su--ia------- /usr/bin

Well, there's your problem. These mean:

s: when deleted, its blocks are zeroed and written back to the disk
u: when deleted, its contents are saved.
i: cannot be modified: it cannot be deleted or renamed,
a: can only be open in append mode for writing

Remove those flags with chattr...

Hope this helps,

Quoted 38 lines

----- Original Message -----
From: "S Iremonger" <[email protected]>
To: "Pankaj Agarwal" <[email protected]>
Cc: <[email protected]>; <[email protected]>; "Linux Net" <[email protected]>
Sent: Thursday, February 03, 2005 9:37 PM
Subject: Re: Query - Regarding strange behaviour.

Quoted 16 lines
Quoted 7 lines

its not even allowing me to copy it ...then surely it wont allow me mv as well... what else can i try...
[root@test root]# mount
/dev/hda2 on / type ext3 (rw)
[root@test /]# cd /usr
[root@test usr]# cp bin testbin
cp: omitting directory `bin'

"cp" does not normally copy direcrories as such by DEFAULT.

Use the "-R" flag on "cp" to make it 'recurse' and copy the whole directory and directory/files under it.

e.g. "cp -R bin bincopy"

Quoted 7 lines

And, show us all the results of the following 2 commands, please.

ls -ld /usr/bin
lsattr -d /usr/bin

--S Iremonger <[email protected]>

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Martijn van Oosterhout   <[email protected]>   http://svana.org/kleptog/
Quoted 3 lines

Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a tool for doing 5% of the work and then sitting around waiting for someone else to do the other 95% so you can sue them.

#11 lore raw
In reply to Pankaj Agarwal

On Thu, 3 Feb 2005 21:48:12 +0530
"Pankaj Agarwal" <[email protected]> bubbled:

Quoted 11 lines

my fault...i'm able to copy it using -rf with CP. So, solution given by Dick Johnson (Linux-OS) can be used, if all are unable to find what's the problem...

here's the output of the two commands you've asked for..

[root@test usr]# ls -ld /usr/bin
drwxr-xr-x 2 root root 61440 Nov 21 20:30 /usr/bin

[root@test usr]# lsattr -d /usr/bin
su--ia------- /usr/bin

i = IMMUTABLE, so you are unable to modify it.
a = only append mode for writing
u = allow undelete
s = zero the file if deleted

but s and u should currently not work on ext2/3.

Try "chattr -iusa /usr/bin" as root.

Signature · 7 lines
MyExcuse:
bad ether in the cables

Martin Zwickel <[email protected]>
Research & Development

TechnoTrend AG <http://www.technotrend.de>