Page 1 of 1

Fixed -- Howto update ldlinux.sys

Posted: 26 Mar 2012, 02:25
by Rava
I want to update an USB stick that got 1.0rc1 on it to 1.2rc1...

All is fine, but the issue is /boot/syslinux/ldlinux.sys
Since the md5sum differs I want to also replace the old from 1.0rc1 with the one one from 1.2rc1.

The current running 1.2rc2 sits on sda2, the stick I want to update is sdb1:

Code: Select all

root@porteus:/mnt/sda2/boot/syslinux# md5sum ldlinux.sys
b5efda848c70edd770c2f016cda4e498  ldlinux.sys

root@porteus:/mnt/sdb1/boot/syslinux# md5sum ldlinux.sys
eb0aa4ba53272e794d2d5a770653f06d  ldlinux.sys
root@porteus:/mnt/sdb1/boot/syslinux# chmod a+w ldlinux.sys
chmod: changing permissions of `ldlinux.sys': Operation not permitted
I don't want for format / erase all files cause with a 2 GB stick, there is some more stuff on it, not only Porteus...

How to change the ldlinux.sys? I cannot delete it, I cannot chmod a+w it...

Re: How to update ldlinux.sys ?

Posted: 26 Mar 2012, 03:09
by fanthom

Re: How to update ldlinux.sys ?

Posted: 27 Mar 2012, 07:55
by Rava
Cannot remove ldlinux.sys

ldlinux.sys has the immutable attribute set which prevents the file from being deleted or overwritten. This is because the sector location of the file must not change or else syslinux has to be reinstalled. To remove:

Code: Select all

chattr -i /boot/syslinux/ldlinux.sys
rm /boot/syslinux/ldlinux.sys
Thanks, I also searched the web, seems my search-fu was broken that moment. Image

Anyway, quoted the solution for others to find in here :) ; checked it out and it works like a charm:

Code: Select all

root@porteus:/mnt# chattr -i /mnt/sdb1/boot/syslinux/ldlinux.sys 
root@porteus:/mnt# cp /x/boot/syslinux/ldlinux.sys /mnt/sdb1/boot/syslinux/ldlinux.sys 
cp: overwrite `/mnt/sdb1/boot/syslinux/ldlinux.sys'? y
root@porteus:/mnt# md5sum /x/boot/syslinux/ldlinux.sys /mnt/sdb1/boot/syslinux/ldlinux.sys 
b5efda848c70edd770c2f016cda4e498  /x/boot/syslinux/ldlinux.sys
b5efda848c70edd770c2f016cda4e498  /mnt/sdb1/boot/syslinux/ldlinux.sys
( /x is a symlink always directing to my Porteus booting device; done via rc.local. :) Yes, tweaking me is lazy like that. :D :D )

Verfasst after 1 minute 16 seconds:
Re: Fixed -- Howto update ldlinux.sys
Woo Hooo! 222 posts! :Yahoo!: