Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Somehow part of my ext3 file system got corrupted and large portions of my python installation got all sorts of messed up. The only thing I could notice immediately was Python raising a missing module error. If I tried to cd to the relevant directories I got this:

EXT3-fs error (device mmcblk0p2): htree_dirblock_to_tree: bad entry in directory #444159: directory entry across blocks - offset=0, inode=166100, rec_len=59284, name_len=255
EXT3-fs error (device mmcblk0p2): htree_dirblock_to_tree: bad entry in directory #444137: rec_len % 4 != 0 - offset=0, inode=290535, rec_len=39605, name_len=253

So I decided to just rm -rf those directories and reinstall NumPy. Not so fast:

root@napajohn:/usr/lib/pyshared/python2.6/numpy-1.6.0# python setup.py
Running from numpy source directory.Traceback (most recent call last):
  File "setup.py", line 196, in <module>
    setup_package()
  File "setup.py", line 173, in setup_package
    from numpy.distutils.core import setup
  File "/usr/lib/pyshared/python2.6/numpy-1.6.0/numpy/distutils/__init__.py", line 7, in <module>
    import ccompiler
  File "/usr/lib/pyshared/python2.6/numpy-1.6.0/numpy/distutils/ccompiler.py", line 7, in <module>
    from distutils.ccompiler import *
  File "/usr/lib/python2.6/distutils/__init__.py", line 1
    d__2);
        ^
SyntaxError: invalid syntax

What that error said was true. The file /usr/lib/python2.6/distutils/__init__.py started mid-expression, as if the top half of the file got chopped off.

So I go and check to see if I have any other versions of Python installed with pyversions -i:

  File "/usr/lib/python2.6/ConfigParser.py", line 1
    .i,
    ^
SyntaxError: invalid syntax

What is happening to all my files? I realize this question could hardly be answered without extra information, but before I go that route let me switch contexts to my first alternative solution which naively assumes that nothing else besides python has been affected.

First, a question: where is the "proper" place to install additional software, or more specifically, Python? I've been choosing /opt for most of my unzipping & installing of things I don't download through apt.

Next, the problem:

root@napajohn:/opt/python/Python-2.7.3# ./configure
checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... linux2
checking EXTRAPLATDIR...
checking machine type as reported by uname -m... armv7l
checking for --without-gcc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/opt/python/Python-2.7.3':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

I don't have gcc?? Okay, whatever, I'll go install it. I run an update and then

root@napajohn:/opt/python/Python-2.7.3# apt-get install gcc-4.4
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gcc-4.4 : Depends: gcc-4.4-base (= 4.4.5-8) but 4.4.5-8em1 is to be installed
           Depends: cpp-4.4 (= 4.4.5-8) but 4.4.5-8em1 is to be installed
           Recommends: libc6-dev (>= 2.5) but it is not going to be installed
E: Broken packages

But I have gcc-4.4-base and cpp-4.4!

root@napajohn:/opt/python/Python-2.7.3# apt-get install gcc-4.4-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc-4.4-base is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
root@napajohn:/opt/python/Python-2.7.3# apt-get install cpp-4.4
Reading package lists... Done
Building dependency tree
Reading state information... Done
cpp-4.4 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

After doing some searching, I think this could potentially be caused by a release mismatch (terminology?).

I'm not really sure where to go from here. Also there is the bigger question of whether the file problems are isolated to Python. Should I run an fsck disk check on the rootfs? How would I do this on an embedded device?

root@napajohn:/opt/python/Python-2.7.3# cat /etc/debian_version
6.0.4
root@napajohn:/opt/python/Python-2.7.3# df
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   250876         0    250876   0% /lib/init/rw
udev                     10240       156     10084   2% /dev
tmpfs                   250876         0    250876   0% /dev/shm
rootfs                 7597856   1722208   5489688  24% /
share|improve this question
    
You should really, really stop trying to write to that filesystem, and FSCK it ASAP. If you have important stuff in there, I'd consider trying to back it up from a LiveCD or something like that (mount it read only). –  Mat May 7 '12 at 15:42
    
Okay. I don't have a cd drive. The fs is on a microSD card for which I currently don't have a separate reader. The board does have connections for USB, ethernet, and serial port though. –  John E May 7 '12 at 15:56
    
There isn't really anything on there that would be gone forever if lost. If I wanted to skip the backing up step, how would I go about fsck on / (root)? –  John E May 7 '12 at 16:04
    
What distro is that? Doesn't rebooting do it automatically? –  Mat May 7 '12 at 16:16
    
Debian 6.0.4. And no it does not seem to run at bootup. I have restarted 5 or 6 times during the process and get no prompts or see anything else different from the usual. –  John E May 7 '12 at 16:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.