SOLVED: Unable to delete files as root on CoreELEC

Hi,

I used my NAS to copy some files to the extf4 partition on coreELEC. Some where copied without the execution bit and I can’t delete them anymore:

EmuELEC:~/roms/snes # ls -la
total 17452
drwxrwxrwx    5 root     root          7168 Dec 22 08:10 .
drwxrwxrwx   94 root     root          3072 Apr 11  2019 ..
-rw-r--r--    1 root     root       1048576 Nov 12  2017 Axelay (U) [!].sfc
-rwxr--r--    1 root     root       1048576 Feb  4  2020 Batman Returns (USA).sfc

I can delete Batman but not Axelay. Batman was transfered using SMB. Axelay via NAS.

Here is what I tried:

EmuELEC:~/roms/snes # rm -f Axelay\ \(U\)\ \[\!\].sfc 
rm: can't remove 'Axelay (U) [!].sfc': Operation not permitted

And with sudo I get:

EmuELEC:~/roms/snes # sudo rm -f Axelay\ \(U\)\ \[\!\].sfc 

 There is no working 'sudo'.
 
 On debian/ubuntu/all general purpose linux distributions 'sudo'
 allows a permitted user to execute a command as the superuser
 or another user, as specified by the security policy
 
 With CoreELEC you have root access by default, so you dont need 'sudo'

What have I done wrong? How do I get REAL root access? The NAS can’t delete the files either.

What is your folder permissions

ls -l ~/roms | grep snes 

Or try to change it and then delete file

chmod ugo+w ~/roms/snes

Or just try

rm 'Axelay (U) [!].sfc'

@vpeter

Permissions of folder:

drwxrwxrwx 5 root root 7168 Dec 22 08:23 snes

Just deleting does not work. Even after your write bit on snes.

EmuELEC:~/roms/snes # rm 'Axelay (U) [!].sfc'
rm: remove 'Axelay (U) [!].sfc'? y
rm: can't remove 'Axelay (U) [!].sfc': Operation not permitted

Is partition even mountet rw?

mount

@vpeter
Yes, of course. I can delete Batman. Remeber,-

Anyway I got it:

chattr -i file

This does the trick. I read about it on stackoverflow. After the attribute is gone I can delete it.

Yes, chattr was on my next suggestions :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

About | FAQ | Terms of Service | Privacy Policy | Legal Notice