DSL Tips and Tricks :: How to USB Boot from an ext2 partition



After trashing my backup.tar.gz file whilst messing around with extensions [sigh], I thought I'd try something different for a USB boot...

I saw in another post that the later versions of syslinux include extlinux - a utility that can be used to boot from an ext2 partition. Strangely this did not compile when I made the syslinux-mssys extension but it did compile this time.

Together with the Windows ext2 drivers from here I can now boot DSL from a USB stick using an ext2 partition and read/write files to it in Windows. This may help those people with large USB sticks (>512MB) who cannot boot DSL/DSL-N from a single FAT/FAT32 partition.

Assuming you have a working FAT/FAT32 USB boot, copy all of the files somewhere safe, then:
Code Sample
# sfdisk /dev/sdb [or wherever your target USB stick is]
...
/dev/sdb1 :0 1022 83 *

New situation:
Units = cylinders of 507904 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdb1   *      0+   1021    1022-    506911+  83  Linux
/dev/sdb2          0       -       0          0    0  Empty
/dev/sdb3          0       -       0          0    0  Empty
/dev/sdb4          0       -       0          0    0  Empty
Do you want to write this to disk? [ynq] y
Successfully wrote the new partition table

Re-reading the partition table ...

# mkfs.ext2 /dev/sdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
126976 inodes, 506908 blocks
25345 blocks (5.00%) reserved for the super user
First data block=1
62 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
       8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

# mount -t ext2 /dev/sdb1 /mnt/sdb1
# extlinux -i /mnt/sdb1
/mnt/sdb1 is device /dev/sdb1

This will leave the following in the root directory of the USB stick:

/lost+found [empty directory]
extlinux.sys

Next:

1. Copy all of your original FAT/FAT32 USB stick files to the newly formatted ext2 USB stick except ldlinux.sys. Note - you may need to rename /knoppix/knoppix to /KNOPPIX/KNOPPIX since ext2 cares about case.
2. Rename syslinux.cfg to extlinux.conf

Once this is done, you should be able to boot from the ext2 USB stick.


original here.