Debug Mode

From FOG Project
Revision as of 23:41, 7 July 2016 by Wayne-workman.28155 (talk | contribs) (Fixed link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

  1. In the management portal, start a debug task for the client computer in question. Allow the client to boot and at the bash prompt.
  2. (Everything below is done within the bash prompt on the client's console.)
  3. 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
  4. 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/)
  5. 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
  6. 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
    • 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.

    • 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
  7. Update the partition info:
    • partprobe
  8. Use partimage to copy image from FOG server to local partition:
    • /usr/sbin/partimage restore /dev/sda1 /images/[imagename] -f3 -b
  9. 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.

  1. In the management portal, start a debug task for the client computer in question. Allow the client to boot and at the bash prompt.
  2. (Everything below is done within the bash prompt on the client's console.)
  3. 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
  4. 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
  5. Update the partition info:
    • partprobe
  6. 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
  7. 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.

  1. 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.
  2. mkdir /images
  3. mount -o nolock x.x.x.x:/images/dev /images (where x.x.x.x is the server ip)
  4. cd /images
  5. dd if=/dev/sda of=/mbr.backup count=1 bs=512
  6. /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.
  7. Take NTFSSize and divide it by 1000
  8. Now add 300000 to that number and write down as N
  9. 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
  10. /usr/local/sbin/ntfsresize -f -n -s Nk /dev/sda1
    (where N is the value calculated above with a k after it.
  11. If the test above ends successfully then run:
    /usr/local/sbin/ntfsresize -f -s Nk /dev/sda1
  12. fdisk /dev/sda
  13. Press "d", then Enter
  14. Press "w", then Enter
  15. fdisk /dev/sda
  16. Press "n", then Enter
  17. Press "p", then Enter
  18. Press "1", then Enter
  19. Press "1", then Enter
  20. Press "+FK", then Enter (where F is the value calculated above; K must be capital)
  21. Press "t", then Enter
  22. Press "7", then Enter
  23. Press "a", then Enter
  24. Press "1", then Enter
  25. Press "w", then Enter
  26. partprobe
  27. /usr/local/sbin/partimage save /dev/sda1 /images/dev/[somefile] --volume=9900000000 -z1 -o -d -f3 -b
  28. dd if=/mbr.backup of=/dev/sda
  29. Press "w", then Enter
  30. partprobe
  31. /usr/local/sbin/ntfsresize /dev/sda1 -f -b -P
  32. mv /images/dev/[somefile] /images/[somefile]