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