LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-22-2005, 04:15 PM   #1
provkitir
Member
 
Registered: Jul 2004
Location: Mass
Distribution: Freebsd 5.3, Debian sid 2.6.7
Posts: 101

Rep: Reputation: 15
cannot delete item as root!!


hi, i'm not a newbie, but this seems a newbie question.

i have a file that i can't delete. it's not allowing me to mv it, chown it, chmod it, rm -f it, ... etc. as ROOT

what the hell do i do?
openlight:/home/hh98/music/modern# ls -lisa heavenmissangel.mp3
580649 1659563507 b-wSr-xrwt 44379 3923034699 3628644029 79, 179 Apr 30 2011 heavenmissangel.mp3

and of course, when ran df -hav in /home directory, only like 2.5 GB was used, so it cannot be 1.6 TB!

anyhoo, i have home on it's own partition, if worst comes to worst, i save what i can and reformat /home, but anyone have any ideas before that?

thanks in advance!
 
Old 01-22-2005, 04:20 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Run fsck on the partition

You realize that ls is telling you it's a device file and that it has some really funky permissions; not to mention astronomical owner an group id's for the file.
 
Old 01-22-2005, 04:21 PM   #3
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
you might try chattr - see if that does anything

but it seems more likely that it's time for a fsck - remember to umount the /home partition


EDIT: what dark_helmet said - beat me to it
 
Old 01-22-2005, 04:31 PM   #4
provkitir
Member
 
Registered: Jul 2004
Location: Mass
Distribution: Freebsd 5.3, Debian sid 2.6.7
Posts: 101

Original Poster
Rep: Reputation: 15
okay, as root i umount /home, did fsck /dev/hda7 (the home partition)
and here's what it said
openlight:~# fsck /dev/hda7
fsck 1.36-rc2 (11-Jan-2005)
e2fsck 1.36-rc2 (11-Jan-2005)
/home: clean, 1047/806400 files, 1144484/1611280 blocks

and the file is still there
 
Old 01-22-2005, 05:40 PM   #5
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Aside from booting with a live-cd/rescue disk to run fsck, I don't know what else to tell you. Clearly, something is screwy with the filesystem. If you end up reformatting, I'd suggest ext3 instead of ext2. That would offer more protection against the filesystem getting "confused".

EDIT: Actually, e2fsck is used for ext3 filesystems isn't it? Oh well... I can't be sure it's ext2, but the suggestion for ext3 still stands

Last edited by Dark_Helmet; 01-22-2005 at 05:42 PM.
 
Old 01-22-2005, 06:37 PM   #6
provkitir
Member
 
Registered: Jul 2004
Location: Mass
Distribution: Freebsd 5.3, Debian sid 2.6.7
Posts: 101

Original Poster
Rep: Reputation: 15
alright, thanks! yea it was ext3. i'll go knoppix and reformat as a last resort
 
Old 01-22-2005, 09:14 PM   #7
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,109

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Just for laughs, what does stat heavenmissangel.mp3 have to say? You can also try to use emacs in directory edit mode (emacs /directory/file/is/in) to edit the directory listing and try to nuke the file. Do back your data up before trying that, though.
 
Old 01-23-2005, 03:10 PM   #8
provkitir
Member
 
Registered: Jul 2004
Location: Mass
Distribution: Freebsd 5.3, Debian sid 2.6.7
Posts: 101

Original Poster
Rep: Reputation: 15
hey sorry i reformatted already, before i could read your post. if the thing comes back then I'll do the stat thing for kicks. why did this file, and another one as i later discover become device files? is it just hardware integrity issue? rootkit? ext3 random error? i'm using reiserfs for /home now, hopefully things will be good
 
Old 01-23-2005, 03:31 PM   #9
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
This is just a guess...

I would think it was just a screw up in the filesystem. Unexpected loss of power during disk IO is one possible explanation. Ext3 is supposed to prevent that, but I don't think anything is 100%. In fact, I would go so far as to say it probably happened as the drive was writing the information for a new file. The OS had reserved an inode, had written some preliminary information, and then got cut off.Just enough information was written for the filesystem to think it was a valid entry, but not enough was written to create a coherent entry. Essentially, the filesystem knew where the file was supposed to start, and as it read the bytes on the disk at that location, it was reading somewhat random data, and interpreting it as best it could. When you tried to delete it, there were probably some sanity checks that failed, preventing any change to the disk information.

Like I said, it's a guess
 
Old 01-23-2005, 05:27 PM   #10
provkitir
Member
 
Registered: Jul 2004
Location: Mass
Distribution: Freebsd 5.3, Debian sid 2.6.7
Posts: 101

Original Poster
Rep: Reputation: 15
thanks
 
Old 03-25-2007, 01:58 AM   #11
mrdvt92
LQ Newbie
 
Registered: Apr 2006
Posts: 6

Rep: Reputation: 0
Quote:
Originally Posted by provkitir
i have a file that i can't delete. it's not allowing me to mv it, chown it, chmod it, rm -f it, ... etc. as ROOT

what the hell do i do?
Quote:
Originally Posted by Genesee
you might try chattr - see if that does anything
I ran into this same issue and was beginning to backup and re-format. But, then Genesee mentioned `chattr`. I, personally, had never used that tool before. So, I brought out `man lsattr` and found out that the file had the "a" flag set.

Quote:
Originally Posted by man chattr
A file with the Ďaí attribute set can only be open in append mode for writing. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
Well `chattr -a .secure.PayPal.com` as root did the trick. My old RH7.3 box was hit by a worm that setup a phishing site. It goes without saying, keep up with the updates!

Mike (mrdvt92)
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
mozilla xpm kmenu item desktop item cjae Linux - Newbie 3 04-06-2005 07:11 AM
Delete root mail nepcw Red Hat 5 07-18-2004 01:01 PM
Delete as Root mtoedtli2 Linux - Newbie 3 07-14-2004 03:06 PM
menu item (command) to use root Tyir Linux - General 1 03-16-2004 09:53 AM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM


All times are GMT -5. The time now is 05:23 AM.

Main Menu
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