LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cannot delete item as root!! (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-delete-item-as-root-280963/)

provkitir 01-22-2005 04:15 PM

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!

Dark_Helmet 01-22-2005 04:20 PM

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.

Genesee 01-22-2005 04:21 PM

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 :)

provkitir 01-22-2005 04:31 PM

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 :(

Dark_Helmet 01-22-2005 05:40 PM

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 :)

provkitir 01-22-2005 06:37 PM

alright, thanks! yea it was ext3. i'll go knoppix and reformat as a last resort

btmiller 01-22-2005 09:14 PM

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.

provkitir 01-23-2005 03:10 PM

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

Dark_Helmet 01-23-2005 03:31 PM

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 :)

provkitir 01-23-2005 05:27 PM

thanks :)

mrdvt92 03-25-2007 01:58 AM

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)


All times are GMT -5. The time now is 09:43 AM.