Potential problem with ubcd2usb
Posted: Sun Jan 12, 2014 7:34 pm
Note: I received this from ady via PM and thinks it is suitable for discussion on the forum for future reference.
I think I found a potential problem with ubcd2usb.cmd. I usually don't use it, but lately I have seen a couple of reports about booting UBCD, so I took a look at the script.
The script should install the SYSLINUX bootloader in
, but when the directory doesn’t yet exist, then the result depends on the version of SYSLINUX (the behavior has changed over the time / releases, and it is inconsistent between installers under different OS).
Additionally, the script copies the files only after the installation of the SYSLINUX bootloader, and only if that installation succeeds. And here we have 2 potential issues:
1_ when the bootloader is installed to the root (because the
directory doesn't yet exist), the procedure is considered successful anyway, not a failure; and,
2_ a file is then copied to
as part of the procedure that copies files to the USB drive.
So, depending on the initial state of the drive, and depending on the Syslinux version, the resulting USB drive *might* fail to boot UBCD.
Currently, one reason to execute the installation of the bootloader before copying the rest of the files is that the former is faster than the latter; so if it fails then the user doesn't have to wait for all the files to be copied just to find out that something has failed.
So to cover these cases, one possible solution could be to perform the installation of the bootloader twice, one before the copy of the files, and one after it.
The alternative is to swap the order, copy the files first, and if that succeeds, only then install the bootloader.