USB flash boot + USB flash embeded


Forum: USB booting
Topic: USB flash boot + USB flash embeded
started by: BadIdea

Posted by BadIdea on Nov. 18 2004,21:41
it would be nice if we could use a single installation on a USB flash card to boot into dsl and use the same card to launch embedded dsl. Would this be possible ?
Posted by cbagger01 on Nov. 19 2004,05:06
Yes,

It should be possible.

On my to-do list is to try and get a triple-boot USB pendrive of DSL 0.8.4

I probably won't be able to get to it in the next few days, but here is the approach. Much of it is borrowed from a previous post by myself on setting up a USB key drive with FreeDOS and the Dell bootable USB key utility:

1) Create a bootable USB device with FreeDOS using the Dell USB key utility.  Grab the latest version of the FreeDOS kernel and command file from the FreeDOS website because there are bugs in the default FreeDOS version that is supplied by the Dell program when it is used with FAT32 hard drive partitions.
2) Add the newer version of the loadlin program that is used for booting a linux 2.4.x kernel from DOS.
3) Copy the linux24 and miniroot.gz file over from the DSL USB boot floppy
4) Copy the unzipped dsl-embedded files over to the pendrive.  This inlcludes a dsl.iso file.
5) Create a loadlin config file to boot up the DSL kernel and miniroot with the following boot parameter:

dsl bootfrom=/dev/sda1/dsl.iso

6) Create a config.sys DOS boot menu that has choices to boot up into FreeDOS or DSL.  If you wish to run DSL Embedded from MS Windows, you just double-click on the dsl-windows.bat file on the USB drive while inside Windows Explorer.

You can also store your myDSL extensions on a virtual embedded hard drive located on the USB device.

The last hurdle is to figure out some way ( mount -t ext2 -o loop /sda1/harddisk /mnt/virtdrive  ????) to mount the virtual harddrive file while you are booting into Native non-embedded DSL distro.  This way, you won't need to store two copies of your myDSL extensions depending on whether you boot with native DSL or embedded DSL.  Another approach would be to use the mkmydsl script to create a custom dsl.iso file and replace the standard dsl.iso file with your new one.

Implementing these ideas should be possible. I or someone else just needs the time to do this.

Posted by dizzy on Dec. 14 2004,17:10
I have made a working triple-boot usb pendrive with dsl-0.8.4.

I used a modified minirt24.gz with the loop.o module, a loop-enabled
mount command and a hacked linuxrc. The trick is to mount the dsl iso
image and the harddisk image with the loop option and to specify the
extensions harddisk with the mydsl boot option. I didn't use the knoppix
bootfrom option because I wanted to mount both the dsl iso and the
harddisk image before init is started.

The boot from usb is done with syslinux on vfat (no freedos) or with
an usb bootfloppy. The qemu boot from linux or windows is done in
the usual way.

If you are interested I can upload my changes on a web site.

--
Massimo Dal Zotto <dz@debian.org>

Posted by ba55 on Dec. 15 2004,02:53
Dizzy, I am interested in reading your changes.  Please post a link.
Posted by cbagger01 on Dec. 15 2004,04:01
FYI,

I DID get DSL to triple boot from an *.iso file on a USB pendrive.

The new arrangement works as follows:

The drive is formatted to a bootable FreeDOS FAT filesystem using the Dell memory key boot utility program.  The FreeDOS kernel and command interpreter files were then manually replaced with FreeDOS 0.95b files to resolve the FAT32 read/write issue.

During bootup, a config.sys menu gives the user the choice to boot directly into FreeDOS command prompt or boot up DSL.

DSL is booted via loadlin.  I used the standard DSL kernel linux24 file that is part of DSL versions 0.8.x/0.9.x  but I needed to create a custom minirt24.gz file that contains not only the loop.o modules, but a bunch of other executables and busybox that is needed to use the "bootfrom" an *.iso file command parameter.  Originally, you can only execute a "bootfrom" for an ISO file if you are already booting from a KNOPPIX livcd compressed image but this customized miniroot avoids this requirement.   I needed to modify the linuxrc to delete the extra programs at the end because these files take up too much room inside the root filesystem.

I also installed dsl-embedded 0.9.0.1 on this thumbdrive and I use the same dsl.iso file for BOTH the embedded qemu bootup from MSWindows and also for the USB loadlin bootfrom

This eliminated 50MB of duplicated space on my thumbdrive.

Finally, the icing on the cake is this:

I create a qemu virtual hard drive image file on the thumbdrive similar to the 60MB harddisk image that is provided inside the dsl-embedded zip file.

But I can also use this "virtual hard drive" image file when I am running DSL natively via a USB bootup.  I create a mountpoint /mnt/qemuhd  and then I mount the first partition  inside my image file using the loop device and the offset parameter.

In this way, I can save user files and myDSL extensions in a place that is accessable by both my dsl-embedded session and my native DSL session.


Files can also be saved to the USB FAT directory if you are the "root" user (it does not work as username "dsl" for some reason), and they can also be accessed during a dsl-embedded session by doing the following:

1) Install samba.dsl into the virtual hard drive image, OR create a remastered dsl.iso that includes this extension.

2) In MS Windows, enable network sharing for your thumb drive. For example, if your thumb drive is E: drive, then enable network file sharing on E:\ drive.

3) After booting dsl-embedded, use samba command line program "smbmount" or the "linneighborhood" gui to mount your //WINCOMPNAME/E  file share.

Posted by dizzy on Dec. 15 2004,15:37
You can download the files from:

< http://people.debian.org/~dz/dsl/ >

Note that on my usb pendrive I have put qemu and the dsl images under /dsl
to avoid cluttering the root dir. I have also created a linux script which
boots the kernel directly without booting syslinux from the iso image.

I have also uploaded some init.d scripts which I use to customize the
standard DSL and keep my home directory on the harddisk image. You may
want to add some of them to next DSL, in particular dsl-fix-fbmenu,
dsl-fix-startx, dsl-fix-user and dsl-link-dirs.

--
Massimo Dal Zotto <dz@debian.org>

Posted by tawalker on Dec. 21 2004,13:10
Phew - the steps above sound more advanced than my current level of skill :;):

Are there any plans to automate creation of this "dual" option in a future version of DSL? It would be very useful if someone could code a menu option for the DSL desktop (similar to the existing "Install to USB pendrive"), which would install a dual bootable/embedded DSL system on a flash drive.

If the menu item idea is technically not feasible, how would I set up such a system using a Linux PC? (I haven't heard of the Dell bootable USB key utility mentioned above, and I assume it would be a Windows program.) I would really like to have the option of either booting from the pen drive, or falling back on the embedded option if booting is not possible.

Thanks for all your hard work on this system - it's pretty amazing now, and I think it can only get better!

Tim

Posted by rbarbera on Dec. 21 2004,17:44
Quote (cbagger01 @ Dec. 14 2004,23:01)
FYI,

I DID get DSL to triple boot from an *.iso file on a USB pendrive.

The new arrangement works as follows:

The drive is formatted to a bootable FreeDOS FAT filesystem using the Dell memory key boot utility program.  The FreeDOS kernel and command interpreter files were then manually replaced with FreeDOS 0.95b files to resolve the FAT32 read/write issue.

During bootup, a config.sys menu gives the user the choice to boot directly into FreeDOS command prompt or boot up DSL.

DSL is booted via loadlin.  I used the standard DSL kernel linux24 file that is part of DSL versions 0.8.x/0.9.x  but I needed to create a custom minirt24.gz file that contains not only the loop.o modules, but a bunch of other executables and busybox that is needed to use the "bootfrom" an *.iso file command parameter.  Originally, you can only execute a "bootfrom" for an ISO file if you are already booting from a KNOPPIX livcd compressed image but this customized miniroot avoids this requirement.   I needed to modify the linuxrc to delete the extra programs at the end because these files take up too much room inside the root filesystem.

I also installed dsl-embedded 0.9.0.1 on this thumbdrive and I use the same dsl.iso file for BOTH the embedded qemu bootup from MSWindows and also for the USB loadlin bootfrom

This eliminated 50MB of duplicated space on my thumbdrive.

Finally, the icing on the cake is this:

I create a qemu virtual hard drive image file on the thumbdrive similar to the 60MB harddisk image that is provided inside the dsl-embedded zip file.

But I can also use this "virtual hard drive" image file when I am running DSL natively via a USB bootup.  I create a mountpoint /mnt/qemuhd  and then I mount the first partition  inside my image file using the loop device and the offset parameter.

In this way, I can save user files and myDSL extensions in a place that is accessable by both my dsl-embedded session and my native DSL session.


Files can also be saved to the USB FAT directory if you are the "root" user (it does not work as username "dsl" for some reason), and they can also be accessed during a dsl-embedded session by doing the following:

1) Install samba.dsl into the virtual hard drive image, OR create a remastered dsl.iso that includes this extension.

2) In MS Windows, enable network sharing for your thumb drive. For example, if your thumb drive is E: drive, then enable network file sharing on E:\ drive.

3) After booting dsl-embedded, use samba command line program "smbmount" or the "linneighborhood" gui to mount your //WINCOMPNAME/E  file share.

Quote
using the Dell memory key boot utility program


Where can I get this tools?

I'm very interested in your Embebed + Native USB DSL aproach seems the ideal configuration for a USB pendrive!ç

Have you planned to make a distro fo this setup?

Thanks for all your ideas!
Rafa

Posted by rbarbera on Dec. 21 2004,17:46
I'm sorry for the horrible "full message quote" of the previous response. A very bad way to begin my posting in this forum  :(  :(  :(

Saludos,
Rafa

Posted by cbagger01 on Dec. 22 2004,00:21
You can get the Dell utility program here:

< http://www.bay-wolf.com/utility/usb_memkey.zip >

It is also possible to correctly format your drive for booting via an HP utility program or also in linux if you format and fdisk your drive using the correct geometry and partition size that is expected by the "Bootable USB BIOS".

I haven't cleaned up my approach to a point where it is usable for others with little interaction like Dizzy's system.

I actually like Dizzy's approach better because while having a FreeDOS/DSL boot system is cool, I don't really need the FreeDOS portion for any specific purpose other than to demonstrate the concept to people so it's really just a waste of space.

I also like the fact that Dizzy's approach allows the creation of a USB boot floppy. This is not possible with my approach because my custom minirt24.gz + linux24 is too big to fit on a 1.44MB floppy disk.

However, I do have concerns about using Dizzy's qemu hard drive as a persistent /home directory method because my Firefox browser Cache file writes could eventually wear out the flash drive.  If so, it would be preferrable to have the qemu hard disk image filesystem type set to JFFS2 or other "flash friendly" file system instead of EXT2.

So in my opinion, the best approach would be this:

A DSL / Embedded Pendrive dual boot setup with the standard SYSLINUX boot menu and command options that people already use today.  A custom "DSL / Embedded" USB boot floppy disk for computers that can't natively boot up via a USB drive.  Bootscript customization to allow retrieval of data from the qemu hard disk imagefile using standard DSL methods (IE: restore=  and mydsl= ) and an automatic entry into the /etc/fstab for the qemu hard drive image if possible.  And finally, this custom boot setup must support the booting of a "normal" dsl.iso file so the end user can "upgrade" their DSL / Embedded system by merely replacing the *.iso file on their USB drive with the newest version from the download site and/or create custom myDSL *.iso files.


Of course, it will take time and effort to create such a system and also to create a package+install method so that the system files can be downloaded by novice users and easily "installed" to their newly purchased USB drives of varing sizes and manufacturers.

I would expect that with the holidays, the earliest such a system would be ready for testing is mid or late January and this assumes that someone is willing and able to complete the task like Dizzy or others.  I may give it a try in my spare time but I wouldn't expect anything soon.  For example, it took me nearly a month before I slapped together my crude first attempt.

Posted by roberts on Dec. 22 2004,01:48
I have a working version based on dizzy's method. However, I will not be implementing the persistent home at this time. It uses the standard backup/restore and mydsl system consistent with the way things work now.
Posted by rbarbera on Dec. 22 2004,07:45
cbagger01, I must admit that I'm a complete newby to this project, and more issues escape my comprension, but seems to me that you and Dizzy have a complete and deep undestanding of this issue.

It's realy amazing the roadmap that you have sugested in your last message and I hope that you get the needed help for more able people that myself.

Thank you very much for your detailed response!

Saludos,
Rafa

Posted by rbarbera on Dec. 22 2004,17:38
Ok, after a couple of bad starts, I have a LG XTick 2.0 USB Drive booting with DSL. Y have also copied the embebed distribution so, now I have a "dual boot" system.

Now the last thing... How can I mount the HARDDRIVE virtual drive for the dsl-embebed inside de "native" DSL (the one working when I boot from the USB Drive)? I have read a message from drizzle about this at the begining of the thread, but it seems to me that I shoud replace some files on the startup image... a little advanced for me now :).

Thanks for your help and patience :)

Saludos,
Rafa

Posted by cbagger01 on Dec. 22 2004,18:28
Depending on how your virtual hard drive is formatted, you can mount it by doing the following:

First, make sure that your thumbdrive (usually /dev/sda1) is mounted.  There should be a green light for it on the mount.app bottom right corner of your desktop.  Then open a xterminal window and type:

sudo su
mkdir /mnt/qemuhd
mount -o loop -t ext2 /mnt/sda1/dsl_embedded_directory_name/harddrive_image_filename   /mnt/qemuhd


You may need to replace the "/mnt/sda1" with "/cdrom" or "/cdrom2" or "/mnt/sdb1" depending on the location of your USB drive and whether or not you have booted directly from the USB device.



Now if your hard drive image contains a partition table and multiple partitions (you will see /mnt/hda1 instead of /mnt/hda  when running from qemu-embedded)  then you will need to mount it differently.

See this thread for more help:

< http://groups-beta.google.com/group....&rnum=4 >

Posted by rbarbera on Dec. 23 2004,07:59
Quote
First, make sure that your thumbdrive (usually /dev/sda1) is mounted.  There should be a green light for it on the mount.app bottom right corner of your desktop.  Then open a xterminal window and type:


Je, je, je, I'm new to the DSL world, but I can determine if a drive is mounted  :;):

I have followed your instrucctions and it works! I can read and write the virtual HD. The only thing that I haven't see before is the -o loop in the mount command (any technical clue, please?). I belived that this need a modified loop.o (from the dizzy message).

Well, now the problem is when I try to restore a system backup from /mnt/qemuhd. I have put qemuhd as the backup/restore unit. When I press the "Restore" button, the window hang.... Perhaps is looking at /dev/qemuhd... Any way to use this virtual HD for the backup/restore?

Buy I can use myDSL with the optional DSL modules stored in /mnt/qemuhd/optional downloaded within a previous qemu session.

I the backup/restore finaly works this is all the "duality" that I need by now.

Thank you very much!!
Rafa

Posted by cbagger01 on Dec. 24 2004,03:09
If you want automatic restore from the qemu hd image, give roberts' triple boot embedded/USB boot system a try.

It has customized boot scripts that should allow for automated restore from a qemu virtual hard drive.

Posted by rbarbera on Dec. 24 2004,08:16
Quote (cbagger01 @ Dec. 23 2004,22:09)
If you want automatic restore from the qemu hd image, give roberts' triple boot embedded/USB boot system a try.

It has customized boot scripts that should allow for automated restore from a qemu virtual hard drive.

Thank you for the info, I have tried roberts' triple boot and works fine!!

Saludos,
Rafa

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