ghost for unix
日期:2008年2月27日 作者: 查看:[大字体 中字体 小字体]-
Type "slurpdisk your.ftp.server.com filename.gz". This will log into the FTP server's "install" account, verify the password, then retrieve the image, uncompress it and write it back to /dev/rwd0d.
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".
- One partition:
Use "slurppart your.ftp.server.com filename.gz wd0e" or whatever values you passed to uploadpart. Please note that the partition information is taken from your MBR, which is expected to be the same as before image creation - expect surprises if you change something between image creation and deployment. In case of inevitable changes, check the start sector and size values given by "parts". For an image that includes the MBR, do a full backup with "uploaddisk". - Reboot the machine (type "reboot" or press reset button), and see if your machine comes up as expected - it should!
4.4 Copying a disk locally
- If you just want to copy one local disk to another one with no network & server involved, the "copydisk" command is what you want. E.g. to copy the first IDE disk to the second IDE disk, use "copydisk wd0 wd1", to do the same for SCSI disks run "copydisk sd0 sd1".
Beware! All data on the target disk will be erased!
A list of disks as found during system startup can be found using the "disks" command.
4.5 Copying a partition locally
- If you want to only copy one local partition to another local partition (similar to what 'uploadpart' and 'slurppart' do, just without the network and FTP in between), this can be done with the 'copypart' command. It takes two partition names as arguments, and copies the contents of one partition to the other. As an example if you found you want to copy your first local partition 'wd0e' to the second one 'wd0f', run:
copypart wd0e wd0fA list of disks can be found using the 'disk' command, to list all the partitions on a disk use the 'parts' command. Partitions have the form of "wd0d", "w1e", "sd1f".
Be aware that the partitions to copy should have identical size (down to the sector), else funny things will happen. When copying a 'big' partition into a 'small' one, g4u won't thrash the data behind the 'small' partition, but of course the copy is not complete either. Take special note that that case could happen when you restore a copy made that way, and which went fine when you first copied your small working partition to your big backup partition!
5. FAQs and hints on disk cloning
5.1 Supported filesystems
- One of the questions arising a lot is "what filesystems does g4u support". The answer is: "all of them". g4u reads the disk bit by bit, starting from byte #0 to the end. It includes any MBR, boot record, partition table and the partitions themselves without further investigating the structure of the data stored in these partitions.
5.2 Supported Operating Systems
- The question on operating systems that can be deployed with g4u is the same as for the filesystems: any. Given the image-approach again, g4u is able to handle any operating system. Systems that were cloned successfully include NetBSD, Linux, Novell Netware 4.11 and 5.1, Solaris/x86, Windows NT, 2000 and XP.
By moving the harddisks to a PC, 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
- The system running g4u itself can have IDE, SATA, SCSI or RAID disks with various controllers (Adaptec, ...) as well as wide range of PCMCIA, Cardbus, ISA and PCI network cards. Please see the g4u kernel config for the full list of supported hardware.
If you're unsure if your hardware is supported, simply boot g4u and see if your network card gets listed by "ifconfig -a" and if your disks get listed by the "disks" command. If not, adding relevant parts of "dmesg" output (from g4u; press space bar to scroll down) is required for analysis if you ask for help. See "Reporting problems" for more information.
5.4 A word on disk sizes
- The question how g4u deals with different disk sizes arises a lot too. The general answer is, g4u works best with identical disk sizes & geometry. Putting an image from a small disk on a big disk works, putting an image from a big disk to a small disk is likely to cause problems.
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
- Per default, images uploaded to the FTP server are compressed with "gzip -9". This saves as much disk space as possible, but also takes a long time - several hours are not uncommon. You can reduce the gzip level for "uploaddisk" by setting the GZIP environment variable:
# 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
- During startup of g4u, all devices recognized are listed, but very fast. To get a list of recognized disks, use the 'disks' command:
# 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
- Do you experience g4u aborting file transfers after the image has grown to 2 GB on the FTP server? The problem here is not g4u, but most likely your FTP server. Some older Linux distributions are known to only allow files of up to 2GB filesize, and even if there is a Linux 2.4 kernel running, that's no guarantee for a properly working server. Make sure that your ftp daemon is upto date, or install a decent operating system.
So far, whatever FTP server comes with NetBSD, Solaris and Windows 2000 has been used without problems.
5.8 Can you add feature XXX?
- I got requests for adding many features to g4u:
- using TFTP
- using SSH/scp
- using NFS
- adding a X or curses based GUI
- writing images to CDROM / deployment from CDROM
- bzip2 compression
After moving to a two-floppy set for g4u, some of these features may be added in the future, while others (X...) are not likely. Stay tuned!
5.9 Problems with network performance
- If upload performance is weak (less than 5MBytes/sec on a 100BaseT Ethernet switch) even with a small compression level or a fast CPU and the harddisk is idle this means the network sucks. A common problem in switched Ethernet is a duplex mismatch between the NIC and the switch. In NetBSD, the default is to negotiate speed and duplex automatically. Other settings can be set manually.
Enforcing 100BaseTX/Full-duplex:
# ifconfig fxp0 media 100BaseTX mediaopt Full-duplex
# ifconfig -a
fxp0: flags=[...]
media: Ethernet 100baseTX full-duplex Using autonegotiation (default):
# ifconfig fxp0 media auto
# ifconfig -a
fxp0: flags=[...]
media: Ethernet autoselect (100baseTX)
For more information, please see the ifconfig(8) manpage as well 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
- People complain that the image resulting from g4u is very big. This is normal as g4u clones the whole disks with all blocks, not attributing if they contain any valid data or if they are empty/unused. To find empty/unused blocks (and not clone them), g4u would need intimate understanding of the contained filesystem, which is different again for each filesystem - Windows FAT, Linux Ext2/3/ReiserFS/..., BSD FFS, Solaris UFS, etc. Given both tight space limitations on the floppy as well as shortage on filesystem documentation and implementations available, teaching g4u to ignore empty blocks is not likely to happen.
- Standard Unix:
- This works on any Unix variant - Linux, NetBSD, Solaris, etc.:
dd if=/dev/zero of=/0bits bs=20971520 # bs=20m rm /0bits
- Windows Perl solution:
- This one needs perl installed. In a command shell, type:
cd /d c:\ c:\win-preclone.pl c:
Click here to download the win-preclone.pl perl script. - Windows Pascal solution:
- This pascal program was contributed by Matthias Jordan [mjordan at code-fu dot de]:
- nullfile-1.02.exe
- nullfile-1.02.pas
- 64bit Windows binary:
- Dominic Leelodharry [dominic at authorsoftware d0t com] also sent me a binary for 64bit Windows:
- nullfile-1.01_64bit.exe
- Windows "Erasor":
- This freeware program can erase your disk in a safe way, but it can also be told to just write a pattern of all-0-bits to the disk. Grab it at www.heidi.ie/eraser. Thanks to Stephen Krans [s040 at krans dot org] for the hint!
- Windows "onboard" solution:
- Aparently Windows XP comes with a tool to do some harddisk encryption that can also be used to write 0-bytes to the disk. To do so, run the following command: cipher /W:C: for drive C:. You will need to abort (Control+C) after the first round, else it will write random data after filling the disk nicely with 0-bytes.
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:
5.11 Setting IP-number manually
- Sometimes you may not want or be able to use DHCP. In that case doing the network configuration manually is possible with g4u, too:
- Find out if your network device is recognized, and by what name, using the command
ifconfig -a
Your network device is something like "ex0", "tlp0", etc. (Note that unlike in Linux, NetBSD doesn't call all ethernet cards "eth0"!) - Next configure the network device's IP number and netmask. It is assumed that your network device is xx0 here, and that the machine should run with IP number 1.2.3.4 and netmask 255.255.255.0:
ifconfig xx0 1.2.3.4 netmask 255.255.255.0
- Last, you may want to make the default router known unless your FTP server is in the same IP subnet as the machine you want to use g4u on. Let's say the default router's IP address is 2.3.4.5, then the command to enter is:
route add default 2.3.4.5
5.12 Extracting the g4u kernel
- I've been asked how to boot g4u from harddisk (using e.g. grub). The idea is to extract the kernel from the boot floppy, and hand that to grub (or whatever bootloader you want - maybe use PXE to netboot g4u). Here's how to extract the kernel, named "netbsd":
% ( cat g4u-2.1-1.fs dd bs=512 skip=16 ; \ ? cat g4u-2.1-2.fs dd bs=512 skip=16 \ ? ) tar vxf - -r--r--r-- 1 feyrer netbsd 53948 Nov 3 23:08 boot -rw-rw-r-- 1 feyrer netbsd 1479905 Nov 3 23:08 netbsdNote that the kernel ("netbsd") is actually still compressed, which is fine for the NetBSD bootloader and probably GRUB, but just in case, you may want to uncompress it:
% file netbsd netbsd: gzip compressed data, was "netbsd-INSTALL_G4U", from Unix % mv netbsd netbsd.gz % gunzip netbsd.gz % ls -la netbsd -rw-rw-r-- 1 feyrer wheel 5523084 Dec 7 18:08 netbsd % file netbsd netbsd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
5.13 Netbooting g4u via PXE
- In order to netboot g4u via PXE, you first need to extract the kernel from the g4u floppies, and then follow the steps that describe a netboot (diskless boot) of NetBSD/i386, see the NetBSD documentation for various ways to do this.
A writeup of the necessary steps for g4u is available in the list archives, either in french language by Jean-Christophe Guis or in an english language translation by Steve Clement.
6. Support and reporting problems
- Mailing list: g4u-announce@feyrer.de
- 上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页
-
- ghost for unix 相关文章:
- ·下载者木马防查杀破坏Ghost备份
- ·数据恢复案例:ghost成大c故障
- ·大家说这比Ghost好?指尖操作系统试用
- ·玩转数据同步 巧用快车远程ghost光盘
- ·快捷方便 Ghost打造自助恢复系统
- ·“一键GHOST”系统备份与恢复
- ·视频教程:Ghost软件的详细使用方法
- ·快速恢复 Ghost定制“无忧系统”
- ·Ghost使用异常情况及应对方法
- ·巧用局域网进行GHOST多播装系统
- ghost for unix 相关软件
- ·《星际争霸》录像:Nal_keke vs DkH.Ghost
- ·集成GHOST8.3的深山红叶 ISO 自制
- ·GHOST WINDOWS-SP2 感觉系统很快 GHO 621M
- ·UghostXP1.3 ISO Uyghurche 维文
- ·制作集成、Ghost光盘、自启动光盘 文件格式 查看
- ·ghostwin2000纯净专业版 gho
- ·目前中国最快最好用的XP系统 天宇7.5版美化GHOST XP
- ·番茄花园 GHOST XP SP2 v 2.0
- ·体现安全速度和稳定GHOST XP终极修正版 ISO 纯净版啦
- ·软件 jujumao-ghostxp家庭安装美化版 iso 699mb
- 特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作
- 者.文章版权归文章原始作者所有.对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转
- 载的文章有版权问题请联系编辑人员,我们尽快予以更正. 转载请注明来源:http://www.hackhome.com
6.1 Support
- The following ways of getting support for g4u exist:
下一篇:C++资源之不完全导引 [上]
精品推荐
热点TOP10
- ·图象处理中的边缘检测------canny算子
- ·EZ-USB 68013A开发指南
- ·[分形]DLA团簇模型的摸拟
- ·Windows下BMP文件的读取及显示
- ·MIDP 2.0 开发J2ME游戏起步之二
- ·Palm OS应用程序设计指南之十一
- ·BASH Shell简介(1)
- ·ghost for unix
- ·ARM的嵌入式Linux移植体验之BootLoader
- ·Visual C++ ADO数据库编程入门
- ·用汇编编写DOS下的内存驻留程序(3)
- ·利用 wordXP 实现自动排班
- ·游戏开发新手入门之DirectX入门
- ·传道解惑 软件开发技术名词解密
- ·非典型的"典型面试评测"
- ·ARM的嵌入式Linux移植体验之设备驱动
- ·17.5.1 Method parameters
- ·17.4 Fields
- ·苏睿暄Sql worm 2的源代码
- ·awk使用手册(1)
