Page 1 of 1

[HOWTO] Install Slax to USB using extlinux by markds

Posted: 31 Dec 2010, 19:24
by Tonio
Dear folks,

Markds posted an excellent howto in slax forum on how to install slax to usb using extlinux and keep nice graphics

http://www.slax.org/forum.php?action=vi ... ntID=37939
by markds
There have been several problems with "changes" on FAT32 installations of slax on USBs or HDDs, where slax gets corrupted on boot up. The solution has always been to remove the "changes" directory and reboot, effectively making one lose all their modifications, etc. The other alternative was to create a ext2/ext3 partition just for the "changes" which avoided the need for the posixvol overlay, which in many cases was the cause of the corruption.

In all these cases, slax is installed by copying the boot/ and slax/ folders to a FAT32 partition and running bootinst.bat or bootinst.sh. There was no option to copy the boot/ and slax/ folders to an ext2/ext3 partition and run a script to make it bootable. By using EXTLINUX, this becomes possible. EXTLINUX is essentially the same as SYSLINUX but works on ext2/ext3 partitions. It allows full access to the menu system so you don't lose anything.

1) Boot up from your slax CD (in this eg, the slax CD is /mnt/hda/)
2) Determine what your USB or HDD device is (in this eg, I will use /dev/sdb), create a partition on the device and format the partition to ext3 using g-parted or cfdisk (search the forum on how to do this). Then mount the partition :

Code: Select all

mkdir -p /mnt/sdb1; mount /dev/sdb1 /mnt/sdb1
3) Download the latest syslinux from http://www.kernel.org/pub/linux/utils/b ... .74.tar.gz and save it to /tmp or where ever.
4) Untar-gz syslinux-3.74.tar.gz and you will have a syslinux-3.74 directory

Code: Select all

tar -zxf syslinux-3.74.tar.gz
ls
syslinux-3.74/ syslinux-3.74.tar.gz
In the syslinux-3.74 directory there is an extlinux directory. In the extlinux directory is the extlinux binary (already compiled for you).

Code: Select all

ls syslinux-3.74/extlinux/
Makefile ext2_fs.h extlinux* main.c
5) Copy the boot/ and slax/ directories from your CD to your USB/HDD device

Code: Select all

cp -R /mnt/hda/* /mnt/sdb1
6) In the USB/HDD device cd to the boot/syslinux directory and copy the extlinux binary to boot/syslinux

Code: Select all

cd /mnt/sdb1/boot/syslinux
cp /tmp/syslinux-3.74/extlinux/extlinux .
7) In the USB/HDD device cd to boot/syslinux and copy syslinux.cfg to extlinux.conf

Code: Select all

cd /mnt/sdb1/boot/syslinux; cp syslinux.cfg extlinux.conf
8) In the USB/HDD device, edit the boot/bootinst.sh and change line 61 from :

Code: Select all

./boot/syslinux/syslinux -d boot/syslinux $TARGET
to

Code: Select all

./boot/syslinux/extlinux -i boot/syslinux
9) Execute ./bootinst.sh and you will get a message similar to "boot/syslinux is /dev/sdb1" (/dev/sdb1 will be replaced by whatever your USB/HDD device is).

Reboot, remove the CD and you will see that the system boots up with the menu and everything, except the USB/HDD is now a ext3 partition instead of a FAT32 partition, so no more problems with posixvol and corrupted changes directories. The drawback to this is that the partition with the boot/ and slax/ directories will no longer be visible from Windows. If you want it to be visible, then you need to install Ext2IFS (http://www.fs-driver.org/) in Windows or get a program like Linux-Recovery (http://www.diskinternals.com/Linux-Recovery/) for Windows.

It would be good if Tomas could include the extlinux binary and config and also a script to use extlinux for future releases of slax so that those who want to install it on ext2/ext3 partitions can do so easily.

If any of the instructions are not clear, let me know and I'll try to simplify it further.

Re: [HOWTO] Install Slax to USB using extlinux by markds

Posted: 31 Dec 2010, 22:12
by X-Factor
:good: i Hope it is ok ethically, cause there is a good ome by gutterrapolis too...
i suppose we won't need to imported here cause there already slax2usb with remix..

Re: [HOWTO] Install Slax to USB using extlinux by markds

Posted: 31 Dec 2010, 22:29
by brokenman
I see no ethical dilemma posting info from other sites, especially our mother site. Preferably it would be rewritten with a credit, but who wants to spend time doing this!

Re: [HOWTO] Install Slax to USB using extlinux by markds

Posted: 01 Jan 2011, 01:51
by X-Factor
Not promising anything i'll try the wi-fi bit probably end up in the installation section as there are a lot of query n most posted forum are " i've done this but....." n lots of people need to be credited.

Re: [HOWTO] Install Slax to USB using extlinux by markds

Posted: 01 Jan 2011, 09:36
by att
If the problem is the "Changes" directory, why not use "slaxsave.dat" anyway? Always worked for me....

Re: [HOWTO] Install Slax to USB using extlinux by markds

Posted: 25 Jan 2011, 22:48
by Ahau
The link provided above for downloading syslinux tools is dead. Try http://kernel.org/pub/linux/utils/boot/ ... .86.tar.gz instead.

The latest version of extlinux, 4.03, will not install correctly with the method provided above, but 3.86 will.

Re: [HOWTO] Install Slax to USB using extlinux by markds

Posted: 26 Jan 2011, 00:38
by brokenman
Yes, i've found 4.03 will do it's job and appear to install bootloader, however the system will not boot.

Re: [HOWTO] Install Slax to USB using extlinux by markds

Posted: 26 Jan 2011, 02:47
by Ahau
I got it to boot into extlinux, but couldn't get it to find the config file. It got me to a boot prompt, and I could boot to /boot/vmlinuz, but didn't know how to append initrd, so it got hung up. Kind of a moot point now that we're moving towards grub4dos, but may be useful for those still working on getting v09 up.