DSL - Installing to a USB Flash Drive
时间:2007-02-02 来源:kingthr
From DSL Wiki
Contents
|
From within Linux
- Download the dsl-embedded zipfile
- Create a FAT16 partition on the pendrive. Mount it.
- Unzip the dsl-embedded.zip file onto this.
- Unmount the pendrive
- run "syslinux -s /dev/sdX1" (without the quotes) to make it bootable.
- You can now boot via QEMU (from within Linux or windows), OR as native from the USB drive.
- You can also run DSL from a GRUB bootloader menu on your USB key. This is very useful if you're using DSL as part of a data/system rescue toolkit, as you can include multiple preset configurations of DSL as well as other utilities.
Note: syslinux needs the package "mcopy" included in the package "mtools".
Note: Unfortunately, this method does NOT give a 50MB Linux Distribution because qemu dir and method is (comparatively) big.You will end up with a 110MB distribution.
Note: The iocharset=utf8 option when mounting the USB stick may result in the "KNOPPIX/KNOPPIX" not being found upon booting.
From within Linux using GRUB as boot loader
- Download the current.iso dsl-cd image.
- Create an ext2 partition (=> 51MB) on pendrive. Mount it.
- Change to the directory where you mounted the ext2 partition, install GRUB boot loader:
grub-install --no-floppy --root-directory=. /dev/<device>
Note: Replace <device> with the corresponding file which represents your USB storage device.
- Copy the contents of the cd image to the usb drive.
- While in the same directory - where you mounted the ext2 filesystem - create a menu.lst file for grub in the directory ./boot/grub/menu.lst
cat > ./boot/grub/menu.lst << EOF title Damn Small Linux root (hd0,0) kernel /boot/isolinux/linux24 root=/dev/sda1 ro lang=us toram noeject frugal initrd /boot/isolinux/minitrd.gz boot EOF
Note: You might have to change (hd0,0) to the correct partition for your USB drive. However, the default should work on most systems.
- Unmount the filesystem
- You can now boot from your USB storage device.
Note: This part may require experts attention and/or a separate page.
From within Windows
Note: This guide assumes that your USB Flash Drive is "I:". Please replace I with the correct drive letter.
- Format your drive (FORMAT I: /fs:FAT32)
- Download Syslinux - Syslinux can also be used by various other platforms, such as Unix.
- Go to a command prompt and run syslinux for your drive (SYSLINUX I:)
- Download DSL (dsl-embedded.zip), [[1]]
- Copy DSL to your USB drive & reboot. (Unzip DSL and copy all files)
Note: Booting from USB may or may not work on your computer, mostly dependent on its age and bios setup.
Note: Some systems seem to have problems booting from USB drives formatted as FAT32, changing the format step to FORMAT I: /fs:FAT may allow DSL to boot
Convert .iso to USB installation
With the guide from [2] you can install the .iso contents non-destructiveley onto a USB partition. Leave out all the partitioning or formating stuff to prepare an existing and used USB drive for DSL booting:
- Mount USB drive, with e.g. mount /dev/sda1 /flash - can be either FAT16 or FAT32!
- Mount ISO image, with e.g. mount /tmp/dsl-3.2.iso /tmp/iso -o loop
- Copy all contents from ISO to USB drive: cp -vr /tmp/iso/* /flash/
- Rename and move syslinux files to root directory: mv /flash/boot/isolinux/* /flash/
- Rename isolinux.cfg: mv /flash/isolinux.cfg /flash/syslinux.cfg
- Unmount USB drive: umount /flash
- Install syslinux: syslinux /dev/sda1 and eventually set the MBR boot flag for this partition (with fdisk).
Note: All path names are examples! Please adapt or you may corrupt existing partitions or files.
Questions
- Why does the from-within-Linux method require FAT16, but the Windows method work with FAT32? Could I just leave and reuse an existing FAT32 USB partition using the Linux syslinux version?
* ... probably doesn't