Page 1 of 1

Stubborn file (extlinux.sys), cannot delete

Posted: 05 Jan 2011, 16:06
by Ahau
This is not a standard Porteus install, as I've installed v09 on an ext3 partition, using extlinux to boot (when using the liloinst.sh file, KDE loads with 1024x768 resolution, which looks awful on my laptop as it has a wider screen). So, this is not a bug with the current system, and it's probably my lack of knowledge that is the problem...

Anyway, I had the extlinux/ext3 setup running 32 bit v09 (a la markds HOWTO on slax.org), and decided to upgrade to 64 bit (this is my backup USB stick, so I still had a working linux Porteus install if things went haywire). To clear out before the new install, I deleted my /slax directory and attempted to delete /boot, but received an error, stating that extlinux could not be removed. I played around with it for a bit and got it moved to my .Trash folder, but now I can't delete it completely from there, either.

So, what do I need to do to get rid of this file? No, it's not important, as it's not interfering with me booting into my new 64 bit install, but it's annoying, and it's something I'd like to learn about. I thought that, as root, I would have all the permissions I need.

Anyway, here's some more info, and please note that I was running 32 bit v09 from a different usb drive (sdb1) while trying to remove this file. I had mounted the ext3 partition at /mnt/sdc2:
root@slax:/mnt/sdc2/.Trash-0/files/oldboot.2/syslinux# ls -a
./ ../ extlinux.sys
root@slax:/mnt/sdc2/.Trash-0/files/oldboot.2/syslinux# ls -l
total 15
-r--r--r-- 1 root root 14336 Dec 14 12:42 extlinux.sys
root@slax:/mnt/sdc2/.Trash-0/files/oldboot.2/syslinux# rm extlinux.sys
rm: cannot remove `extlinux.sys': Operation not permitted
root@slax:/mnt/sdc2/.Trash-0/files/oldboot.2/syslinux# chmod -x extlinux.sys
chmod: changing permissions of `extlinux.sys': Operation not permitted
root@slax:/mnt/sdc2/.Trash-0/files/oldboot.2/syslinux# chown root extlinux.sys
chown: changing ownership of `extlinux.sys': Operation not permitted
I think I previously tried rm -f and that didn't work, either.

Thanks, all!

Re: Stubborn file (extlinux.sys), cannot delete

Posted: 05 Jan 2011, 17:30
by fanthom
I never played with extlinux so can be wrong here. Anyway, try to boot with 'fsck' cheatcode and hopefully filesystem will be fixed, if not then probably full format is required.

Re: Stubborn file (extlinux.sys), cannot delete

Posted: 05 Jan 2011, 17:34
by Ahau
Thanks, I'll give that a shot!

Re: Stubborn file (extlinux.sys), cannot delete

Posted: 05 Jan 2011, 18:56
by sams
extlinux sets the unmodifyable attribute

chattr -i extlinux.sys

ps first post!

Re: Stubborn file (extlinux.sys), cannot delete

Posted: 05 Jan 2011, 23:55
by Ahau
sams wrote:extlinux sets the unmodifyable attribute

chattr -i extlinux.sys

ps first post!
A-ha! That looks to be exactly the issue. I'll boot into Porteus on my way home tonight, and respond here with the outcome.

Thanks, sams!

From Wikipedia:
The form of the chattr command is:

chattr [-RV] [-+=AacDdijsSu] [-v version] files
-R is to recurse all subdirectories
+i is to set the immutable bit to prevent even root from erasing or changing the contents of a file.
-i is to unset the immutable bit
Note: The superuser can't erase or write on the file, but he or she can set or unset the i attribute.
Posted after 4 hours 10 minutes 28 seconds:
chattr -i worked, thank you!

Maybe this is something to keep in mind if extlinux is used in the next release?

Re: Stubborn file (extlinux.sys), cannot delete

Posted: 06 Jan 2011, 05:19
by fanthom
@sams
good to have such experienced guys here - thanks for the tip :D

@Ahau
"Maybe this is something to keep in mind if extlinux is used in the next release?"
there was a suggestion for going with one unified loader like grub (instead of syslinux, lilo, isolinux, extlinux). I'm getting convinced to 'grub' option even more now, but it need to be discussed first.