Purpose:
To be able to capture and deploy an image using standard linux tools in the LinuxPE environment.
Requirement:
- Knowledge of linux imaging tools
- mount points to the express share or other nfs or cifs location
Tools:
the tool i use in this experiment is dd (see dd man page) and compression tool gzip.
Process:
Capture Image:
Optional: you can clear out the udev persistant rules.
/bin/rm -rf /etc/udev/rules.d/70*
NOTE: this may be different for each distro.
Step 1:
In the ghost solution suite create a new job with a runscript task that will run in linux PE automation.
#######################
#!/bin/bash
for i in a b c d e f; do do if=/dev/sd$i conv=sync, noerror bs=64k | gzip -c > /mnt/ds/Images/%NAME%_sd$i.img.gz; done;
#########################
Step 2:
Create a power control task and add it to the same job that the runscipt task is on.
NOTE: you can capture a drive or a single partition by modifiying the script to use sda1 or sda2 instead of just sda.
Restore Image:
Step1:
create a new job with a runscript and power control tasks
In the run script have it run in automation again and have it run the following
############################
#!/bin/bash
gunzip -c /mnt/ds/Images/%NAME%_sda.img.gz | dd of=/dev/sda
#############################
NOTE: you will have to have a the above command for each individual drive you want to image. Also note that the will only work in a single driver and has not been tested with LVM or mdadm software RAID.
Issues:
- no network connection:
- The mac address that is listed in theconfig files is incorrect and needs to be addressed.
- Hostname needs to be changed.
Redhat
- Log into the linux machine
- Run lspci -vv | more
- Locate the nic
For example, you see a MAC Address similar to:
xx:xx:xx:xx:xx:xx
- on the Linux virtual machine.
- Open a console and log in as root.
- Change directory to etc/sysconfig/network-scripts.
- Edit ifcfg-eth0 using a plain text editor and update the MAC address to reflect the MAC address in Step 3
- Activate the ethernet card by running this command:
ifup eth0.
Notes:
- ifup eth0 may be required in some instances to activate the ethernet card.
- The /etc/udev/rules.d/70-persistent-net.rules may also need to be updated to the new MAC address.
SUSE
- Log into the linux machine
- Run lspci -vv | more
- Locate the MAC address. For example, you see a MAC Address similar to:
xx:xx:xx:xx:xx:xx
- Power on the Linux virtual machine.
- Change directory to /etc/sysconfig/network.
- Run this command:
ls -l if*
/etc/sysconfig/network # ls -l if*
# ifcfg-eth-id-xx:xx:xx:xx:xx:xy
- Rename this file to match the MAC address in Step 3:
#mv ifcfg-eth-id-xx:xx:xx:xx:xx:xy:d7 ifcfg-eth-id-xx:xx:xx:xx:xx:xx
- Activate the ethernet card by running this command:
ifup eth0