l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
April 21: Google Glass
Next Installfest:
TBD
Latest News:
Mar. 18: Google Glass at LUGOD's April meeting
Page last updated:
2002 Oct 30 00:09

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] How to make an OEM style "system recovery disk"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] How to make an OEM style "system recovery disk"



On Mon, Oct 28, 2002 at 09:10:10PM -0800, Ryan Castellucci wrote:
> I'm looking to build a bootable CD to give to a friend along with a computer 
> that when booted will offer to overwrite the hard drive from a compressed 
> disk image. I looked on freshmeat, but didn't see anything well suited to 
> this. The box in question will have windows on it (They want windows, I don't 
> feel like arguing). Anyone know of a project that can do this?

Project no, but tools available yes.

> What about linux boot CDs that can easily be customized to run a shell script 
> at boot time?

Easy.

> All the stuff i saw on freshmeat looked like it just restored files from a 
> backup.

Sounds close.

The trick with those bootable CDs is called the "El Torito" extension.
It's basically a 1.44 or 2.88 mb floppy image stored on the CD and booted
by chipsets that support it (any mobo in the last 3-4 years).  The system
thinks it's booted a floppy.

So, get what you want working using a floppy disk, and a CD-RW.  If you
were doing dos, the floppy would need to have the cdrom drivers, and so
forth to get the cdrom usable.  If linux, same thing applies, kernel with
cdrom drivers and/or initrd image.

Under linux, you can either replace /sbin/init on your filesystem with a
shell script, or you can use lilo and set "init=/bin/myscript.sh".

Once you have the floppy and the cdrom filesystem, you just use mkisofs to
merge the two and write the result to disk.  Trivial.

Under debian, look at the 'mkinitrd-cd' package.

#build an initrd image suitable for an eltorito bootdisk
mkinitrd-cd /lib/modules/2.4.18-386/ custom.initrd full
# extract the custom.initrd and monkey with the linux.sh script as
# desired.  stick a "zcat /cdrom/compdisk.gz | dd of=/dev/hda" in there,
# and you've got your "restore from compressed disk image".  Dangerous,
# but doable.

#build the eltorito bootdisk
mkbootimg 2880 /boot/vmlinuz-2.4.18-386 custom.initrd custom.eltorito

#build the iso
mkisofs -rRJ \
        -m '*/live/lib/modules/*' \
        -m '*/live/etc/X*' \
        -b custom.eltorito \
        -o custom.iso \
        diskdir
        # -r    all to uid 0
        # -R    Rockridge long filenames for unix
        # -J    MS Joliet lfn
        # -m    exclude files matching pattern
        # -b    eltorito boot image

I've a program that copies core libs and system data (/etc/*) and creates
a "live" directory heirarchy from the currently running machine.  This
allows me to boot the machine with the exact kernel and configuration that
it runs with, but to a live fs on the cdrom.  Useful for fixing things,
and playing around.

Note, you don't need a live fs on the cdrom to do what you want... the
kernel and an initrd image would be sufficient.

<plug>vmware makes tweaking and playing easy!</plug>

Caveats:

The only tricky part is the "mkinitrd-cd" command doesn't do everything it
needs to (too complex to tell you the stuff from memory), and working with
initrd images can be fun.  Getting a good kernel that will boot gz and/or
cramfs initrd images can also be fun.

Hint:  Use CD-RW media until you get it right.  There's enough of your
garbage in my landfill already.  :)

-- 
Ted Deppner
http://www.psyber.com/~ted/
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.