LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 10-03-2004, 05:34 PM   #1
hendrixx
Member
 
Registered: Aug 2003
Location: Netherlands
Distribution: SuSE 10 Pro
Posts: 43

Rep: Reputation: 15
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.....
 
Old 10-03-2004, 07:51 PM   #2
serz
Member
 
Registered: Apr 2003
Location: Buenos Aires, Argentina
Distribution: Slackware, Gentoo
Posts: 397

Rep: Reputation: 30
Try:

rm "?config.inc.php" "?config.default"
 
Old 10-04-2004, 07:09 AM   #3
hendrixx
Member
 
Registered: Aug 2003
Location: Netherlands
Distribution: SuSE 10 Pro
Posts: 43

Original Poster
Rep: Reputation: 15
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...
 
Old 10-04-2004, 09:15 AM   #4
serz
Member
 
Registered: Apr 2003
Location: Buenos Aires, Argentina
Distribution: Slackware, Gentoo
Posts: 397

Rep: Reputation: 30
You're getting an Access Denied error.. are you doing that as root?
 
Old 10-05-2004, 03:04 PM   #5
hendrixx
Member
 
Registered: Aug 2003
Location: Netherlands
Distribution: SuSE 10 Pro
Posts: 43

Original Poster
Rep: Reputation: 15
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.
 
Old 10-06-2004, 03:10 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,689

Rep: Reputation: Disabled
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.
 
Old 10-06-2004, 08:31 AM   #7
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 34
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.
 
Old 10-06-2004, 08:39 AM   #8
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 57
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.
 
Old 10-06-2004, 08:47 AM   #9
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 34
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.
 
Old 10-06-2004, 01:21 PM   #10
hendrixx
Member
 
Registered: Aug 2003
Location: Netherlands
Distribution: SuSE 10 Pro
Posts: 43

Original Poster
Rep: Reputation: 15
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....

Last edited by hendrixx; 10-06-2004 at 01:23 PM.
 
Old 10-07-2004, 03:59 AM   #11
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,689

Rep: Reputation: Disabled
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 .
 
Old 10-09-2004, 04:16 PM   #12
hendrixx
Member
 
Registered: Aug 2003
Location: Netherlands
Distribution: SuSE 10 Pro
Posts: 43

Original Poster
Rep: Reputation: 15
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...
 
Old 10-09-2004, 08:16 PM   #13
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 34
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
 
Old 10-09-2004, 08:33 PM   #14
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
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.
 
Old 10-09-2004, 08:55 PM   #15
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 34
Hmmm You are running SuSE You can repair using the install dvd or disks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Root cant delete file WTF!!! xtypestereotype Linux - Software 7 06-27-2005 12:41 PM
Strange root password problem harken Linux - Security 3 02-17-2005 02:12 PM
strange file creation problem dizzutch Programming 1 10-06-2004 06:30 PM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 03:46 AM
strange problem with root login/su schbond Linux - General 6 10-17-2003 10:52 AM


All times are GMT -5. The time now is 11:46 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration