2005-02-03 15:00:17

by Pankaj Agarwal

[permalink] [raw]
Subject: Query - Regarding strange behaviour.

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


2005-02-03 15:17:15

by Martijn van Oosterhout

[permalink] [raw]
Subject: Re: Query - Regarding strange behaviour.

Try:

lsattr /usr/bin

Hope this helps,

On Thu, Feb 03, 2005 at 08:15:39PM +0530, Pankaj Agarwal wrote:
> 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

--
Martijn van Oosterhout <[email protected]> http://svana.org/kleptog/
> 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.


Attachments:
(No filename) (1.29 kB)
(No filename) (232.00 B)
Download all attachments

2005-02-03 15:36:39

by linux-os (Dick Johnson)

[permalink] [raw]
Subject: Re: Query - Regarding strange behaviour.

On Thu, 3 Feb 2005, Pankaj Agarwal wrote:

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

2005-02-03 15:34:40

by Tim Schmielau

[permalink] [raw]
Subject: Re: Query - Regarding strange behaviour.

On Thu, 3 Feb 2005, Pankaj Agarwal wrote:

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

2005-02-03 15:39:28

by Pankaj Agarwal

[permalink] [raw]
Subject: Re: Query - Regarding strange behaviour.

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.


> On Thu, 3 Feb 2005, Pankaj Agarwal wrote:
>
>> 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?

2005-02-03 15:45:25

by linux-os (Dick Johnson)

[permalink] [raw]
Subject: Re: Query - Regarding strange behaviour.

On Thu, 3 Feb 2005, Tim Schmielau wrote:

> On Thu, 3 Feb 2005, Pankaj Agarwal wrote:
>
>> 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?

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.

2005-02-03 15:51:11

by Pankaj Agarwal

[permalink] [raw]
Subject: Re: Query - Regarding strange behaviour.

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.


> On Thu, 3 Feb 2005, Pankaj Agarwal wrote:
>
>> 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.

2005-02-03 15:59:56

by linux-os (Dick Johnson)

[permalink] [raw]
Subject: Re: Query - Regarding strange behaviour.

On Thu, 3 Feb 2005, Pankaj Agarwal wrote:

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

2005-02-03 16:13:42

by S Iremonger

[permalink] [raw]
Subject: Re: Query - Regarding strange behaviour.

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

2005-02-03 16:18:59

by Pankaj Agarwal

[permalink] [raw]
Subject: Re: Query - Regarding strange behaviour.

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.


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

2005-02-03 16:32:06

by Martijn van Oosterhout

[permalink] [raw]
Subject: Re: Query - Regarding strange behaviour.

On Thu, Feb 03, 2005 at 09:48:12PM +0530, Pankaj Agarwal wrote:
> [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,

>
> ----- 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.
>
>
> >>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]>
> >
>
> -
> 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

--
Martijn van Oosterhout <[email protected]> http://svana.org/kleptog/
> 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.


Attachments:
(No filename) (1.85 kB)
(No filename) (232.00 B)
Download all attachments

2005-02-03 16:34:09

by Martin Zwickel

[permalink] [raw]
Subject: Re: Query - Regarding strange behaviour.

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

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

--
MyExcuse:
bad ether in the cables

Martin Zwickel <[email protected]>
Research & Development

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


Attachments:
(No filename) (189.00 B)