Stubborn file (extlinux.sys), cannot delete

Non release banter
Post Reply
User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Stubborn file (extlinux.sys), cannot delete

Post#1 by Ahau » 05 Jan 2011, 16:06

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!
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
fanthom
Site Admin
Site Admin
Posts: 4621
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

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

Post#2 by fanthom » 05 Jan 2011, 17:30

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.
Please add [Solved] to your thread title if the solution was found.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

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

Post#3 by Ahau » 05 Jan 2011, 17:34

Thanks, I'll give that a shot!
Please take a look at our online documentation, here. Suggestions are welcome!

sams
Legendary
Legendary
Posts: 27
Joined: 05 Jan 2011, 18:53
Location: Alaska

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

Post#4 by sams » 05 Jan 2011, 18:56

extlinux sets the unmodifyable attribute

chattr -i extlinux.sys

ps first post!

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

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

Post#5 by Ahau » 05 Jan 2011, 23:55

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?
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
fanthom
Site Admin
Site Admin
Posts: 4621
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

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

Post#6 by fanthom » 06 Jan 2011, 05:19

@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.
Please add [Solved] to your thread title if the solution was found.

Post Reply