PDA

Bekijk de volledige versie : not a regular file



aniecki
30-10-2009, 18:51
Firmware 1.9.2.7-d-r655

For some reason - just recently - when trying to vi any file I am getting the "not a regular file" error and no file content is being displayed. Using the cat command displays the file ok. I suspect there is a problem with mounting, df command displays:

[admin@ASS root]$ df
Filesystem Size Used Avail Use% Mounted on
rootfs 2.9M 2.9M 0 100% /
/dev/root 2.9M 2.9M 0 100% /
tmpfs 15M 208K 15M 2% /tmp
/dev/discs/disc0/part2
966M 101M 816M 11% /opt
/dev/discs/disc0/part3
228G 41G 176G 19% /tmp/mnt/disc0_3
[admin@ASS root]$

Can anybody help to resolve it? Thanks Adam

lly
31-10-2009, 07:40
You have to provide output of command
ls -al /whereis_your_file/your_file_name

To check vi itself, simply try to edit /etc/profile. Maybe you use not built-in vi or has wrong mix of libraries

aniecki
31-10-2009, 19:34
The file permission is ok - at least that the way it seems.

this is ls -al

[admin@ASS root]$ ls -al mama
-rw-r--r-- 1 admin root 24 Oct 31 19:56 mama
[admin@ASS root]$

[admin@ASS root]$ cat mama
aaaaaaaa
bbbbbbb
cccccc
[admin@ASS root]$

yet I cannot change the file - using vi gets "not a regular file".

And this is not the only problem I got

[admin@ASS root]$ man ls
sh: nroff: Permission denied
(END)

Something is wrong here but what and how to fix it?

Thanks Adam

lly
31-10-2009, 19:38
Something is wrong here but what and how to fix it?
unmount /opt & repeat. If it helps - there is intersection with some libraries. Try to seek forum.

al37919
01-11-2009, 08:12
there is a tool called ldd which shows against which libraries you binary is linked. It is in the package buildroot. Either install it or download and get only ldd out (ipk can be just gunzipped).

aniecki
01-11-2009, 16:47
Upgrade to a new firmware: 1.9.2.7-d-r740 - unfortunately did not help.

[admin@ASS root]$ man ls
sh: nroff: Permission denied
(END)

sorry guys - I am not with you. What I suppose to do then?

unmount /opt & repeat - but repeating what? Installing ldd and finding what. I have a rather simple installation - not much change if not exactly the same as one published here on the forum as a tutorial for wl-500gp v2.

It was ok for some time - just recently went weird with this file system on usb Toshiba 250GB drive. All networking features seems to be allright, though.
Why do I have such a problem or what is even more important how to fix it?

[admin@ASS root]$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 3.0M 3.0M 0 100% /
/dev/root 3.0M 3.0M 0 100% /
tmpfs 15M 216K 15M 2% /tmp
/dev/discs/disc0/part2
966M 101M 816M 11% /opt
/dev/discs/disc0/part3
228G 41G 176G 19% /tmp/mnt/disc0_3
[admin@ASS root]$

Is this filesystem ok as above? Please advise further. Tnx!

Cheers,
Adam

lly
01-11-2009, 16:58
Problem in additional software you installed. Sorry, i haven't time to explain basic unix knowledge step-by-step. Maybe someone else do this for you.

al37919
01-11-2009, 17:04
Installing ldd and finding what.
all the libraries against which the binary was built should be on the place

May be you have some important library corrupted due to disk or file-system failure, then you have to reinstall it.

An arbitrary guess --- reinstall uclibc-opt first

newbiefan
01-11-2009, 19:59
I had a similar problem some time ago. The reason was: I had installed bash.
When calling bash just one time, you get similar errors.
How to fix the problem:
Delete the file /opt/etc/profile and
reinstall profile according wengis howto.

Hope it helps.

aniecki
02-11-2009, 11:41
....
Hope it helps.

Yes it did! You saved me a lot of time. Spot right!

Yes, I had had bush shell installed and suprise, suprise - deleting file /opt/etc/profile and rebooting the router did the trick. Don't know why it (profile) was wrong as it seemed to be more or less ok. But anyhow. After rebooting vi started working so I could restore a new profile according to a guide.


Thank you for your kind help - otherwise I will be going mad trying to figure out what was wrong here. Now only hoping it won't manifest again!

Cheers,
Adam

newbiefan
02-11-2009, 14:00
Glad to hear your system works.....
For bash, please read: http://www.wl500g.info/showthread.php?t=21776

have fun