• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. mstabrin
    3. Best
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 7
    • Posts 42
    • Best 8
    • Controversial 0
    • Groups 0

    Best posts made by mstabrin

    • RE: Add Host Primary Disk to registration form

      Ok I also found the answer to my search question:
      https://forums.fogproject.org/topic/10036/api/2
      The search syntax is slightly different to the news article.

      So here would be an example command for completion:

      curl -H 'fog-api-token: TOKEN' -H 'fog-user-token: TOKEN' -X GET  http://FOG-PXE-SRV.mpi-dortmund.mpg.de/fog/host | jq '.hosts[] | select(.name == "HOSTNAME") | .name'
      

      Thanks again for letting me do my inner monologue on your platform! πŸ™‚

      Best,
      Markus

      posted in FOG Problems
      M
      mstabrin
    • RE: BTRFS postdownloadscript

      Hello @sebastian-roth ,

      So far I did not encounter any problems imaging and deploying resizable BTRFS images πŸ™‚

      However, I β€œonly” tested simple examples, i.e., one SSD with EFI, BTRFS, SWAP partitioning.

      But no problems with this setup.
      However, more complex examples will follow soon and I will come back to you in case I encounter some problems.

      posted in Linux Problems
      M
      mstabrin
    • RE: Using git inside FOS

      @Sebastian-Roth I successfully finished the FOS kernel build including git πŸ™‚
      I started with the FOS 1.5.9 TAG. I already started the build before I read your message.

      I installed the following packages:

      • CA Certificates <- Necessary for git https authentification
      • git
      • git-crypt <- We use this, so I was happy it is as easy as checking it πŸ™‚

      And things work great πŸ™‚
      Thank you for the guidance! It was actually very straight forward.

      @george1421 Thank you for the input. As far as I understand it is required to have the FOG client up and running in order to deploy snapins? That actually might be something I will look into as well!
      Actually during the FOS rebuild I had a similar idea, but instead of using snapins I was thinking of chrooting into the deployed system and run everything from there.
      However, I am not sure if that would be a robust solution.

      posted in General
      M
      mstabrin
    • RE: Tasktypeedit setup or getting Wake on Lan to work

      @Sebastian-Roth Sorry for that question, it turned out that I was just too impatient and did not wait long enough for the reboot to happen…

      Rebooting works great now πŸ™‚
      On monday I will provide a short feedback if the wake-on-lan function is working properly πŸ™‚

      Have a great weekend!

      Best,
      Markus

      posted in FOG Problems
      M
      mstabrin
    • RE: ProxyDHCP responding to PXE boot in different subnet

      Hello @george1421 ,

      I looked into the error message and found an actual solution here: https://dnsmasq-discuss.thekelleys.org.narkive.com/3JlGMO6e/dhcp-proxy-problem

      I needed to specify the dhcp-range for both subnets:

      So instead of using:

      dhcp-range=141.5.200.57,proxy
      

      in the /etc/dnsmasq.d/ltsp.conf, I added the second subnet with the respective netmasks:

      dhcp-range=141.5.200.255,proxy,255.255.240.0
      dhcp-range=10.65.0.255,proxy,255.255.252.0
      

      and everything seems to work now πŸ™‚

      Thank you so much for the help!

      posted in General Problems
      M
      mstabrin
    • RE: BTRFS postdownloadscript

      Hello @Sebastian-Roth and @george1421 ,
      Thank you for all the information!

      I am using FOG version 1.5.9.
      Before I did any further testing I resolved my partition mess:
      The allocation of the discs sectors was actually in the correct order, just the naming was messed up by a random allocation order during installation.

      sda1 - EFI
      sda2 - btrfs
      sda3 - swap

      However I still get a similar error with - No resizable partitions found):
      Screenshot_2021-02-09_11-39-15.png
      (I looked at a lot of related threads and those people also posted screenshots of their problems and solutions. However, most of them are unavailable nowadays and therefore the thread not informative anymore. Is posting a screenshot here actually the best method in this case or do you prefer another solution?)

      So I played around with btrfs resizing and came up with the following inside of the debug mode based on https://unix.stackexchange.com/questions/424758/resize-btrfs-filesystem-to-the-minimum-size-in-a-single-step

      mount /dev/sda2 /mnt/bt
      
      free_size_original=$(btrfs filesystem usage -b /mnt/bt | grep unallocated | grep -Eo '[0-9]+')
      
      mult_val=0.95
      free_size=$(echo "scale=0;(${mult_val}*${free_size_original})/1" | bc -l)
      while ! btrfs filesystem resize -${free_size} /mnt/bt
      do
          if [[ ${mult_val} -le 0 ]]
          then
              break
          else
              mult_val=$(${mult_val} - 0.05)
          fi
          free_size=$(echo "scale=0;(${mult_val}*${free_size_original})/1" | bc -l)
      done
      

      To bring it back to full size it only needs a:

      btrfs filesystem resize max /mnt/bt
      

      I guess the tricky part now is to allocate the correct partition sizes after the shrink and before the max.

      @george1421 I tried to use fthe fog command within the debug mode but only got:

      Screenshot_2021-02-09_14-33-33.png

      And the next enter sends me back to the command line.

      Best,
      Markus

      posted in Linux Problems
      M
      mstabrin
    • RE: BTRFS postdownloadscript

      Hello everybody,
      I needed to get myself into the FOS environment yesterday, BUT it works now πŸ™‚ (At least for my usecase πŸ˜‰ )

      @george1421

      Are you using a FOS Linux USB boot drive? I would expect to only see the β€œUnknown request type :: Null” when booted from a USB stick into FOS Linux without having a corresponding task scheduled on the FOG server. I also noticed that your kernel parameters are incomplete for a capture or deploy (which would also lead to that error message).

      This happened because I used the normal Debug task and not the Capture - Debug task.
      Using the Caputer - Debug made things work as you described them πŸ™‚

      @Tom-Elliott
      I needed to make some minor changes to your suggested changes, but it was amazingly helpful to know which parts to look at πŸ™‚

      funcs.sh (based on what you send me):

      --- funcs.sh_ori	2021-02-10 13:25:08.000000000 +0100
      +++ funcs.sh	2021-02-11 09:08:31.660652070 +0100
      @@ -255,15 +255,15 @@
                           fi
                           echo "Done"
                           ;;
                   esac
                   ;;
      -        extfs)
      +        btrfs)
                   # Based on info from @mstabrin on forums.fogproject.org
                   if [[ ! -d /tmp/btrfs ]]; then
                       mkdir /tmp/btrfs >>/tmp/btfrslog.txt 2>&1
      -                if [[$? -gt 0 ]]; then
      +                if [[ $? -gt 0 ]]; then
                           echo "Failed"
                           debugPause
                           handleError "Could not create /tmp/btrfs (${FUNCNAME[0]})\n   Info: $(cat /tmp/btrfslog.txt)\n   Args Passed: $*"
                       fi
                   fi
      @@ -625,11 +625,11 @@
               btrfs)
                   # Based on info from @mstabrin on forums.fogproject.org
                   # https://forums.fogproject.org/topic/15159/btrfs-postdownloadscript/3
                   if [[ ! -d /tmp/btrfs ]]; then
                       mkdir /tmp/btrfs >>/tmp/btfrslog.txt 2>&1
      -                if [[$? -gt 0 ]]; then
      +                if [[ $? -gt 0 ]]; then
                           echo "Failed"
                           debugPause
                           handleError "Could not create /tmp/btrfs (${FUNCNAME[0]})\n   Info: $(cat /tmp/btrfslog.txt)\n   Args Passed: $*"
                       fi
                   fi
      @@ -638,16 +638,18 @@
                       echo "Failed"
                       debugPause
                       handleError "Could not mount $part to /tmp/btrfs (${FUNCNAME[0]})\n   Info: $(cat /tmp/btrfslog.txt)\n   Args Passed: $*"
                   fi
                   local free_size_original=$(btrfs filesystem usage -b /tmp/btrfs | grep unallocated | grep -Eo '[0-9]+')
      -            local mult_val=0.95
      -            local free_size=$(echo "scale=0;(${mult_val}*${free_size_original})/1" | bc -l)
      -            while ! btrfs filesystem resize -${free_size} /tmp/btrfs; do
      -                [[ ${mult_val} -le 0 ]] && break || mult_val=$(${mult_val} - 0.05)
      -                free_size=$(echo "scale=0;(${mult_val}*${free_size_original})/1" | bc -l)
      +            local fsize_pct=$(calculate_float "${percent}/100")
      +            local mult_val=$(calculate_float "1-${fsize_pct}")
      +            local free_size=$(calculate "${mult_val}*${free_size_original}")
      +            while ! btrfs filesystem resize -${free_size} /tmp/btrfs >>/tmp/btrfslog.txt 2>&1; do
      +            [[ $(echo "${mult_val} <= 0" | bc -l) -gt 0 ]] && break || mult_val=$(calculate_float "${mult_val}-0.05")
      +                free_size=$(calculate "${mult_val}*${free_size_original}")
                   done
      +            umount /tmp/btrfs >>/tmp/btrfslog.txt 2>&1
                   ;;
               *)
                   echo " * Not shrinking ($part $fstype)"
                   ;;
           esac
      @@ -2421,5 +2423,8 @@
       }
       # Calculates information
       calculate() {
           echo $(awk 'BEGIN{printf "%.0f\n", '$*'}')
       }
      +calculate_float() {
      +    echo $(awk 'BEGIN{printf "%f\n", '$*'}')
      +}
      

      Small changelog:

      • I needed to add a new calculate_float function to make the float calculations work
      • Minor syntax problems in the if statements and missing whitespaces
      • btrfs instead of extfs in shrinkPartition
      • Fixed the if condition inside the loop.
      • Used the calculate and calculate_float instead of my suggested bc -l
      • Used a fixed decrement of 5%, as we try to be as close to the percent value as possible. Otherwise the mechanism would break if the percent value is large.
      • Unmount the btrfs file system after shrinking to allow for partition shrinking later.

      fog.sh (based on what you send me):

      --- fog.upload_ori	2021-02-10 13:22:20.000000000 +0100
      +++ fog.upload	2021-02-11 08:44:34.415100613 +0100
      @@ -42,11 +42,12 @@
                   part_number=0
                   for part in $parts; do
                       fsTypeSetting "$part"
                       getPartitionNumber "$part"
                       case $fstype in
      -                    ntfs|extfs)
      +                    ntfs|extfs|btrfs)
      +                    #ntfs|extfs)
                               continue
                               ;;
                           *)
                               fixed_size_partitions="$fixed_size_partitions:$part_number"
                               ;;
      
      • Added btrfs to the shrinkable partition list

      Thank you for all the help πŸ™‚
      If you need more information from me, feel free to ask πŸ™‚

      posted in Linux Problems
      M
      mstabrin
    • RE: FOG client certificates removed on mono update

      @Sebastian-Roth It did containing

       04/13/2021 11:58:30 Installer Settings successfully saved in /opt/fog-service/settings.json
       04/13/2021 11:58:30 Middleware::Communication Download: http://fog-pxe-srv.XXX.de/fog/management/other/ca.cert.der
      
      posted in Linux Problems
      M
      mstabrin
    • 1 / 1