Difference between revisions of "Debug Mode"
(→Debug Tasks) |
m (Fixed link) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
= Debug Tasks = | = Debug Tasks = | ||
+ | |||
+ | == Common Commands == | ||
+ | |||
== Debug Task == | == Debug Task == | ||
− | == | + | == Deploy Debug == |
− | {{: | + | {{:Troubleshooting an image push to a client}} |
− | == | + | == capture Debug == |
+ | {{:Troubleshooting a capture}} |
Latest revision as of 04:41, 8 July 2016
Contents
Debug Tasks
Common Commands
Debug Task
Deploy Debug
Troubleshooting an image push to a client
This process will wipe out whatever is currently present on the client computer.
This tutorial is for FOG .30 pushing Windows XP and assumes that your primary disk is /dev/sda. Note that this process has not been tested on Windows 7.
- In the management portal, start a debug task for the client computer in question. Allow the client to boot and at the bash prompt. (Everything below is done within the bash prompt on the client's console.)
- From your client, mount the remote /images folder on your FOG server onto a local /images folder using nfs:
- mkdir /images (type this on the client's keyboard, as explained above)
- mount -o nolock x.x.x.x:/images /images (where x.x.x.x is the server ip)
you may try also mount -t nfs -o nolock x.x.x.x:/images /images
- Copy the master boot record to the first 512 bytes of the local disk. Take a look into /usr/local/fog/mbr/ to determine the correct MBR for your system. This example uses XP:
- cd /images
- dd if=/usr/share/fog/mbr/xp.mbr of=/dev/sda1 bs=512 count=1 (For previous versions, find the fog directory under:/usr/local/)
- Start fdisk and remove all previous partitions:
- fdisk /dev/sda (Note there is no 1 at the end of the device name)
- Press "d", then "Enter" - select a partition if prompted and repeat pressing "d"
- Press "w", then "Enter" to save and exit fdisk
- Create a new partition:
- fdisk /dev/sda
- Press "n", then "Enter"
- Press "p", then "Enter"
- Press "1", then "Enter"
- Press "1", then "Enter" or just "Enter" to accept the default starting sector
- Press "Enter" to accept the default ending sector
- Press "t", then "Enter" to change the partition type
- Press "7", then "Enter" for NTFS
- Press "a", then "Enter" to toggle the bootable flag
- Press "1", then "Enter"
- Press "w", then "Enter" to save and exit fdisk
Note: Windows 7 users may want to create a 100M partition, then repeat these steps to create the system partition and assign the rest of the disk to the OS.
- Update the partition info:
- partprobe
- Use partimage to copy image from FOG server to local partition:
- /usr/sbin/partimage restore /dev/sda1 /images/[imagename] -f3 -b
- Use ntfsresize to expand partition:
- /usr/sbin/ntfsresize /dev/sda1 -f -b -P (For previous versions, find sbin under: /usr/local/)
An alternate way to do partimage (which gives more feedback) is to load the gui version of partimage with:
/usr/sbin/partimage, then manually fill in the fields/choose options.
Win 7
This process will wipe out whatever is currently present on the client computer.
This tutorial was created using SVN 3501 pushing Windows 7 and assumes that your primary disk is /dev/sda.
- In the management portal, start a debug task for the client computer in question. Allow the client to boot and at the bash prompt. (Everything below is done within the bash prompt on the client's console.)
- From your client, mount the remote /images folder on your FOG server onto a local /images folder using nfs:
- mkdir /images (type this on the client's keyboard, as explained above)
- mount -o nolock x.x.x.x:/images /images (where x.x.x.x is the server ip)
you may try also mount -t nfs -o nolock x.x.x.x:/images /images
- Copy the master boot record to the first 512 bytes of the local disk.
- cd /images/$ImageFolder $ImageFolder is the folder of the image you want to push
- dd if=d1.mbr of=/dev/sda bs=512 count=1
- Update the partition info:
- partprobe
- Use partclone to copy image from FOG server to local partition:
- cat d1p1.img | pigz -d -c | partclone.restore -O /dev/sda1 -N -f -i
- cat d1p2.img | pigz -d -c | partclone.restore -O /dev/sda2 -N -f -i
- Use ntfsresize to expand partition:
- ntfsresize /dev/sda1 -f -b -P
- ntfsresize /dev/sda2 -f -b -P
capture Debug
Troubleshooting a capture
To make this process easier, we are going to use an Windows XP image. Note that this process has not been tested on Windows 7. Please also note that this process will change your partitions on the client computer. This tutorial assumes that your disk is /dev/sda1.
- In the management portal, start a debug task for the client computer in question. Allow the client to boot and at the bash prompt type the following commands.
- mkdir /images
- mount -o nolock x.x.x.x:/images/dev /images (where x.x.x.x is the server ip)
- cd /images
- dd if=/dev/sda of=/mbr.backup count=1 bs=512
- /usr/local/sbin/ntfsresize -f -i -P /dev/sda1
Look for You might resize you will need this number, so write it down. We will call this number NTFSSize. - Take NTFSSize and divide it by 1000
- Now add 300000 to that number and write down as N
- Now take NTFSSize again and multiply it by 1.1 and then round that to the nearest whole number and write it down as F
- /usr/local/sbin/ntfsresize -f -n -s Nk /dev/sda1
(where N is the value calculated above with a k after it. - If the test above ends successfully then run:
/usr/local/sbin/ntfsresize -f -s Nk /dev/sda1 - fdisk /dev/sda
- Press "d", then Enter
- Press "w", then Enter
- fdisk /dev/sda
- Press "n", then Enter
- Press "p", then Enter
- Press "1", then Enter
- Press "1", then Enter
- Press "+FK", then Enter (where F is the value calculated above; K must be capital)
- Press "t", then Enter
- Press "7", then Enter
- Press "a", then Enter
- Press "1", then Enter
- Press "w", then Enter
- partprobe
- /usr/local/sbin/partimage save /dev/sda1 /images/dev/[somefile] --volume=9900000000 -z1 -o -d -f3 -b
- dd if=/mbr.backup of=/dev/sda
- Press "w", then Enter
- partprobe
- /usr/local/sbin/ntfsresize /dev/sda1 -f -b -P
- mv /images/dev/[somefile] /images/[somefile]