Support free software or g4u WILL die! |
| ![]() |
For the curious, I've added a few screenshots:
In addition to that, you may want:
You can also download from one of these mirrors:
4.1 Preparations
If you're using DOS, use rawrite.exe. There's also a Windows-based program available called rawrite32.
If you want to use a different account, you can specify "login@server" for slurpdisk and uploaddisk.
4.2 Image creation
If you want to clone your second IDE disk, add it's name on the uploaddisk command line: "uploaddisk your.ftp.server.com filename.gz wd1". Similarly, if you use SCSI instead of IDE disks, use "uploaddisk your.ftp.server.com filename.gz sd0".
If you want to use a different account name than "install", use "account@your.ftp.server.com" for both uploaddisk and slurpdisk.
4.3 Image deployment
If you want to restore to a SCSI disk, add the disk's name to the slurpdisk command line, e.g. "slurpdisk your.ftp.server.com filename.gz sd0".
See above if you want to use an account name other than "install".
4.4 Copying a disk locally
A list of disks as found during system startup can be found using the "disks" command.
5.1 Supported filesystems
5.2 Supported Operating Systems
With some minor effort, g4u can even be used to deploy operating systems for non-PC based SCSI machines running HP-UX, Irix, Solaris, AIX etc.
5.3 Supported Hardware
g4u does currently not support a lot of laptop/notebook hardware (PCMCIA/CardBus, FireWire), sorry.
5.4 A word on disk sizes
If you cannot avoid preparing an image on a big disk that'll get deployed to a small disk later, make sure the "extra" space is not occupied by a active partition or filesystem, else data loss is very likely to occur!
If you intend to deploy a "small" image to a "big" disk, the extra space that's not covered by g4u can be used for creating a partition and a filesystem. You will have to do that on your own, e.g. using your operating systems' post installation steps.
5.5 Changing compression level
# GZIP=-1 uploaddisk your.ftp.server.com filename.gzYou can change compression levels between 1 (fast, little compression) and 9 (slow, maximum compression). Of course you can specify all the usual options to uploaddisk.
5.6 List of recognized disks
# disks wd0 at pciide0 channel 0 drive 0:The above example shows a 6GB IDE harddisk.wd0: drive supports 16-sector pio transfers, lba addressing wd0: 6149 MB, 13328 cyl, 15 head, 63 sec, 512 bytes/sect x 12594960 sectors wd0: 32-bit data port wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
5.7 Problems with images at 2GB
So far, whatever FTP server comes with NetBSD, Solaris and Windows 2000 has been used without problems.
5.8 Can you add feature XXX?
The problem with them is all the same: they need space, and there is already too little on the floppy due to the many drivers contained on it. Suggestions on what drivers to remove are welcome. Moving away from floppy to CD-only distribution is not an option for me at this point, sorry.
5.9 Problems with network performance
Enforcing 100BaseTX/Full-duplex
# ifconfig fxp0 media 100BaseTX mediaopt Full-duplex # ifconfig -a fxp0: flags=[...] media: Ethernet 100baseTX full-duplexUsing autonegotiation (default)
# ifconfig fxp0 media auto # ifconfig -a fxp0: flags=[...] media: Ethernet autoselect (100baseTX)
For more information, please see the ifconfig(8) manpage as asll as the Auto-Negotiation Valid Configuration Table featuring "Why Can't the Speed and Duplex Be Hardcoded On Only One Link Partner?".
5.10 Reducing the image size
But there is an easy way to circumvent the problem: use the native operating system's understanding (and implementation) of the filesystem, and make sure it prepares empty/unused blocks in a way so they don't contain random garbage data but values which can be compressed easily by g4u, thus resulting in small image sizes.
Effectively, you just fill up the disk's unused blocks with zero-bytes. Open file for writing, stuff in 0-bytes until the disk is full, then close the file and remove it. The result is that all unused blocks were used by the file, and filled with data that g4u can then compress easily. Usually the operating system will just mark the blocks as unused, without changing the actual data content.
Using this technique on a 20GB disk that had 6GB Solaris 8/x86 and the rest Windows 2000 Workstation shrunk the image from ~6GB compressed to ~2GB compressed. You can probably imagine the effect of this on deployment time too. :)
To perform the filling of unused data blocks with zero-bytes, there are several ways, depending on what operating system you use on your computer, and what software you have available:
dd if=/dev/zero of=/0bits bs=20971520 # bs=20m rm /0bits
cd /d c:\ c:\win-preclone.pl c:Click here to download the win-preclone.pl perl script.
5.11 Setting IP-number manually
ifconfig -aYour network device is something like "ex0", "tlp0", etc. (Note that unlike in Linux, NetBSD doesn't call all ethernet cards "eth0"!)
ifconfig xx0 1.2.3.4 netmask 255.255.255.0
route add default 2.3.4.5
5.12 Extracting the g4u kernel
% dd if=g4u-1.17.fs bs=512 skip=16 | tar vxf - -r--r--r-- feyrer/cvs 53788 2004-07-15 02:49 boot -rw-rw-r-- feyrer/cvs 1397892 2004-07-15 02:49 netbsd 2864+0 records in 2864+0 records out
To rebuild the images:
% su # mkdir /usr/cvs # chown $USER /usr/cvs # ln -s cvs/src /usr/src # exit % cd /usr/cvs % env CVS_RSH=ssh cvs -d anoncvs@anoncvs.netbsd.org:/cvsroot co -D 20040412 src
% ./build.sh -N 1 -U distribution
% setenv T /usr/src/obj.i386/tooldir.NetBSD-1.6.2-i386/bin
% cd /usr/src % tar plzvxf .../g4u-1.17.tgz
% cd /usr/src/sys/dev/ata % patch wd.c <wd.c.patch-g4u % cd /usr/src/sys/dev/scsipi % patch sd.c <sd.c.patch-g4u
% cd /usr/src/distrib/i386/floppies/g4u % $T/nbmake-i386
% pwd /usr/cvs/src/distrib/i386/floppies/g4u % ls -l g4u.* -rw-rw-r-- 1 feyrer cvs 1572864 Apr 12 17:48 g4u.iso -rw-rw-r-- 2 feyrer cvs 1474560 Apr 12 17:48 g4u.fs
Today I had to discover that someone used g4u as a source for g4l, but instead of giving proper credit and respecting the licensing and copyright on g4u, all traces were removed that the core work was done by me. Instead, the author put his name in and his work under a different license. I'm not happy about this, and ask people to discourage such actions as well as to despise the the author of g4l (cowardly calling himself only "nme"). Read more about this in my blog. | ||||
1.17 | Major bugfix release which intends to address all the flaws in previous releases (see release notes for 1.15 and 1.16)! Besides the Freshmeat g4u page, interested parties can now find a g4u community with forum etc. on Orkut - drop me a mail if you want/need an invitation or have any questions (just as before :)! [20040718] | |||
Back to 1.15! | There's a critical flaw in slurpdisk and other restore facilities in 1.16, which render g4u 1.16 unusable. The QA team has been fired, and we're back to 1.15. Sorry! :( [20040702] | |||
1.16 | OK, let's see if I got things right this time: Fixed copydisk, which I broke while adding the progress bar code. Document default GZIP level when calling uploaddisk and uploadpart with no argument. Shaved more space from the config by going for the generic PCIIDE driver (only; please let me know if this made things a lot slower and if it killed SATA-support esp. if enabling IDE in your BIOS won't help - and send me a SATA-equipped machine to test this in the future! :-), removed 'rnd', gave the kernel a fixed device to start from (the ramdisk), removed COMPAT_*. Replaced console driver - you may need to turn on support for USB keyboards in your BIOS! [20040630] | |||
still 1.15 | There's a bug in the "copydisk" command of g4u 1.15, please use g4u 1.14 if you need the copydisk command. | |||
still 1.15 | I have a donations page now! | |||
1.15 | Finally: Improved progress
report! No more dots, volume transferred and current
throughput is printed instead. Other changes: 'help'
command to re-print help screen; update help screen
a bit and made the prompt look a bit friendlier.
Consistent GZIP handling.
Building as
non-root is now fully working (Thanks NetBSD!).
No more Token Ring drivers,
sorry, ran into space issues again.
Thank for everyone who has donated so far, I'm working
on a donations page. FWIW, donations of books from
Amazon are welcome as well, see my
wishlist:
![]() | |||
1.14 | After some minor *cough* bugs in 1.13, here's 1.14. No more "file system full" etc., no functional changes either. Added a few screenshots to the documentation. Keep the donations coming! :-) [20040218] | |||
Still 1.13 | Source update! The sources released for 1.13 had a small problem (missing gz_compress, etc. while linking), I've updated the g4u-1.13.tgz source archive. Proper checksums are 2226011164 (CRC, cksum(1)) and fa2e2f00b079be1a9cf1c81d625896b1 (MD5). [20040122] | |||
1.13 | 13's a bad sign, and version 1.13 means so
for g4u. Due to my job situation I'm not
sure if I can continue working on g4u in the
future. Your donations can motivate to do
so - paypal@feyrer.de is waiting for you.
Today, g4u is mentioned in in one place with
commercial products like PowerQuests's
DriveImage and Norton's Ghost. g4u is free
software and I hoped upon it's users to
support it via donations. If I just got $10
from everyone sending me questions about
g4u, that'd be more than enough. Fact is
that only 1 person has donated back some
money so far. Here's your chance to
contribute back to the Open Source community
- join in!
Griping aside, V1.13 is a wrapup based on NetBSD-current as of Jan 14th 2004, esp. made after many people hat troubles booting 1.12. New drivers are for Adaptec 29320, 39320 (aic790x) SCSI (ahd), Broadcom 4401 10/100 Ethernet (bge), DECchip 21x4x and clones Ethernet (tlp), Intel 8254x gigabit (wm), Intel IGP01E1000 MII driver (igphy), Intel i31244 and SiI SATALink SATA controllers. See the g4u kernel config file for all the details. Matthias Jordan has also sent me an update of his "nullfile" to v1.02 which I've added to the g4u webpage. Due to some things growing again, I had to remove all Wireless LAN and most PCI RAID controller drivers. Maybe it's time to start special g4u versions for laptops (with pcmcia, cardbus, usb, wavelan), servers (with raid, ...) in addition to the current version of g4u. Let me know if you're interested! [20040111] | |||
1.13pre2 | Prerelease of 1.13 ISO after many people had problems booting the 1.12 ISO. No new features, but two administrative things to note: First, I've lost my job on Jan 1st 2004 due to the Bavarian government killing jobs in academics. That job was the main motivation behind creating g4u, and development of g4u beyond that date is uncertain. I plan to do at least one more release to wrap up things, but that'll need some more time to decide what drivers to include (not). Second, I have created a paypal account paypal@feyrer.de, if you want to donate money, buy me a pizza or coke or just SUPPORT FREE SOFTWARE, do so! (Judging by the feedback I got both in personal mail and in public forums, g4u seems to be a major alternative to some commercial products these days. I'd be happy if the people using it could give some money back to make it possible to continue working on the project! Yes, this is a plea for help!) | |||
1.12 | Fix broken dd commmand ("out of memory!"). [20030820] | |||
1.11 | New commands "uploadpart" and "slurppart" to save and restore partitions. Partition information is not changed and taken from MBR. Command 'disks' to list disks found, command 'parts' to list (BSD!) partitions on a given disk (wd0, ...). "uploaddisk" now has a default of rwd0d.gz for the imagename, so just "uploaddisk server" should work (just as "slurpdisk server" does already). [20030819] | |||
1.10 | Bugfix release: make "GZIP=1 uploaddisk ..." work properly; document how to use a different account than 'install'. Document how to get the image size down by filling unused disk blocks with zero-bytes. [20030603] | |||
1.9 | Maintenance update for NetBSD-current as of today; "dmesg" is now page-wise (|more); "disks" lists disks recognized on boot; allow setting GZIP=-1 to get lower compression; increased NMBCLUSTERS for usb2ethernet; Cloning from local disk to local disk with "clonedisk"; Lots of doc updates. [20030522] | |||
1.8 | The Pumpkin Release! Sync with NetBSD 1.6. Now includes drivers for USB, RAID cards, Gigabit Ethernet and Token Ring. As a Halloween special, g4u now also comes as ISO image file in addition to a floppy image, so it can be booted from a CD instead of a floppy. Happy Halloween! :) [20021031] | |||
1.7 | Update to accomodate latest drivers and kernel features from NetBSD 1.5.2. Fixed download of the .fs files from the web server. Added documentation about disk sizes. [20010919] | |||
1.6 | Maintenance release to use latest drivers from NetBSD 1.5.1. Due to increased size, the Token Ring driver was removed, sorry. Greeting message of g4u with instructions was improved a bit. Web site now has a copy of the kernel config, for documentation of supported device drivers. [20010516] | |||
1.5 | This release adds support for easy cloning of SCSI disks by giving "sd0" as the third argument to slurpdisk and uploaddisk. Also, support for i386 and i486 CPUs was added. [20010515] | |||
1.4 | Maintenance release. [20010306] | |||
Played with GIMP to create the Animation next to the TOC. Thanks to the XBill artists for the OS images! Various doc updates. [20010306] | ||||
Updated the web page a bit to answer various questions on supported filesystems and operating systems I got. Also add TOC. [20010305] | ||||
1.3 | Another bugfix release. This should get to a working state soon (i.e. now) [20010302] | |||
1.2 | Bugfix release, the ramdisk was busted so that many commands just didn't work (ftp, ...) [20010301] | |||
1.1 | First public release, updated to NetBSD 1.5 [20010228] | |||
1.0 | Internal version based on NetBSD 1.4 that's been in use for two years in internal operation. |
No license fees are requested,
donations are always welcome! You can
send money via paypal or buy me a book from my
Amazon wishlist, as many of the people
who have donated so far did - Thank you very much!
g4u is distributed under the standard BSD license: |
![]() |
/* * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004 * Hubert Feyrer. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed for g4u by * Hubert Feyrer <hubert@feyrer.de>. * 4. Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */