LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 03-18-2003, 09:09 AM   #1
canon
Member
 
Registered: Feb 2003
Location: Seattle & N.Ireland
Distribution: Suse 9.current
Posts: 40

Rep: Reputation: 15
Exclamation define file as a directory?


yesterday i screwed up. i somehow turned the /etc/lib/kernel-2.4... folder that contains the modules config file into an undetermined file type. so now instead of mandrake finding the necessary files to boot appropriately, it doesn't... i need to re-define the kernel-2.4... file as a folder - please tell me someone knows how to do this.
the file responds appropriately to the chmod and chown commands, as i can boot off the install disk to a working console, but i don't know the command to re-define a file as a directory.
how screwed am i?

Mandrake 9.0
2.4.19-16mdk

i'm posting this using an old redhat installation on a spare 2G drive - always keep an extra everything!
 
Old 03-18-2003, 09:30 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
How exactly did you screw it up? What is the output of 'ls -ld dir_name'?
 
Old 03-18-2003, 10:05 AM   #3
canon
Member
 
Registered: Feb 2003
Location: Seattle & N.Ireland
Distribution: Suse 9.current
Posts: 40

Original Poster
Rep: Reputation: 15
last-good info and ls output

correction:
the bad folder is /lib/modules/2.4.19-16mdk

the last program run was fsck

the last good boot asked me to "press 'y' within 5 seconds to check disk integrity" which i did, and it found inconsistencies on /dev/hda5 (mounted as /) which it corrected, but said that i should run fsck manually, ie. without the -p or -n tags (tags may have been differet, this is from memory as i cannot now re-create it)

ran fsck and it declared no errors, rebooted to see if it would prompt for disk integrity check again, and several (8 or 9) errors about "cannot open /lib/modules/2.4.19-16mdk/file_name: not a directory" appeared, X wouldn't start, and several commands (incl. vi) invoked a "kernel does not support that command" errors. rebooted again to watch more carefully and i think the /lib/modules/2.4.19-16mdk/ folder is what the boot looks to for several kernel-related startup procedures.

booted off of install cd to a console, and got this from an ls -ld 2.4.19-16mdk command from within /lib/modules:
?--------- 512 512 512 1409290240 Jan 24 1971 2.4.19-16mdk

used chown and chmod successfully to make the ls output:
?rwxr-xr-x 512 root root 1409290240 Jan 24 1971 2.4.19-16mdk

searched man for re-defining a file type as a directory w/ no joy.
 
Old 03-19-2003, 09:59 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
I don't think you can redefine a file type just like that. And the chmod command won't help much since it seems to be an invalid entry. The date is all screwed up unless you are living a few years back. And the size of the file is supposed to be 1.3gig. Now either it's a dump of all the blocks used in the directory into one file (I doubt you have that many modules), or it's just an invalid entry. I think you'd be better off reinstalling then trying to restore from there. Have you rebuilt your kernel yourself? Otherwise you should be able to reinstall the kernel modules from the original cd. I assume they would put them in an rpm.
 
Old 03-19-2003, 02:22 PM   #5
canon
Member
 
Registered: Feb 2003
Location: Seattle & N.Ireland
Distribution: Suse 9.current
Posts: 40

Original Poster
Rep: Reputation: 15
i installed another copy of mdk9 on a second hard drive, then copied the appropriate files from the new install over the corrupted ones, and yes, i did reinstall the kernel off of the RPM on the install cd.
it works again!
thanks for your ideas Mik!
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
libtermcap.so.2: cannot open shared object file: No such file or directory tcma Linux - Software 11 02-24-2012 03:00 AM
awk: fatal:cannot open file for reading (no such file or Directory) in Linux sangati vishwanath Linux - Software 4 07-06-2005 12:59 AM
php projects: define each class in a seperate file? ldp Programming 4 09-16-2004 05:00 PM
libawt.so: libXp.so.6: cannot open shared object file: No such file or directory man26 *BSD 0 09-10-2004 08:34 AM
how to define variables in the c file of kernel riquelme Programming 2 05-16-2004 07:42 PM

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

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