• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Eric Johnson
    3. Posts
    E
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 26
    • Best 6
    • Controversial 0
    • Groups 0

    Posts made by Eric Johnson

    • RE: Parted returning a decimal point for start size in Kb

      Ok, testing 🙂

      [code]
      — fog.upload.dist 2014-06-19 09:07:10.000000000 -0400
      +++ fog.upload 2014-06-19 09:32:02.000000000 -0400
      @@ -94,8 +94,8 @@
      fi
      fi
      diskSize=parted -s $hd u kB print | grep "Disk" | grep -v "Flags" | sed 's/Disk \/dev\/[a-zA-Z0-9]*: //' | sed 's/kB//';

      •                   partitionStart=`fdisk -lu | grep $part | awk '{print $3}'`;
                          if [ "$osid" == "1" ]; then
        
      •                           partitionStart=`fdisk -lu | grep $part | awk '{print $3}'`;
                                  if [ "$partitionStart" == "" ]; then
                                          partitionStart="63";
                                  fi
        

      @@ -136,22 +136,22 @@
      echo “Done”;
      if [ “$osid” == “5” ] || [ “$osid” == “6” ] || [ “$osid” == “7” ]; then
      if [ “$win7partcnt” == “1” ]; then

      •                                                   win7part1start=`parted -s $hd u kB print | sed -e '/^.1/!d' -e 's/^ [0-9]*[ ]*//' -e 's/kB  .*//'`;
        
      •                                                   win7part1start=`parted -s $hd u kB print | sed -e '/^.1/!d' -e 's/^ [0-9]*[ ]*//' -e 's/kB  .*//' -e 's/\..*$//'`;
                                                          if [ "$win7part1start" == "" ]; then
                                                                  handleError "Unable to determine disk start location.";
                                                          fi
                                                          adjustedfdsize=`expr $sizefd '+' $win7part1start`;
                                                          parted -s $hd u kB rm 1 &>/dev/null;
        
      •                                                   parted -s $hd -a opt u kB mkpart primary ntfs 2048s ${adjustedfdsize}kB &>/dev/null;
        
      •                                           parted -s $hd u kB set 1 boot on &>/dev/null
        
      •                                                   parted -s $hd -a opt u kB mkpart primary ntfs ${partitionStart}s ${adjustedfdsize}kB &>/dev/null;
        
      •                                                   parted -s $hd u kB set 1 boot on &>/dev/null
                                                  elif [ "$win7partcnt" == "2" ]; then
        
      •                                                   win7part2start=`parted -s $hd u B print | sed -e '/^.2/!d' -e 's/^ [0-9]*[ ]*//' -e 's/kB  .*//'`;
        
      •                                                   win7part2start=`parted -s $hd u B print | sed -e '/^.2/!d' -e 's/^ [0-9]*[ ]*//' -e 's/kB  .*//' -e 's/\..*$//'`;
                                                          if [ "$win7part2start" == "" ]; then
                                                                  handleError "Unable to determine disk start location.";
                                                          fi
                                                          adjustedfdsize=`expr $sizefd '+' $win7part2start`;
                                                          parted -s $hd -a opt u kB mkpart primary ntfs ${defaultpart2start}B ${adjustedfdsize}kB &>/dev/null;
        
      •                                           parted -s $hd u kB set 1 boot on &>/dev/null
        
      •                                                   parted -s $hd u kB set 1 boot on &>/dev/null
                                                  else
                                                          handleError "Invalid partition count.";
                                                  fi
        

      [/code]

      posted in FOG Problems
      E
      Eric Johnson
    • RE: Parted returning a decimal point for start size in Kb

      Well… that diff post didn’t work too well eh? 🙂 Ill try a file upload…

      [url=“/_imported_xf_attachments/1/1022_diff.txt?:”]diff.txt[/url]

      posted in FOG Problems
      E
      Eric Johnson
    • RE: Parted returning a decimal point for start size in Kb

      Yep, it is a IDE disk in a VirtualBox vm.

      So I am wondering why not just use the partitionStart variable when having parted resize the disk. IE make no assumptions about what/where the single partition starts. (not sure about multi-partition setups, we don’t use them here)

      Here is a diff for fog.upload that fixes this and the decimal point problem mentioned earlier. When doing the steps “manually” this seems to work. Ill be trying a full script run upload later this morning.

      (don’t know if this is a good place to send bug fix diffs, so enlighten me if there is a better way)

      E

      — fog.upload.dist 2014-06-19 09:07:10.000000000 -0400
      +++ fog.upload 2014-06-19 09:32:02.000000000 -0400
      @@ -94,8 +94,8 @@
      fi
      fi
      diskSize=parted -s $hd u kB print | grep "Disk" | grep -v "Flags" | sed 's/Disk \/dev\/[a-zA-Z0-9]*: //' | sed 's/kB//';

      •                   partitionStart=`fdisk -lu | grep $part | awk '{print $3}'`;
                          if [ "$osid" == "1" ]; then
        
      •                           partitionStart=`fdisk -lu | grep $part | awk '{print $3}'`;
                                  if [ "$partitionStart" == "" ]; then
                                          partitionStart="63";
                                  fi
        

      @@ -136,22 +136,22 @@
      echo “Done”;
      if [ “$osid” == “5” ] || [ “$osid” == “6” ] || [ “$osid” == “7” ]; then
      if [ “$win7partcnt” == “1” ]; then

      •                                                   win7part1start=`parted -s $hd u kB print | sed -e '/^.1/!d' -e 's/^ [0-9]*[ ]*//' -e 's/kB  .*//'`;
        
      •                                                   win7part1start=`parted -s $hd u kB print | sed -e '/^.1/!d' -e 's/^ [0-9]*[ ]*//' -e 's/kB  .*//' -e 's/\..*$//'`;
                                                          if [ "$win7part1start" == "" ]; then
                                                                  handleError "Unable to determine disk start location.";
                                                          fi
                                                          adjustedfdsize=`expr $sizefd '+' $win7part1start`;
                                                          parted -s $hd u kB rm 1 &>/dev/null;
        
      •                                                   parted -s $hd -a opt u kB mkpart primary ntfs 2048s ${adjustedfdsize}kB &>/dev/null;
        
      •                                           parted -s $hd u kB set 1 boot on &>/dev/null
        
      •                                                   parted -s $hd -a opt u kB mkpart primary ntfs ${partitionStart}s ${adjustedfdsize}kB &>/dev/null;
        
      •                                                   parted -s $hd u kB set 1 boot on &>/dev/null
                                                  elif [ "$win7partcnt" == "2" ]; then
        
      •                                                   win7part2start=`parted -s $hd u B print | sed -e '/^.2/!d' -e 's/^ [0-9]*[ ]*//' -e 's/kB  .*//'`;
        
      •                                                   win7part2start=`parted -s $hd u B print | sed -e '/^.2/!d' -e 's/^ [0-9]*[ ]*//' -e 's/kB  .*//' -e 's/\..*$//'`;
                                                          if [ "$win7part2start" == "" ]; then
                                                                  handleError "Unable to determine disk start location.";
                                                          fi
                                                          adjustedfdsize=`expr $sizefd '+' $win7part2start`;
                                                          parted -s $hd -a opt u kB mkpart primary ntfs ${defaultpart2start}B ${adjustedfdsize}kB &>/dev/null;
        
      •                                           parted -s $hd u kB set 1 boot on &>/dev/null
        
      •                                                   parted -s $hd u kB set 1 boot on &>/dev/null
                                                  else
                                                          handleError "Invalid partition count.";
                                                  fi
        
      posted in FOG Problems
      E
      Eric Johnson
    • RE: Parted returning a decimal point for start size in Kb

      And a follow up. Ran into another issue, perhaps related… For windows 7 images (osid 5) it seems to think partitions
      always start at 2048sector (line 145) But my windows 7 partiton in this case starts at 63…

      So after the recreate partclone.ntfs doesn’t see a ntfs filesystem on sda1 (starting at sector 2048)
      If I set it back to 63 it works.

      Why 2048 and not ${partitionStart}s sectors?

      Or maybe osid 5 should not be in that if statement at line 137, just do the fancy resize stuff for win8/8.1 ?

      Or maybe I have a goofy win7 system? (the system in question is a virtual box VM)

      Any clue bat application woul be appreciated. Im very far from a windows grue, so my understanding of what is normal or abnormal in the partition set up is quite sparse…

      posted in FOG Problems
      E
      Eric Johnson
    • Parted returning a decimal point for start size in Kb

      Hi folks, me again.

      fog 1.1.1, SL6.5 base, fresh install not upgrade.

      Yesterday I posted about getting into debug mode to try to figure out why an upload I was trying was failing.
      Thanks for the clue!!

      I think I have figured out the cause of the problem, but I am not 100% about my solution.

      In the init filesystem bin/fog.upload line 139ish $win7part1start is set via the output of a parted command.
      In my case the returned value after the parted | sed pipeline was 32.3

      So when that gets used to:

      adjustedfdsize=expr $sizefd '+' $win7part1start;

      expr returns: expr: non-numeric argument

      and adjustedfdsize is blank…

      so later when the partition is “adjusted” (IE deleted and recreated) the recreate fails so when
      it trys to partclone, partclone fails to find $part ( /dev/sda1 in my case)

      Im thinking a wipe of decimal place and beyond could be the fix

      Line 139 changed to:

      win7part1start=parted -s $hd u kB print | sed -e '/^.1/!d' -e 's/^ [0-9]*[ ]*//' -e 's/kB .*//' -e 's/\..*$//'

      and line 148 too.

      Thoughts?

      posted in FOG Problems
      E
      Eric Johnson
    • Debug mode in 1.1.1

      Howdy folks,

      Been a long time fog .[23]x user. Today decide to try out fog 1.1.1 with a fresh instal. SL6.5 base OS.

      Installed it, and then created a image. Modified our tftp server for one host (our clonemaster7 server)
      to use:

      next-server x.x.x.x;               // the fog server
      filename "undionly.kpxe";
      

      and finally got that server to boot to pxe menu. (learned a (little) bit about ipxe along the way, kinda cool)

      Oh, and figured out that a kernel download was needed and that if you have a 64 bit machine
      ( cpuid --ext 29 ) you are going to get a 64 bit kernel and (more important if you manually set to a 32 bit kernel that you know used to work fine with .32, then you will get a 64 bit initrd with that 32 bit kernel 🙂

      But when I tried to upload the image, I wound up having a failure, something about /dev/sda1 not available or some such. It blasted by to quickly.

      With trouble like this in .32 world I would go to “debug” boot to see what the kernel sees and sometimes
      even “run the fog steps” manually till we found the “problem”. But there doesn’t seem to be a debug option anymore. I imagine with some (more) research on ipxe I could find a incantation to have it boot the kernel with init=sh or somesuch, but I thought I would ask here first if there is a “official” way to do this.

      Thanks! Having high hopes for 1.0 branch, and hoping not to have to backport windows 8 crap into 0.32 🙂

      E

      posted in FOG Problems
      E
      Eric Johnson
    • 1
    • 2
    • 2 / 2