[techtalk] Running Linux from a zip disk.

Conor Daly conor.daly at oceanfree.net
Mon Mar 26 02:10:32 EST 2001


> --- Conor Daly <conor.daly at oceanfree.net> wrote:
> > On Thu, Mar 22, 2001 at 08:07:06AM -0800 or so it is
> > rumoured hereabouts, 
> > Maria G Martinez thought:
> > > > > 
> > > > I have a SuSE 7.0 Live Evaluation CD.  It boots
> > from
> > > > CD, installs a 100Mb
> > > > file on the HD for writeable space (including
> > /home)
> > > > which I think you can
> > > > resize or at least specify as larger and doesn't
> > > > affect the M$ setup at
> > > > all.  You're welcome to a copy if you wish.
> > > 
> > > OK.  I am extremely newbie (and rather dumb and
> > > ignorant).  How would a copy of the SuSE 7.0 Live
> > > Evaluation CD help me?
> > > I am interested, of course.
> > > 
> > Maria
> > 
> > In your first post on the subject, you said:
> > > The problem is that
> > > I literally live at school, where everything is
> > > windows and microsoft.  So I was thinking in the
> > > possibility of running Linux from a zip disk,
> > without
> > > having to mess up much with the computers.
> > 
> > Now, the SuSE CD contains a live linux system which
> > will boot from the CD.
> > The only problem is, since CDs are read-only, you
> > must redo any
> > configuration each time you boot.  To overcome this,
> > linux on the Evaluation 
> > CD creates a "home" file on your Windows drive that
> > will be used to store the
> > configuration and to serve as your home directory. 
> > This will simply
> > appear as a single file in windows and doesn't take
> > up too much space.
> > All you need is for the PC to be able to boot from
> > CDROM.
> > 
> > The advantages of this over linux on a zip disk are:
> > 
> > 1. The CD holds 640Mb vs 100Mb for the zip disk so
> > you can have more
> >    applications.
> > 2. Almost every PC has a CD drive while zip drives
> > are rarer.
> > 3. If you are on a network, you can copy the "home"
> > file onto the machine you 
> >    wish to run linux on.  This assumes you will use
> > different machines each time.
> > 
> > Disadvantages:
> > 
> > 1. You need something else as well as the CD (ie.
> > the "home" file on the HD)
> > 2. If you use different machines, you must either
> > setup each machine
> >    seperately or carry the "home" file around with
> > you (either on the
> >    network or else on a zip disk!)
> > 3. Slow access speed for CD.  You'll probably end up
> > wanting to install to
> >    a hard drive in the end anyhow.
> > 
> > Does that help at all?
> > 
> > Conor
On Fri 23 Mar 2001 18:55:33 -0800 or so it is
rumoured hereabouts, Maria G Martinez thought:
> Thanks a lot.
> 
> I am still pondering the possibility.
> I was thinking something like this (here i go
> demonstrating my newbieness and ignorance, oh well)...
 
You mean "providing fresh insight and inspiration to us old hacks" don't
you? :-)

> I am not allowed to install anything.
> Zero. Zip. Zilch. Nada.
> We aren't even allowed to save our homework files on
> the hard disk (although everyone does that, I wouldn't
> want to mess the fact that I actually got permission
> to run Linux as long as I don't install a thing).
 
So we need a means to boot from something, run from something and write to
something without writing to the HD...  It's all *horribly* complicated
but, given your special restrictions and requirements, seems like the only
way.  Of course, "horribly complicated" is just what computers are good
at, especially if it's the *same* horribly complicated sequence each time.

> So, I was thinking...
> Boot from a floppy (the BIOSes aren't as new as to
> boot from CD).  

That's fine first of all.  The crucial thing there is to have support for
both CDROM (usually IDE and generally already there) and zip disk (need to 
think about this) available on the floppy.  The floppy should also contain
the "init" program or script which takes care of the main boot sequence
after the initial bootstrap bit.  This takes care of mounting the
necessary bits from the other disks (the CDROM and zip disk) and getting
the system into a normal runlevel.

> Then, run the important stuff from the
> CD (the CDROMs are 50x).  

Again no problem.  At boot time, the filesystem on the CDROM gets mounted
on the appropriate point on the root filesystem.  I've used one live CD
where the CD gets mounted on /mnt/cdrom-real and the relevant bits are
accessed through symlinks like

/bin -> /mnt/cdrom-real/bin
/sbin -> /mnt/cdrom-real/sbin

and so on.  Everything bar /tmp, /var, /home and /etc would be mounted
from the CDROM.  

> And to keep specific
> configurations, as well as to use linux for something
> useful, a zip disk.

Now, *this* is the difficult bit.  You need to have support for the zip
disk available very early in the boot process (you probably need to
compile support into the kernel in fact).  If the zip disk is to carry
your configuration, then /etc will need to reside on the zip disk.  This
makes things difficult since the system uses stuff in /etc to determine
where to mount filesystems for example (including the filesystem on the
zip disk that contains /etc!  So /etc isn't available until the zip disk
is mounted but the system needs /etc/fstab to decide where to mount the
zip disk!  The solution to this is to use a "stub" filesystem which
contains only the basic stuff necessary to get the "main" filesystems up
and running.  So, here you would have a "stub" /etc which contains the
basic config necessary to access the zip disk and mount it so that the
rest of the configuration stuff is available to run up the main system.

Now, I don't have a zip disk myself to test on and I presume you are not
in a position to prepare all this stuff since you'd need a linux system to
do so and you won't have one of those until this is all working so we'll
need some kind soul with a zip disk to asist in this endeavour (any
volunteers?).

The three main requirements are:

1. A boot/root floppy.
2. A writeable zip disk containing /etc /var /home /tmp /root /dev?
3. A live CDROM containing /bin /sbin /usr /lib /dev?

1. The boot/root floppy needs two items:  A kernel with support for zip
disks and CDROM and an initial ramdisk containing the "stub" root
filesystem.  This stub will contain the init script and the basic
files and configuration necessary to mount the zip disk.  Once the zip
disk is mounted, it can take over the boot process.  At this stage the
floppy is no longer required.  (Note: the floppy should be imaged to the
CDROM using the dd command and the CDROM should also contain the
"rawrite.exe" program to regenerate the floppy when it wears out)

2. The zip disk will contain the main system configuration (in /etc) and
will also contain the main boot sequence in *its* version of the init
script.  This will mount the CDROM and continue the boot sequence.  This
disk will also contain the user's files (/home and /root for the superuser) 
and the "temporary" directories (/tmp and /var).  The zip disk can also 
contain /dev though I'm not sure if these need to be on a writeable filesystem.  
It's possible they could reside on the CDROM.  The zip disk could also
contain a subdirectory off /usr/local to allow for installation of new
software though this should be moved to the CDROM where possible.  The
swap space can also reside on the zip disk but could be placed on the hard
disk without violating the "don't keep stuff on the HD" rule[1].  Once
the CDROM has been mounted, the remaining processes can be started from
the CDROM.

3. The CDROM contains most of the programs for the system but, because of
its read-only nature cannot contain configuration information which might
be altered by the user.  It will usually contain /bin /sbin /usr /lib and
maybe /dev.  The CDROM will be mounted somewhere like /mnt/cdrom-real and
the directories incorporated into the main filesystem via symlinks.  

> I do have the chance to use basically the same
> computer most of the time.  Sometimes another one, but
> I could keep a zip disk with specific stuff for each
> of the puters.

Better still, you could use lilo on the boot floppy to determine which
configuration to load at boot time.  In most cases, it would be simply a
matter of loading differnet modules for different hardware and setting a
different IP address (assuming you're on a network).  Otherwise,
everything should be the same so the same zip disk could be used for 
both/three machines.  After three, things could start to get complicated.  
 
> How does that sound?  I wouldn't be installing
> anything in the hard drives.  I am sure that it will
> run very slowly, but I don't care, as long as I have
> fun with some Linux.  I am determined to do it, just
> for the heck, hack, and fun of it.  

Sounds good to me.  Will definately run slowly so you might find it better
to concentrate more on console applications and less on X and, if using X,
use a less memory greedy window manager (though loading from disk is what
will take the time but if the BIOSes are old enough not to support CD
boot, the machines will probably be low on memory also.  

[1] As you progress, you might find it useful to create your swap and temp 
space on the HD.  This won't violate your "Don't leave anything on the HD" 
rule since these files could be removed at shutdown / reboot (at boot time, 
use dd to make a file on the HD, use mkswap to format that as swap space 
and at shutdown, remove that file from the HD).  This will speed up many
operations since the HD access time will be considerably faster than the
zip disk access time.

> And to prove wrong a teacher *g*.

The most important reason! :-)
 
I'll be happy to assist with kernel builds and preparation of the CDROM
but the zip disk stuff will have to be provided by someone else since I
haven't a zip disk myself.  I could test the mounting of /etc from a
seperate filesystem but the zip support on  the floppy and how to mount
the zip disk would need to be tested by others.

HTH
Conor
-- 
Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)
---------------------
Faenor.cod.ie
  8:51pm  up 26 days,  6:25,  0 users,  load average: 0.00, 0.00, 0.00

Hobbiton.cod.ie
  8:00pm  up 26 days,  5:10,  1 user,  load average: 0.03, 0.01, 0.00




More information about the Techtalk mailing list