LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-23-2013, 08:55 AM   #1
notsure
Member
 
Registered: Jun 2012
Location: Detroit
Distribution: Arch x86_64
Posts: 112

Rep: Reputation: 10
Cannot chown files as root


Arch x86_64, 3.9.x

I'm unable to update python because there are files in /usr/lib/python3.3/test/*

I am unable to delete the files and I'm unable to chown them.

Code:
[root@corp test]# chown: changing ownership of '__pycache__/test_lib2to3.cpython
chown: changing ownership of '__pycache__/test_lib2to3.cpython-33.pyo': Operation not permitted
I had the lovely idea of mirroring two flash drive for this server (router). Not the best experience... I've had them crash and I've had to do 15 minutes of fsck to fix. Forgetting to move the log files played a part in that.

Anyways, how the heck can I delete these files? I'll end up restoring from backup tonight if no one comes up with any bright ideas.


BTW, the server is functional (on second thought, functional might be the wrong word). The only issue I see is that python won't install/update and I can't create my vlans with vconfig:

Code:
[root@corp test]# vconfig
-bash: /usr/bin/vconfig: No such file or directory
Code:
[root@corp test]# ll /usr/bin/vconfig
-rwxr-xr-x 1 root root 8.1K May 22 21:53 /usr/bin/vconfig

fsck checks out OK.
badblocks as well.


**edit:

Here are the files in question:
Code:
[root@corp __pycache__]# pwd; ll
/usr/lib/python3.3/test/__pycache__
total 96K
drwx------ 2 root   root      40K May 21 20:33 .
drwxr-xr-x 4 root   root      20K May 21 16:44 ..
-rwxr--r-- 1 196608 adm      257G Dec 22 15:11 test_lib2to3.cpython-33.pyo
-rw-r----- 1     16 71303170  48K Dec 22 15:11 test_poll.cpython-33.pyo
LOL, I just noticed it reports 257GiB... ???

Last edited by notsure; 05-23-2013 at 09:25 AM.
 
Old 05-23-2013, 11:53 AM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
show the output of: /proc/self/mountinfo
and make vconfig executable as well
 
Old 05-23-2013, 12:19 PM   #3
notsure
Member
 
Registered: Jun 2012
Location: Detroit
Distribution: Arch x86_64
Posts: 112

Original Poster
Rep: Reputation: 10
vconfig is executable


Code:
[root@corp ~]# cat /proc/self/mountinfo
15 19 0:3 / /proc rw,nosuid,nodev,noexec,relatime shared:5 - proc proc rw
16 19 0:14 / /sys rw,nosuid,nodev,noexec,relatime shared:6 - sysfs sys rw
17 19 0:5 / /dev rw,nosuid,relatime shared:2 - devtmpfs dev rw,size=1015476k,nr_inodes=253869,mode=755
18 19 0:15 / /run rw,nosuid,nodev,relatime shared:11 - tmpfs run rw,mode=755
19 1 9:126 / / rw,noatime,nodiratime shared:1 - ext2 /dev/md126 rw
20 16 0:16 / /sys/kernel/security rw,nosuid,nodev,noexec,relatime shared:7 - securityfs securityfs rw
21 17 0:17 / /dev/shm rw,nosuid,nodev shared:3 - tmpfs tmpfs rw
22 17 0:10 / /dev/pts rw,nosuid,noexec,relatime shared:4 - devpts devpts rw,gid=5,mode=620,ptmxmode=000
23 16 0:18 / /sys/fs/cgroup rw,nosuid,nodev,noexec shared:8 - tmpfs tmpfs rw,mode=755
24 23 0:19 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime shared:9 - cgroup cgroup rw,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd
25 16 0:20 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:10 - pstore pstore rw
26 23 0:21 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:12 - cgroup cgroup rw,cpuset
27 23 0:22 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:13 - cgroup cgroup rw,cpuacct,cpu
28 23 0:23 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:14 - cgroup cgroup rw,memory
29 23 0:24 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime shared:15 - cgroup cgroup rw,devices
30 23 0:25 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime shared:16 - cgroup cgroup rw,freezer
31 23 0:26 / /sys/fs/cgroup/net_cls rw,nosuid,nodev,noexec,relatime shared:17 - cgroup cgroup rw,net_cls
32 23 0:27 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime shared:18 - cgroup cgroup rw,blkio
33 15 0:28 / /proc/sys/fs/binfmt_misc rw,relatime shared:19 - autofs systemd-1 rw,fd=33,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
34 17 0:12 / /dev/mqueue rw,relatime shared:20 - mqueue mqueue rw
35 17 0:29 / /dev/hugepages rw,relatime shared:21 - hugetlbfs hugetlbfs rw
36 19 0:30 / /tmp rw shared:22 - tmpfs tmpfs rw
37 16 0:7 / /sys/kernel/debug rw,relatime shared:23 - debugfs debugfs rw
38 16 0:13 / /sys/kernel/config rw,relatime shared:24 - configfs configfs rw
39 19 9:127 / /boot rw,noatime,nodiratime shared:25 - ext3 /dev/md127 rw,data=ordered
70 15 0:31 / /proc/fs/nfsd rw,relatime shared:53 - nfsd nfsd rw
72 33 0:32 / /proc/sys/fs/binfmt_misc rw,relatime shared:55 - binfmt_misc binfmt_misc rw
 
Old 05-23-2013, 01:24 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by notsure View Post
Code:
[root@corp test]# vconfig
-bash: /usr/bin/vconfig: No such file or directory
Code:
[root@corp test]# ll /usr/bin/vconfig
-rwxr-xr-x 1 root root 8.1K May 22 21:53 /usr/bin/vconfig
Behavior like this usually occurs when you install 32 bit software on a 64 bit system without multilib enabled. May this be the case here? You can check that with
Code:
file /usr/bin/vconfig
 
Old 05-23-2013, 05:50 PM   #5
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
For the two strange files, try changing the owner and group to "root" and then see if you can run your update. (From the owner and group values displayed, and the strange size, I'd suspect that the directory file was damaged.)
 
Old 05-23-2013, 06:48 PM   #6
notsure
Member
 
Registered: Jun 2012
Location: Detroit
Distribution: Arch x86_64
Posts: 112

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by TobiSGD View Post
Behavior like this usually occurs when you install 32 bit software on a 64 bit system without multilib enabled. May this be the case here? You can check that with
Code:
file /usr/bin/vconfig
I never enabled multilib on that server. This doesn't make much sense to me:

Code:
[root@corp test]# file /usr/bin/vconfig 
/usr/bin/vconfig: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped

Quote:
Originally Posted by PTrenholme
For the two strange files, try changing the owner and group to "root" and then see if you can run your update. (From the owner and group values displayed, and the strange size, I'd suspect that the directory file was damaged.)

Code:
[root@corp test]# find /usr/lib/python3.3/ | xargs ls -lahtr
-r--r--r-- 1  262144 1140850688  20K Dec 22 15:11 /usr/lib/python3.3/test/decimaltestdata/dqDivideInt.decTest
-rwxr--r-- 1  196608 adm        257G Dec 22 15:11 /usr/lib/python3.3/test/__pycache__/test_lib2to3.cpython-33.pyo
-rw-r----- 1      16   71303170  48K Dec 22 15:11 /usr/lib/python3.3/test/__pycache__/test_poll.cpython-33.pyo

/usr/lib/python3.3/test/decimaltestdata/quantize.decTest:
total 8.0K
drw-r--r-- 2 8388608 65537 4.0K Dec 22 15:11 .
drwx------ 3 root    root  4.0K May 21 20:05 ..

/usr/lib/python3.3/:
total 96K
drwxr-xr-x   3 root root 4.0K May 21 16:44 .
drwxr-xr-x 111 root root  68K May 23 11:00 ..
drwxr-xr-x   4 root root  20K May 23 19:36 test

/usr/lib/python3.3/test/decimaltestdata:
total 36K
-r--r--r-- 1  262144 1140850688  20K Dec 22 15:11 dqDivideInt.decTest
drw-r--r-- 2 8388608      65537 4.0K Dec 22 15:11 quantize.decTest
drwx------ 3 root    root       4.0K May 21 20:05 .
drwxr-xr-x 4 root    root        20K May 23 19:36 ..

/usr/lib/python3.3/test/__pycache__:
total 96K
-rwxr--r-- 1 196608 adm      257G Dec 22 15:11 test_lib2to3.cpython-33.pyo
-rw-r----- 1     16 71303170  48K Dec 22 15:11 test_poll.cpython-33.pyo
drwx------ 2 root   root      40K May 21 20:33 .
drwxr-xr-x 4 root   root      20K May 23 19:36 ..

/usr/lib/python3.3/test:
total 68K
drwxr-xr-x 3 root root 4.0K May 21 16:44 ..
drwx------ 3 root root 4.0K May 21 20:05 decimaltestdata
drwx------ 2 root root  40K May 21 20:33 __pycache__
drwxr-xr-x 4 root root  20K May 23 19:36 .
Code:
[root@corp decimaltestdata]# chown root dqDivideInt.decTest ; chgrp root dqDivideInt.decTest 
chown: changing ownership of 'dqDivideInt.decTest': Operation not permitted
chgrp: changing group of 'dqDivideInt.decTest': Operation not permitted
Code:
[root@corp __pycache__]# chown root test_lib2to3.cpython-33.pyo ; chgrp root test_lib2to3.cpython-33.pyo 
chown: changing ownership of 'test_lib2to3.cpython-33.pyo': Operation not permitted
chgrp: changing group of 'test_lib2to3.cpython-33.pyo': Operation not permitted
 
Old 05-23-2013, 07:22 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by notsure View Post
I never enabled multilib on that server. This doesn't make much sense to me:

Code:
[root@corp test]# file /usr/bin/vconfig 
/usr/bin/vconfig: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped
Then something got seriously wrong on that system, the file output clearly shows that you have a 32 bit executable of vconfig installed, but you stated that this is a 64 bit installation of Arch.
 
Old 05-23-2013, 08:12 PM   #8
notsure
Member
 
Registered: Jun 2012
Location: Detroit
Distribution: Arch x86_64
Posts: 112

Original Poster
Rep: Reputation: 10
Ya, the system is probably screwed. However, this is on my workstation:

Code:
[root@workstation ~]# uname -a
Linux workstation 3.9.3-1-ARCH #1 SMP PREEMPT Sun May 19 22:50:29 CEST 2013 x86_64 GNU/Linux
[root@workstation ~]# file /usr/bin/vconfig 
/usr/bin/vconfig: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped
[root@workstation ~]# vconfig
Expecting argc to be 3-5, inclusive.  Was: 1

Usage: add             [interface-name] [vlan_id]
       rem             [vlan-name]
       set_flag        [interface-name] [flag-num]       [0 | 1]
       set_egress_map  [vlan-name]      [skb_priority]   [vlan_qos]
       set_ingress_map [vlan-name]      [skb_priority]   [vlan_qos]
       set_name_type   [name-type]

* The [interface-name] is the name of the ethernet card that hosts
  the VLAN you are talking about.
* The vlan_id is the identifier (0-4095) of the VLAN you are operating on.
* skb_priority is the priority in the socket buffer (sk_buff).
* vlan_qos is the 3 bit priority in the VLAN header
* name-type:  VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5),
              DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5)
* bind-type:  PER_DEVICE  # Allows vlan 5 on eth0 and eth1 to be unique.
              PER_KERNEL  # Forces vlan 5 to be unique across all devices.
* FLAGS:  1 REORDER_HDR  When this is set, the VLAN device will move the
            ethernet header around to make it look exactly like a real
            ethernet device.  This may help programs such as DHCPd which
            read the raw ethernet packet and make assumptions about the
            location of bytes.  If you don't need it, don't turn it on, because
            there will be at least a small performance degradation.  Default
            is OFF.
 
Old 05-23-2013, 08:31 PM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
If it works on that machine that you must have a multilib setup there.
 
Old 05-24-2013, 01:34 AM   #10
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
I hope you checked extended attributes, right? Then it seems to be a good example of ext2 bad practices; the only possibility I can imagine is to hack inodes manually
 
Old 05-24-2013, 08:59 AM   #11
notsure
Member
 
Registered: Jun 2012
Location: Detroit
Distribution: Arch x86_64
Posts: 112

Original Poster
Rep: Reputation: 10
I belive these are separate issues.
The vconfig doesn't make any sense. It works on some systems and not on others. I thought it was because the 8021q module wasn't loaded - but that didn't make any difference. FML

As for the files that need to be deleted:

Code:
[root@corp __pycache__]# find . -inum 9732 -exec rm -i {} \;
rm: remove regular file './test_lib2to3.cpython-33.pyo'? y
rm: cannot remove './test_lib2to3.cpython-33.pyo': Operation not permitted
I'll be getting a HDD for this router. I should also ditch Arch... not ideal for servers IMO.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
received chown: invalid root:root said76 Linux - Server 1 05-02-2013 09:10 AM
[SOLVED] I did chown -R root:root /usr - did I screw it up? Lennie Slackware 13 11-08-2012 08:34 AM
All files/Directories owned by root (unable to change with "chown") KinnowGrower Linux - Desktop 8 10-22-2008 10:18 AM
chown and/or chmod to restore permissions on files moved from another drive by root. Shay Linux - General 4 04-12-2007 08:47 AM
chmod vs chown on some root files and yes apps ergo_sum Linux - Newbie 3 11-12-2003 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:03 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