DSL Embedded + Ubuntu on USB?
Forum: USB booting
Topic: DSL Embedded + Ubuntu on USB?
started by: d33p
Posted by d33p on May 20 2007,20:34Hello,
I am wondering if this is possible: I would like to be able to boot both Ubuntu and DSL 3.3 Embedded from BIOS, as well as use both from QEMU+KQEMU, with a partition for config files etc. I realize GRUB will be neccesary, but will both OS be able to reside in the one visible partition when on a Windows system? Has this sort of thing been done before? I want to be able to use this in the wild, and it would enable either OS to be used either way, depending on how fast the system was and whether it gave admin access or not. Thanks.
Posted by curaga on May 21 2007,14:22I think it'll be possible.. But you can't use the partition from windows as it needs permissions for ubuntu..
I take this is for different machines? Will you have both Qemu for Win and KQemu for Ubuntu on that stick,
plus grub on the stick to choose between them?
Posted by d33p on May 21 2007,15:35My thought was as follows: four partitions. The first one (visible to windows) containing both Ubuntu and DSL QEMU launchers, which will point to the partitions containing the images (if that is possible). Otherwise, both Ubuntu and DSL in seperate directories with their own qemu launchers. If the first option works, DSL and Ubuntu in their own partitions, with GRUB pointing to them with BIOS boot. Final partition is file storage for both, formatted ext2 or ext3. Only trouble is, is it possible to have QEMU launch from a seperate partition while in windows? It is vital that both Distros be able to be launched while using any Windoze box in both ways (boot and QEMU). Where would I start to make this happen?
Posted by curaga on May 22 2007,15:00Start by making & formatting the partitions:
sda1 - fat32 and sda 2 & 3 & 4 - ext3
Then install Ubuntu and DSL natively to ext3 partitions.. Don't use Ubuntu's grub, install from DSL manually to sda mbr (the script aint good for usb devices...)
Oh how big is the usb stick? I think Ubuntu alone takes 2gb .... DSL'll fit to 60mb..
Then tweak 'til you can boot both from BIOS usb chainloading grub..
Then put stuff from DSL-embedded to sda1 not including KNOPPIX, then tweak, tweak, tweak....
Posted by d33p on May 24 2007,15:40Thanks for the response. It is a 4 gig cruzer, so no worries on the space. Are there any pre-existing tutorials that I can dissect and mix to reach my eventual goals? I know pendrivelinux has a few good ones, but it seems like I will need to do several things as you mentioned. My biggest concern is, how do I get both OSs' visible to QEMU boot while on a bimbo-box Windoze system in the wild? Since both DSL and Ubuntu will be on SDA(n+1), and therefore invisible to W$n, how does that work? I realize this is a self-teaching forum, and I hate to even be asking this many questions, but I feel like this may be a rather rare configuration I am shooting for. Can syslinux be used to chainload, or is GRUB still the best bet? Theoretically, can more than 2 (3, 4?) OSs be booted with QEMU while on a bimbo-box in the wild? I look forward to more responses, thank you so far.
Posted by Juanito on May 24 2007,16:07
See< here >for how to read multiple USB stick partitions in Windows
Posted by ^thehatsrule^ on May 24 2007,18:45Or you could just place everything on one partition...
Posted by d33p on May 25 2007,01:10Juanito,
Thanks for the tutorial. I actually was going to go this route, but unfortunately, it fails the "in the wild" test. Since you have to modify every computer you are going to use the pendrive on, it precludes using the pendrive on cafe bimbo-boxes and the like. If one could disable the removable media bit which tells W$n that it is removable media, I suppose it could be made persistent across machines without touching the host. It IS a great tutorial though, and I do appreciate it.
I am intrigued by the idea of just having everything on one partition. How would one put multiple OS on the one partition? This solves the QEMU problem neatly, but how would you keep DSL and Ubuntu from squabbling when booting from bios? With this method, I could still do two or three partitions, the one with the OS and QEMU bootfiles for each, and then ext2 or 3 partitions to save the respective /home folders for each (keeping at least THOSE separate).
I don't care how this eventually happens. My only requisites are:
Can be used on ANY computer without admin priviledges.
Can boot either DSL or Ubuntu from both QEMU and BIOS
Other than that, it does not matter. If it can be done on the one W$n partition formatted fat32, I will do it. Any suggestions on where to start? Thanks again for all the help, it is appreciated.
Posted by ^thehatsrule^ on May 25 2007,02:07
As for placing it in the same partition, all you have to do is change the bootloader's configuration (i.e. syslinux.cfg).
I'd probably say to install ubuntu on it first (using some FAT-like fs), then copy over DSL files (assuming frugal) - but I'm only saying that because I don't know how ubuntu's live version works.
For qemu, you can just change how it is being executed in the scripts.
And I think you might need to consider USB-ZIP or USB-HDD...
Posted by curaga on May 25 2007,13:04On one partition the best bet is to use loop files to keep ext* fs in... And the kernels and initrds out.
Then tweak the initrds to mount that loop file as root..
DSL can be fully on fat32, but Ubuntu cannot..
Posted by ^thehatsrule^ on May 25 2007,13:32curaga, google says otherwise though ;p
e.g. < http://doc.gwos.org/index.php/Ubuntuliveusb >
so it looks like my suggestion still stands
I suppose your home partitions (if you choose to use em) will be ext* though.
Posted by curaga on May 25 2007,15:00Oh. I was thinking about standard Ubuntu install..
Posted by d33p on June 03 2007,18:19Well, I am running into some issues. The Qemu aspect is mostly in hand: a script found on pendrivelinux solved the issue of multiple OSs booting from one partition, I just put each OS in their own directory and no sweat. The issues I am having now are getting these OS to boot from bios startup, as Ubuntu uses GRUB and DSL uses syslinux. Also, I cannot seem to get the linux-boot.sh script to launch DSL embedded from within linux, has this been changed? It does not show up in DSL 3.3 embedded at all. What is the current equivalent of the 5-way install? Thanks.
Posted by ^thehatsrule^ on June 03 2007,18:31Afaik the linux qemu script was removed because there were some problems with it (personally I never had a problem though...)
It's easy enough just to edit the .bat file of your choice though.
Just use 1 bootloader. It's transparent to the operating system so it doesn't matter which one you use (syslinux will have greater compatibility though).
Posted by d33p on June 03 2007,21:24Thanks for the response. So, here is what I am going to try: 1)install DSL 3.3 embedded onto pendrive using syslinux, using frugal install. 2)Get it to confirm boot from BIOS and QEMU. 3)Create an Ubuntu directory on the same partition, get it to also boot from QEMU. 4) Modify Syslinux script to recognize and boot Ubuntu from its directory. I will have created an additional two partitions on the drive, one a Casper R/W for Ubuntu in persistent, and one in ext2 for DSL to save settings. I only have a few more questions: what can I do to maximize the life of my pendrive? I want this to last for more than a few months, so which method of using these OS minimizes writes? Are there any flaws in the previous method? Thanks.
p.s. Have tried messing with the .bat script to regain Linux booting, but no joy. Are there any other required files to enable Linux in Linux booting?
Posted by ^thehatsrule^ on June 03 2007,22:40Your method sounds fine, although I cannot verify the ubuntu part.
Take the qemu line (other lines are mostly dos commands) and take out the ".exe" and it should work.
Posted by d33p on June 05 2007,02:21Alrighty, have succeeded in installing DSL embedded, and prepping for Ubuntu. Runs in Qemu and BIOS. Running into an issue with the partition though: I have a partition specifically for DSL to save to, formatted EXT3. Can save back to it (though with some difficulty) in BIOS boot mode (have to keep changing permissions to R/W), but no dice on QEMU boot. I understand that QEMU is a sandbox and needs to be shown where to save stuff, but should it not be possible to point it at the second partition (hda2 in this case)? I just don't want to have 2 separate backup/restore locations depending on how I boot it.
Secondly, is it possible to insert a script in the .bat and .sh QEMU boot files to take advantage of KQEMU? It takes up very little extra space on the drive, and I would like any and all extra speed I can get out in the wilds. the QUB.bat file I am going to use for Ubuntu QEMU has a script for KQEMU, but obviously net start KQEMU is not going to work in a linux environment.
Finally, will using the frugal install default preserve the life of the pendrive? I don't want to kill this little guy with excessive writes. Thanks, will keep updating as I go along.
Posted by ^thehatsrule^ on June 05 2007,04:13The easiest solution I've seen with qemu is to use a virtual harddisk for it, and then for native DSL boots use the cheatcode "qemu" - see readme.txt for more info. Of course there are other solutions.
The KQEMU module is required to be compiled, etc. and inserted into the host machine - so I'll be assuming you have admin/root privileges on your target computers? (did you try modprobe kqemu for linux) And then make sure you take off the -no-kqemu flags and you should be set. With newer stock kernels that include KVM (2.6.2x ?), you could use the modified qemu and take advantage of it (assuming your cpu is capable).
Frugal is the best choice - but you may want to have it mount the root partition (the one that contains the DSL/KNOPPIX image) as read-only. If you haven't already, take off "frugal" from your list of cheatcodes. There's already been several threads on this type of topic though.
Posted by stupid_idiot on June 07 2007,09:35This frugal thing can be done manually.
Currently running DSL off my hard drive together with Debian Sarge + Sid. All I did was mount -o loop the ISO and 'cp -av' everything onto /mnt/hda8.
Here's my GRUB entry in menu.lst for DSL:
title DamnSmallLinux 3.3
kernel /boot/isolinux/linux24 fromhd=/dev/hda8 ro acpi=off \
apm=power-off quiet noscsi nofw nousb noicons toram lowram vga=791 \
The file /KNOPPIX/KNOPPIX in the ISO is mounted as UnionFS; any changes you make to files when DSL is running occurs in RAM. So nothing at all is written to your USB drive except for the homedir backup tarball that will be saved when you shutdown. This will be called user.tar.gz and will be very small unless you increase your firefox cache size.
As for Ubuntu, if you get the LiveUSB version it must be technically similar.
Posted by ^thehatsrule^ on June 07 2007,15:05Well that depends if he's using unionfs but if he has enough memory, using legacy with legacy extensions (i.e. .dsl's instead of .unc's) might be better since it would save reads, unless you copied it into the ramdisk first.
And isn't the backup tarball called backup.tar.gz?
Posted by stupid_idiot on June 12 2007,04:10
Yes - It's called backup.tar.gz, not user.tar.gz. Sorry.