DSL on USB-Stick HOWTO


Forum: Other Help Topics
Topic: DSL on USB-Stick HOWTO
started by: doom4

Posted by doom4 on Dec. 05 2004,11:47
Howto install DSL

1. What we need
2. Starting installation
2.1 Burning the image
2.2 Booting the system
2.3 Loading missing modules
2.4 Checking USB Stick
2.5 Preparing the USB Stick
2.6 USB Stick without partition
3. Writing the USB Image
3.1 Two ways
3.2 Using frugal_usb.tar.gz
3.3 frugal_usb.sh
3.4 Shutdown and reboot
4. Personalize your DSL install
4.1 Restore/Backup
4.2 Reboot with saved settings
5. Editing the bootmanager
5.1 DSL restore as default option
5.2 Changing the greeting message
5.3 A broken MBR
6. Execute commands during the boot
6.1 The network
6.2 The wireless network
7. Installing more software
7.1 A real browser
7.2 A real word prozessor
7.3 The new Fluxbox version
7.4 Getting the icons on the desktop
7.5 Deleting icons on the desktop



















1. What we need

First we need a USB Stick. I use a 128 MB stick from Kingston. You can use a 64 MB Stick too, but if you want some software like Firefox as webbrowser or Abiword as wordprosessor its better to have a littlebit more space then only for the main system.

Then we need some DSL files:
1. The current DSL image download it from here:
2. The current frugal_usb.tar.gz download it from here:
3. The current USB bootimage download it from here:
Save 2. and 3. on on floppy disk, a second USB Stick or your main hard drive.

2. Starting installation

2.1 Burning the image
First burn the DSL image on a CD. When you have a RW because after our USB Stick installation we dont longer need the CD.

2.2 Booting the system
After that boot from the CD. You will find a full working DSL. In the most cases DSL detects the right Hardware, but sometimes like in my laptop DSL forgets some drivers but more later.

2.3 Loading missing modules
Now go to XTerminal and double klick on it. The console appears. Now type "lsmod". Check if you have the following modules:
- usb-storage
- ehci-hcd
- usb-uhci
- usbcore
If one of them are not in the list you have to load them by hand. For example in my laptop everytime after a CD boot was the module ehci-hcd missing and i was not able to mount my USB Stick. Type "insmod ehci-hcd" to load this missing module. If another module is missing replace ehci-hcd with the missing module. When you are finished and all the four modules are loaded try first if you are able to load your USB Stick.

2.4 Checking the USB Stick
Plug-in the USB Stick and try "cdrecord --scanbus". Here you can see now your USB Stick and your CD drive. If not mail me we will found a solution.

2.5 Preparing the USB Stick
Now we know that our USB Stick is known but the system. Now lets make a partion on the USB Stick with FAT16. The bootloader needs needs a FAT system. To do that type "cfdisk /dev/sda". If that fails try to use instead of sda, sdb or sdc. Be sure now that you backuped everything from the USB Stick because you will loose all your data. Look under FS Type if its FAT16 and look at Flags if there are Boot, if yes everything is good and you can leave cfdisk.
Now for those of you were its not the case of having FS Type FAT16 and/or Flags Boot. We
Start by changing the FS Type by going to the point Type in the menu and then hit <enter>. Here you find a list of possible FS Types. We need the number of FAT16 and thats the 6. So press any key (did you ever aks your self where the any key is? :] ). Now enter as filesystem type the 6 and hit <enter>. Now there must be FS Type FAT16.
To change to Flag to Boot go to Bootable and hit enter. Now Flags is Boot.
Now go to Write and hit <enter> say yes and Quit cfdisk.

2.6 USB Stick without partition
In 1% of the cases it is possible that you don't have a partion and you have nothing in the cfdisk display. Then go to new and follow the instructions. Use all the default values to be sure. Then follow the instructions of 2.5.

3. Writing the USB Bootimage

3.1 Two ways
There are two ways. The easyiest is to right click on your desktop then Apps > Tools > Install to USB Pendrive . But everytime was wanted to use this i got an error or the window appears and disappers in the same moment or i got a black window. But if its working you can switch directly to 3.3

3.2 Using frugal_usb.tar.gz
Now mount the drive where you saved frugal and the bootusb. When you saved it on a floppy plug it in now and typ in a Xterminal "mount /mnt/floppy", when its a second USB Stick plug it in and type "sudo mount /dev/sdb1 /mnt/cdrom" or when its your main hard drive type "mount /mnt/hda1". Then type "tar xvfz <path to your frugal_usb.tar.gz". For example you have Windows XP and you saved it on your desktop with the username xyz then type "tar xvfz /mnt/hda1/Dokuments and Settings/xyz/Desktop/frugal_usb.tar.gz. When you use a floppy do "tar xvfz /mnt/floppy/frugal_usb.tar.gz". Now change your directory to home/dsl buy typing "cd home/dsl". Copy now the bootusb.img to this folder by typing "cp <path to your bootusb.img> ." . Now type sh frugal_usb.sh.

3.3 frugal_usb.sh
Now its the same for both. Say yes you are ready (i hope so).  Now you have to type in the device where you want DSL installed on. When your USB Stick is sda1 then type sda1, if its sdb1 then type sdb1 and so on. Now you have the last chance to exit, but you dont want that yo type "y". Now he (the script :]) is doing everything for you. After its finished your USB Stick is ready to use.

3.4 Shutdown and reboot
Now shutdown your linux by right click and the desktop and then Powedown > Reboot and go into the bios. Try to add your USB Stick as boot option. Every bios is different so try to figger it out yourself or ask in the DSL forum if somebody has your bios and ask him how to setup it to make it bootable. Some bios's needs a -s option in the syslinux command. So if after setting up the bios well and its still not working that can be a possibility to try. Go back the step 3.2 and before you start frugal_usb.sh start an editor like scite and type "scite frugal_usb.sh". Change
"./syslinux -o bootusb-0.8.img /dev/$USB" to "./syslinux -s -o bootusb-0.8.img /dev/$USB"
thats in the line 58. Save and start frugal_usb.sh.
Now cross your fingers and i hope for you that DSL is booting.

4. Personalize your DSL install

4.1 Restore/Backup
Perhaps you have already recodnized that if you save something in your DSL linux and you reboot all your files are left. But DSL has a very nice system to save data and restore it. First you have to decide where you want to store your data. I store my data on the USB Stick to be able to use my stick in every computer. But you can store also your data on a floppy disk or if your harddrive is not NTFS you can also store the data on this drive. But lets first see wich files we have to edit to make a folder/file be restored after a restart. Our example is that we create a directory called saves in the home directory for word documents or pictures etc and we want all the other setting like thes from the windows manager be restored. For this we open Xterminal and type "mkdir saves". Then type "scite filetool.lst". This file contains every file or folder wich has to be restored after a restart. Add here the line "home/dsl/saves" and save the file.

TIP:
If you want you can also add one of the settings folders of your programmes. For example XMMS saves its setting in your home folder in .xmms so add also the line "home/dsl/.xmms" if you want the settings of XMMS saved. Have a look to the other setting diretorys. To do this open Xterminal and type "ls -a". Settings directorys are the directorys beginning with a dot.

Now we have to enable the backup/restore function during the shutdown prozess. Type "scite /opt/powerdown.sh" and uncomment the linux with filetool.sh (uncomment means delete the #). Save the file. Now make a right click on the desktop and go to Desktop > Backup/Restore . Now you have to chose your backup device. For USB Stick "sda1" (or sdb1,sdc1 but in most cases sda1), for floppy "fd0" and for hard drive "hda1" or for the second partion "hda2". When you have more the one hard drive it is possible that its hdb or hdc. Then click an Backup. Now your first thing is backuped and on the backup device the file backup.tar.gz is created. There everything is saved what is to restore.

4.2 Reboot with saved settings
Try now to reboot you DSL linux and type in the bootmanager command line "dsl restore=<backup device>". Backup device is the same like you typed in linux before. When the window manager appears start Xterminal and type "ls". Now you see the direcotry saves.




5. Editing the bootmanager

5.1 DSL restore as default option
I was boreded to type everytime in the bootmanagers command line "dsl restore=sda1" so i changed it that i can hit enter or wait. If you want this open in linux Xterminal and type "sudo scite /cdrom/syslinux.cfg". In the second line wich starts with APPEND add between lang and apm the command restore=<backup device> in my example i added restore=sda1. Save it and now your default solution is with the restore command. Dont forgett to save and reboot. If you see the saves directory it works.

5.2 Changing the greeting message
If you want to change the bootmanagers greeting message type "sudo scite /cdrom/boot.msg". Now edit it to what you want and save it. More informations about howto change colours or the pictures are in the well discribed manual from syslinux.
Get it here: www.syslinux.org?!?!?!.

5.3 A broken MBR
My MBR was broken after playing with more then one USB Stick distro. So i want to tell you how to repair it and make it usable for DSL.First boot your computer with the DSL CD image and get from syslinux.org the newest version of syslinux unpack it with "tar xvfz syslinux-<vers>.tar.gz".
BE AWARE ALL YOUR DATA WILL BE LOST AFTER REPAIRING THE MBR!!
If your USB Stick is sda1 go to the syslinux directory by typing "cd syslinux" and there type "cat mbr.bin > /dev/sda". Now you have to go back to the beginning. 2.6 is your frind now because also the partion table is deleted now.

6. Execute commands during the boot

6.1 The network
If you are one of the lucky users where DSL detects the networkcard well you don't won to retype every reboot your ip adress so you can add it quite easy during the boot up. Also if DSL doesn't detects your networkcard and you have to reload it by hand you can add this command to be excute during the bootup. First lets test if the card is detected. Right click on the desktop System > Net Setup > netcardconfig. When you are now asked if you want to use a DHCP the card is well detected. If you have a Broadcom card like me you have to reload it. For other cards i can't really help you but try to have a look witch card it is and go to the DSL forum. Somebody has for sure a solution for you. So now start Xterminal and type "sudo scite /opt/bootlocal.sh". If you have a Broadcom card like me add the line "insmod b44". Then for give an ip add the following:

ifconfig eth0 <IP> netmask 255.255.255.0 broadcast <broadcast adress> up
route add default gw <gateway ip>
echo "nameserver <nameserver ip>" > /etc/resolv.conf

and change everything from <...> to valid ip's in your network. Save the file and now you have after the reboot a working network. If you want to use it now follow the instructions from System > Net Setup > netcardconfig.

6.2 The wireless network
I am still by searching a solution for me. So please wait for an update.

7. Installing more software

7.1 A real browser
Dillo is nice but ....
So Firefox is a really nice solution. Small and quick. So go to < http://ibiblio.org/pub/Linux/distributions/damnsmall/mydsl/net/ > and download here the newest version of firefox. The programms from there are very easy to use. Ones you downloaded it make a copy of firefox to your USB Stick. To do this open Xterminal and type "sudo cp <firefox> /cdrom" and change <firefox> into the name of the firefox file. Now type "mydsl-load <firefox>" for instant use. Then "/opt/firefox/firefox" and Firefox should appears. So but now you want also your settings be restored after a reboot. So add by typing in the Xterminal "scite filetool.lst" in our backup file the line "home/dsl/.mozilla". Now every setting is restored after reboot.

7.2 A real word prozessor
Tes is nice but ....
So AbiWord is a nice solution. Small and quick :). Go to < http://ibiblio.org/pub/Linux/distributions/damnsmall/mydsl/apps/ >  and search for AbiWord. Do the same like in 7.1 but now with the AbiWord file. The setting directory of AbiWord is "home/dsl/.AbiSuite".

7.3 The new Fluxbox version
Go to < http://ibiblio.org/pub/Linux/distributions/damnsmall/mydsl/wm_apps/ > and search for the Fluxbox file. Download it and do the same like in 7.1/2 but don't add something in the filetool.lst file. Now to make the new update been started after a reboot do the following. Open Xterminal and type "scite filetool.lst" and add "home/dsl/.bash_profile". Then type "scite .bash_profile" and comment the linux witch starts with "if" (means add a #) the add on the end of the file "start_fluxdev" and save the file.  

7.4 Getting the icons on the desktop
After a reboot you get for AbiWord and Firefox a icon on the desktop. Or if you dont want to make a restart right click on the desktop Windowsmanager > Exit and then type "startx" when you haven't done 7.3 and "start_fluxdev" with 7.3 to get the new fluxbox.

7.5 Deleting icons on the desktop
Until now I don't know a better soltuion but it works. Open Xterminal and type "rm .xtdesktop/<name of the link/icon>.*" and replace <...> with the name of the icon you want to delete. If you dont know the name hit tab twice aber the / in .xtdesktop and all the files in this directory are visible for you


plz report any error to max.ebert@titoly.de thx

Posted by doom4 on Dec. 08 2004,17:25
does nobody needs help or have any question?

(sry i got one mail but i deleted it sry really perhaps post your question here or send it again)

greets doom4

Posted by cbagger01 on Dec. 08 2004,17:36
FYI,

Nice job on the HOWTO.

I have not used it personally, but it looks very well written.

Posted by Wolkenläufer on Dec. 10 2004,13:51
hm..i failed at 2.3 i cant find XTerminal in DSL 9.0.1

I tried it with bash but i got following message:

/lib/modules/2.4.26/kernel/drivers/usb/host/ehci-hcd.o init_module: no such device.

so, what is my fault?

Posted by Tekka on Dec. 13 2004,03:15
doom4: I went through each step and the different scenarious in your FAQ.

As it turns out I hda to manually extract the frugal_usb.tar.gz

When I run the frugal_usb.sh I receive an error stating the /dev/loop0 is not a valid device. I am especially concerned about that error becuase that mean I will not be able to create the boot image on the USB Drive.

Also when it attemps to copy the knoppix folder from the cdrom, that also fails. I am doing this all as root.

Do you have an insite?

Thanks in advance!

Posted by Wolkenläufer on Dec. 14 2004,09:59
whoops...xterminal is bash (found out with dsl-embedded)... :p  did i say im a noob?
i am only working at 8 bit on 1024 resolution cause of my tft, so i don't see any icons on the desktop...

Posted by ico2 on Dec. 14 2004,14:22
ooooooops, accidentally posted twice :s
Posted by ico2 on Dec. 14 2004,14:22
yep, gotta put that in the FAQ thread :)
Posted by doom4 on Dec. 14 2004,15:58
sorry tekka this error is strange cant help u hope somebody else can.  :(
Posted by bey0nd on Dec. 17 2004,08:49
i got an error with the frugal_usb.tar.gz:

gzip: Invalid magic
tar: Child returned status 1
tar: Error exit delayed from previous errors

does this mean the .tar.gz file is coruppted? i get this error if im trying to manually extract the .tar.gz or using dsl-usbinstall.
any ideas/suggestions? anybody with a "valid" .tar.gz who can host it somewhere to download from?
my usb-stick is hungry for a dsl-install ;)

edit: forgot to mention -> using dsl_0.9.0.1

Posted by bey0nd on Dec. 17 2004,09:07
ok got it on my own working:

wget < ftp://ibiblio.org/pub.....tar.gz >
mydsl-load frugal_usb.tar.gz
frugal_usb.sh

follow the steps prompted...

p.s.: this thread helped -> < http://damnsmalllinux.org/cgi-bin....;t=1688 >

Posted by Tekka on Dec. 17 2004,13:11
I GOTIT WORKING!

It didn't like mounting /dev/loop0 from my toshiba tablet PC.

I tried it again from a DELL 450 at my job and it worked fine.

Thanks all!

Posted by Numenor on Dec. 18 2004,12:08
Quote (bey0nd @ Dec. 17 2004,03:49)
i got an error with the frugal_usb.tar.gz:

gzip: Invalid magic
tar: Child returned status 1
tar: Error exit delayed from previous errors

does this mean the .tar.gz file is coruppted? i get this error if im trying to manually extract the .tar.gz or using dsl-usbinstall.
any ideas/suggestions?

have u checked the md5 value to make sure your download was correct?
Posted by Conzar on Dec. 21 2004,17:56
How do u install DSL onto a USB or Flash card from within an existing Linux Distro (Gentoo).
Posted by tawalker on Dec. 22 2004,19:32
I was unable to load the ehci-hcd module on my Compaq Evo N110 laptop. When I try "insmod ehci-hcd", it tells me "Operation not permitted"; yet if I try "sudo insmod ehci-hcd", I see that there is "no such device". All the other modules are present.

Silly question: do I really need this module to go further?

Thanks,
Tim

Posted by cbagger01 on Dec. 23 2004,01:18
ehci-hcd is used for USB 2.0  controllers.

Does your laptop support USB 2.0 or just USB 1.1?

Posted by tawalker on Dec. 23 2004,09:32
It's about 3 years old, so the laptop probably only supports USB 1.1. (The USB Flash drive I'm using is a Sandisk Mini Cruzer, so it's USB 2.0 - should be backwards-compatible, though.)

Maybe I'll give it another try and see what happens...

Thanks,
Tim

Posted by mikenac on Jan. 08 2005,04:28
Short Version

If you want the usb install script to work, do this (from a running DSL system):

Note: Make sure the usb drive is NOT mounted.

1. Open a terminal.
2. Load modules as in previous post.
3. Insert the usb drive.
4. 'dmesg | grep SCSI'  this should show you the device name (sda, sdb)  or use the cdrecord -scanbus
5. 'cd /home/dsl'
6. 'sudo dsl-usbinstall'

This will:

1. Download the frugal_usb.tar.gz
2. Download the bootusb-xxx.img.
3. Run the frugal_usb.sh script.

Posted by goddy on Jan. 20 2005,11:14
So, well, now I'm depressed: Whatever I tried, I didn't manage to save the configurations on my pendrive. I tried nearly every Howto, that I found on this board.

What I want to do: I want to add a Virusscanner to my DSL on USB Stick. I chose Bitdefender. So far I managed to install it, I managed to add the directory opt/bdc to the filetool.lst ... but it's not saving anything. Not even my Desktop configuration. I have the backup.tar.gz in my root on the pen. In powerdown.sh the line is uncommented. I'm booting with dsl restore=sda1...

Does anybody of you have an idea what is going wrong?

Posted by tronik on Jan. 20 2005,17:31
try to see if there is anything happening during shutdown. i know that many times when mine is attempting to back up, there is a race condition which causes the backup to err out and the backup doesn't actually get performed. if i do the backup manually (as i explain below) then everything works properly. i dont know when/if this will ever be fixed because it is a race condition and it does not happen everywhere and on everyones machines.

otherwise, to make sure, you can always check /opt/.backup_device to make sure its got the device you want to back up to entered in there, and then, use 'filetool.sh'

try typing (from a root terminal) 'filetool.sh backup' to backup the files in filetool.lst and 'filetool.sh restore' to restore the backup from the device in /opt/.backup_device

hope this helps.

Posted by goddy on Jan. 21 2005,14:19
Thanks for your help, that did the trick...
Posted by dazza on Jan. 25 2005,01:36
Found the HOWTO informative. Had alot of trouble early on. You must be in a root user shell not just the xterminal on the desktop.Could not load the ehci-hcd module as evan in root was not permitted. Try expert bootup and tried entering the module individually but didn't seem to work.
Used the file manager to copy the bootimage and frugal_usb.tar.gz over to the home/dsl. Then unpacked it in that folder. Didnt know right clicking on a file gives all these wonderful options. The from a root shell ran frugal_usb.sh. Had to make a small edit so it would bypass the sector check and then away it went. Install complete.
It might be worth editing the howto as the menu-apps-tools-install to usb pendrive only works with live internet connection. was never mention.
hope feedback helps

Posted by MaximeAD on Feb. 05 2005,15:55
Hello
I'm blocked on the point 2.5. When I do cfdisk /dev/sda it don't work... I tried with sdb and sdc but it's don't work.... What do I have to do to know wich take? I did cdrecord --scanbus, it detects my USB pendrive but don't say sda or sdb....
Thank you :D

Posted by reidar on Mar. 02 2005,17:52
Hi, this was a really useful thread! I have now managed to get dsl on my usb-stick with the frugal-usb script. Really nice!
Now, could someone tell me if there is a big difference between the frugal-usb script and the ordinary frugal install (to hd)? What I mean is: can I still just replace the knoppix-directory on my usb-stick with a new one to update my distro when a new version of dsl arrives, or is there a different approach with a usb-frugal?

-r

Posted by cbagger01 on Mar. 02 2005,18:13
Nope.  Just replace the file and you are in business.

The only exception is MAJOR reworking of the DSL base.  This happened between 0.5.3.1 and version 0.6  and again between 0.7.3 and 0.8

Basically, if you are still using the same kernel version, you should be able to just replace the \knoppix\knoppix file and then you are upgraded,

Posted by Crimsonhead on Mar. 02 2005,20:45
Hello DLS-Dudes...

My problem is that after booting the CD "dsl-0.9.3-syslinux.iso" the insmod ehci-hcd failed with "Operation not permitted". And cdrecord --scanbus yields that I have a USB 2.0 Stick. That's because the answer of the tools is:

Scsibus1:
 1,0,0 100) 'USB' 'Flash Disk' '2.00 Removable Disk'

And fdisk -l also fails with

Cannot open /dev/sda
Cannot open /dev/hda

And also cfdisk /dev/sda fails...

My system is relatively new. It's an ASUS A8V Deluxe Board with AMD 3200+ CPU and lots of memory.

I am lost now. When I boot "RIP9" or "FC3" then I have no problems with fdisk.

I haven't tried insmod 'ehci-hcd' with the aforementioned distros because I am too tired to do so at the moment. sorry.

Any help?

Crimsonhead

Posted by cbagger01 on Mar. 03 2005,18:09
Try typing:

sudo su

first to become the root user account.  Then try your commands again.

Posted by magowiz on Mar. 14 2005,06:22
Hi all,
First of all I want to thank doom4 for the very useful HOWTO;
I would like to know how to remove applications from dsl, the problem is this : in the laboratory of my university runs only winxp  :( and the only way to use DSL is to use the embedded version with qemu.
The embedded version is about 110MB large and I've got only a 128MB usb pen   :( .
How can I do?

Thanks in advance for every answer.

Posted by cbagger01 on Mar. 14 2005,06:49
Get rid of the 60MB virtual hard disk that comes with dsl embedded.

Or make a much smaller sized hard disk instead.  Go to the qemu web site for more details.

Posted by magowiz on Mar. 16 2005,23:11
This is not only a matter of disk space, I would like to create my own dsl removing applications that i don't need and adding applications that i need.
Anyone can help me?

Posted by cbagger01 on Mar. 16 2005,23:36
Search the forums and DSL documentation site for

remastering

Posted by doom4 on April 13 2005,21:48
i am very happy to see that this howto helped lots of people. i was in south africa when i ve written the howto and i think i forgot to enable track the topic hehe. sorry that i never answered. but i will track it now.

greets doom4

-----------

< http://www.titoly.de > -> Howto's for more
basically im german :)

Posted by Slack on April 14 2005,00:28
I tried everything with this USB booting issue, everything went fine and my BIOS in my laptop displays 2 extra boot options when I hit F8

USB-FDD and USB-RMD. I tried both nothing happens and grub continues to boot the normal OS from HD no matter how I change the BIOS.

Posted by doom4 on April 14 2005,07:24
i also had big problems with grub. in my first test with the usb stick and a self made small linux from gentoo i tried grub. it was horror to get grub out of the mbr of the usb stick. the boot load from dsl is not as "strong" as grub perhaps thats the reason or ur usb stick isnt boot able so u can do what ever u want and it will never boot. for example mostly all mp3 usb sticks arent boot able

greets

Posted by Kaizer on July 04 2005,05:30
Hello,

Before i Install DSL on my USB i want to know if the iPOD is compatable to DSL?

Can anyone let me know?

I am new to Linux and DSL is my first Linux.  Thank you

Have a great day,
Kaizer.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.