Skip to navigation

Slax on a USB drive

Basically, I followed these instructions, but here is the official record of what I did.

Using a 2 GB memory stick (Transcend JF V30/ 2GB).

When I plug in the USB drive, it shows up on the XFCE desktop as sdb1. Right click and if necessary click “Unmount volume”.

sudo gparted

In gparted, select /dev/sdb from the dropdown in the top right corner, or whatever the directory is for your USB drive. Delete the existing partition (assuming you have no data you want to save). Create a new FAT16 partition with a size of about 500 MB. Create a new FAT16 partition using the remaining space. Click “Apply all operations”. Exit gparted.

The XFCE desktop now shows two partitions: sdb1 and sdb2.

Download slax-5XXX.iso and cd to that directory.

Mount the slax iso:

mkdir slaxUSB
sudo mount -o loop slax- slaxUSB

Mount the partition of the USB drive that you want to make bootable:

mkdir USBpendrive
sudo mount -t vfat /dev/sdb1 USBpendrive

Copy contents of the .iso disk image to the USB drive:

sudo cp -ra slaxUSB/* USBpendrive/

Copy two files to the root of the bootable USB drive partition:

cd USBpendrive/boot/
sudo cp vmlinuz ..
sudo cp initrd.gz ..

Rename a file in the root of the bootable USB drive partition:

cd ..
sudo mv isolinux.cfg syslinux.cfg

Edit USBpendrive/syslinux.cfg and remove “boot/” from boot/vmlinuz and from boot/initrd.gz.

Check whehter you have syslinux, if not, install, then run:

sudo aptitude install syslinux
sudo syslinux -s /dev/sdb1

I then had to manually make /dev/sdb1 bootable; this can be done easily by toggling the boot flag using cfdisk:

cfdisk /dev/sdb


All of this works fine on Linux. I can boot from the USB flash drive and if I plug it into a running system, it shows the two partitions as separate drives. However, it seems computers running Windows just ignore the second partition on the usb flash drive. I haven’t looked for a solution to this problem. I have enough space on the smaller (bootable, Slax) partition to fit some files on it, so when I have to give a presentation I just copy that file to both partitions on the USB drive. I don’t know whether it’s in fact necessary to partition the drive — probably not, but I don’t remember whether it is and if not, why I did it (maybe just a sudden attempt at tidiness).

Comments are closed.