INSTALLING SUOMIKNOPPIX TO 1 GB USB STICK (using device /dev/sdb1; change device name to fit your system) Remove first U3 program if existing (can be done only in Windows). Stick can not be formatted before U3 has been removed. You can try following removal programs: http://www.sandisk.com/Assets/u3/launchpadremoval.exe http://www.u3.com/uninstall/ 1. Doing partitioning with fdisk: Look first with fdis what disks are in your pc: # fdisk -l Levy /dev/sdb: 999 Mt, 999816704 tavua 31 päätä, 62 sektoria/ura, 1016 sylinteriä Yksiköt = 1922 * 512 = 984064 -tavuiset sylinterit Laite Käynn Alku Loppu Lohkot Id Järjestelmä /dev/sdb1 * 1 1016 976345 83 Linux 2.Unmount usb stick if it is mounted: # umount /dev/sdb1 3. Start fdisk in usb disk: # fdisk /dev/sdb Komento (m antaa ohjeen): p Levy /dev/sdb: 999 Mt, 999816704 tavua 31 päätä, 62 sektoria/ura, 1016 sylinteriä Yksiköt = 1922 * 512 = 984064 -tavuiset sylinterit Laite Käynn Alku Loppu Lohkot Id Järjestelmä /dev/sdb1 * 1 1016 976345 83 Linux Remove old partitions with d if existing: Komento (m antaa ohjeen): d Valittiin osio 1 Check with p that disk is empty: Komento (m antaa ohjeen): p Levy /dev/sdb: 999 Mt, 999816704 tavua 31 päätä, 62 sektoria/ura, 1016 sylinteriä Yksiköt = 1922 * 512 = 984064 -tavuiset sylinterit Laite Käynn Alku Loppu Lohkot Id Järjestelmä Create a new partition (n): Komento (m antaa ohjeen): n Komento merkitys e laajennettu p ensiöosio (1-4) Choose primary partition (p): p Osionumero (1-4): 1 Ensimmäinen sylinteri (1-1016, oletus 1): Käytetään oletusarvoa 1 Viimeinen sylinteri tai +koko tai +kokoM tai +kokoK (1-1016, oletus 1016): Käytetään oletusarvoa 1016 Make partition bootable (a): Komento (m antaa ohjeen): a Osionumero (1-4): 1 Choose type (t) Linux (83): Komento (m antaa ohjeen): t Valittiin osio 1 Heksakoodi (L listaa koodit): 83 Check once again that disk is partitioned right: Komento (m antaa ohjeen): p Levy /dev/sdb: 999 Mt, 999816704 tavua 31 päätä, 62 sektoria/ura, 1016 sylinteriä Yksiköt = 1922 * 512 = 984064 -tavuiset sylinterit Laite Käynn Alku Loppu Lohkot Id Järjestelmä /dev/sdb1 * 1 1016 976345 83 Linux Write modified data to disk (w): Komento (m antaa ohjeen): w Osiotaulua on muutettu! Kutsutaan osiotaulun uudelleen lukeva ioctl(). Synkronoidaan levyt. 4. Unmount usb stick: # umount /dev/sdb1 umount: /dev/sdb1: not mounted 5. Create ext3 filesystem to usb stick: # mkfs.ext2 -j /dev/sdb1 mke2fs 1.40-WIP (14-Nov-2006) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 122112 inodes, 244086 blocks 12204 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=251658240 8 block groups 32768 blocks per group, 32768 fragments per group 15264 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 36 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. 6. Check that filesystem is really ext3 (ext2 with journal): # tune2fs -j /dev/sdb1 tune2fs 1.40-WIP (14-Nov-2006) The filesystem already has a journal. 7. Mount usb stick: mount /dev/sdb1 8. Create following directories to usb stick: /KNOPPIX /boot/grub 9. Copy from /usr/lib/grub/i386-pc/ to /boot/grub following files: e2fs_stage1_5 stage1 stage2 Do a help file for installing Grub (can be removed later) flag 10. Start grub: # grub Look with 'flag' help file where Knoppix should be installed: grub> find /boot/grub/flag (hd2,0) Make root directory (/): grub> root (hd2,0) Filesystem type is ext2fs, partition type 0x83 Install boot sector to the root of the stick (not necessary): grub> setup (hd2,0) Checking if "/boot/grub/stage1" exists... yes Checking if "/boot/grub/stage2" exists... yes Checking if "/boot/grub/e2fs_stage1_5" exists... yes Running "embed /boot/grub/e2fs_stage1_5 (hd2,0)"... failed (this is not fatal) Running "embed /boot/grub/e2fs_stage1_5 (hd2,0)"... failed (this is not fatal) Running "install /boot/grub/stage1 (hd2,0) /boot/grub/stage2 p /boot/grub/menu .lst "... succeeded Done. Install Grub's boot sector to MBR: grub> setup (hd2) Checking if "/boot/grub/stage1" exists... yes Checking if "/boot/grub/stage2" exists... yes Checking if "/boot/grub/e2fs_stage1_5" exists... yes Running "embed /boot/grub/e2fs_stage1_5 (hd2)"... 15 sectors are embedded. succeeded Running "install /boot/grub/stage1 (hd2) (hd2)1+15 p (hd2,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded Done. Quit Grub: grub> quit 11. Copy /cdrom/KNOPPIX/KNOPPIX file from CD to /KNOPPIX directory to usb stick. 12. Copy also following sub-directories to /KNOPPIX directory: /modules /scripts 13. Copy following files to /boot/grub directory: menu files (all) 14. Copy to /boot directory of the usb stick /cdrom/boot/default directory from CD (all files). 15. Add to /boot/grub/menu.list file's boot line noswap noeject noprompt home=scan 16. Do following script (or similar) to the root of the stick by which /cdrom directory can be made r/w (usb stick is writable - cdrom not): #! /bin/sh # Note, only be used from usb ! # Running this script makes your /cdrom directory writable in usb stick mount -o remount,rw /cdrom mount --bind /cdrom /media/sdb1 Give executive permission to the script: # chmod +x make_cdrom_writeable 17.That's all, folks! Boot from your usb device :) APPENDIX A. Test stic with Qemu: # modprobe kqemu $ qemu -boot c /dev/sdb B. Links: http://www.knoppix.net/wiki/USB_Based_FAQ http://www.pendrivelinux.com/2007/02/20/installing-usb-knoppix-51-using-linux/ Enjoy :) -tapsa-