LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Strange problem: can not delete file as root ?? (https://www.linuxquestions.org/questions/linux-general-1/strange-problem-can-not-delete-file-as-root-238338/)

hendrixx 10-03-2004 04:34 PM

Strange problem: can not delete file as root ??
 
Hi,

I have a very strange problem.
I have phpMyAdmin 2.5.7-pl1 installed on my SuSE 9.1 system and 2
file seem to be damaged (config.inc.php and config.default)
The strange part is that i can not delete those file or read them.
I even get a error message when i use a ls command in the folder !
In MC (midnight commander) i see them in red like this :

?config.inc.php
?config.default

and they are both dated Jan 1 1970 and their size are 0.

Does any one have any idea how i can remove these files from my system ?

Thanks
Jimmy.....

serz 10-03-2004 06:51 PM

Try:

rm "?config.inc.php" "?config.default"

hendrixx 10-04-2004 06:09 AM

Hi serz,

I tried your suggestion and i get the following error message :

Code:

rm: cannot lstat `?config.inc.php': Onbekend bestand of map
I have a Dutch SuSE 9.1 so "Onbekend bestand of map" means : File or directory unknown

I also tried [b]rm "config.inc.php"[\b] and then i get the following error message :

Code:

rm: cannot lstat `config.inc.php': Toegang geweigerd
("Toegang geweigerd" means : Acces denied)


Do you have any idea's what this could be ?

Thanks
Jimmy...

serz 10-04-2004 08:15 AM

You're getting an Access Denied error.. are you doing that as root?

hendrixx 10-05-2004 02:04 PM

Yes, i am logged in as Root.
I also tried to login as normal user and then as "su" user.
All with the same result ....

Very strange.

JZL240I-U 10-06-2004 02:10 AM

Try
Code:


rm -f filename
rm -d filename

man rm

If that doesn't help run fsck on the relevant partition and post what that says.

amfoster 10-06-2004 07:31 AM

type lsattr and see if there are any extra attributes on the file. If so, use chattr -i or whatever the attribute is.

It may not be your problem, but it is a start.

Thymox 10-06-2004 07:39 AM

I have found that there are a number of files that cannot be deleted from the command line - or at least they can't be deleted with any easy method from the command line. I have mainly had problems with files begining with a hyphen (-), although I can quite see that files beginning with either a ? or a * would also cause problems since they have special meaning.

The most reliable method I have found is to open a graphical file manager (if you can) such as Konqueror (my choice) and remove it or rename it from there.

Hope this helps.

amfoster 10-06-2004 07:47 AM

ok then do either
rm \?config......etc

the \ will tell the system to take the next char literally for what is typed. Else it thinks the ? mark stands for any single charactor

The other way is with rm -- before the file name.

hendrixx 10-06-2004 12:21 PM

Hi all,

Quote:

If that doesn't help run fsck on the relevant partition and post what that says. [/B]
It didn't work so i runned the fsck command and get the following message :

Code:

fsck 1.34 (25-Jul-2003)
reiserfsck 3.6.13 (2003 www.namesys.com)

*************************************************************
** If you are using the latest reiserfsprogs and  it fails **
** please  email bug reports to reiserfs-list@namesys.com, **
** providing  as  much  information  as  possible --  your **
** hardware,  kernel,  patches,  settings,  all reiserfsck **
** messages  (including version),  the reiserfsck logfile, **
** check  the  syslog file  for  any  related information. **
** If you would like advice on using this program, support **
** is available  for $25 at  www.namesys.com/support.html. **
*************************************************************

Will read-only check consistency of the filesystem on /dev/hda6
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
###########
reiserfsck --check started at Wed Oct  6 19:07:04 2004
###########
Partition /dev/hda6 is mounted with write permissions, cannot check it
fsck.reiserfs /dev/hda6 failed (status 0x10). Run manually!

I also tried the lsattr command and got the following output :
Code:

./config.inc.php: Toegang geweigerd
./config.default: Toegang geweigerd

Then i tried to run KDE (as root) and tried to delete the files with the file manager.
But i can't even SEE the files anymore !

This is starting to drive me crazy !

Any suggestions are welcome !
Thanks for you patience so far ...

Jimmy....

JZL240I-U 10-07-2004 02:59 AM

Argh ;). Forgot that, sorry. Two ways to circumnavigate this:

1. If your /dev/hda6 doesn't contain system ressources just umount it and run fsck.

2. Get a live / rescue CD and start from there, they should leave your harddisks alone and if not you can then umount /dev/hda6.

See you :).

hendrixx 10-09-2004 03:16 PM

Hi,

i tried to umount my /dev/hda6 but i get the following error mesage :

Code:

umount: /: device is busy
umount: /: device is busy

Any idea's what might be the problem ?
I am using my Linux as a router/firewall and have Samba running (and other services as well)

Unfortunately i don't have a live/rescue CD, so i can't start from there.


Jimmy...

amfoster 10-09-2004 07:16 PM

Great little tool is the lsof command

run lsof on the mount point your /dev/hda6 is mounted on and it will tell who is on the device and what files are being used on it. The device is obviously being used if it says t is busy.

We will assume the basics such as you are "root" and that /dev/hda6 is not the / filesystem.

It verywell may be tmp or var if you have those as separate file systems. Pretty tough to unmount something that is always busy. If you are unmounting it to run something like fsck, you are best off booting into single user mode, or even better, using an emergency boot floppy or cd with the fsck utility on it

Genesee 10-09-2004 07:33 PM

you can't unmount your / while it's being used -

you may try "shutdown -F"

from the manpage:

SYNOPSIS
/sbin/shutdown [-t sec] [-arkhncfF] time [warning-message]

-F Force fsck on reboot.

amfoster 10-09-2004 07:55 PM

Hmmm You are running SuSE You can repair using the install dvd or disks.


All times are GMT -5. The time now is 07:42 AM.