My biggest annoyance with the livecd-iso-to-disk script has simply
been having to do a little math in my head when trying to fit the
largest possible overlay combo onto my liveusb. The script should be
doing this work - it should tell you by how much you're over so you
can free it and/or quickly adjust your sizes.
BEFORE:
[root@nano livecd-foo]# livecd-iso-to-disk --noverify
--overlay-size-mb 12000 --home-size-mb 8000 --swap-size-mb 1024
--delete-home Fedora-11-i686-Live.iso /dev/loop0
Unable to fit live image + overlay on available space on USB stick
Size of live image: 679
Overlay size: 12000
Home overlay size: 8000
Home overlay size: 1024
Available space: 15947
Cleaning up to exit...
AFTER:
[root@nano livecd-foo]# ./livecd-iso-to-disk.sh --noverify
--overlay-size-mb 12000 --home-size-mb 8000 --swap-size-mb 1024
--delete-home Fedora-11-i686-Live.iso /dev/loop0
Unable to fit live image + overlay on available space on USB stick
+ Size of live image: 679
+ Overlay size: 12000
+ Home overlay size: 8000
+ Swap overlay size: 1024
---------------------------
= Requested: 21703
- Available: 15947
---------------------------
= To fit, free or decrease requested size total by: 9296
Cleaning up to exit...
diff -Naur livecd-iso-to-disk.sh.orig livecd-iso-to-disk.sh
--- livecd-iso-to-disk.sh.orig 2009-06-17 17:57:21.000000000 -0400
+++ livecd-iso-to-disk.sh 2009-06-17 19:12:33.897509289 -0400
@@ -476,13 +476,18 @@
fi
free=$(df -B1M $USBDEV |tail -n 1 |awk {'print $4;'})
-if [ $(($overlaysizemb + $homesizemb + $livesize + $swapsizemb)) -gt
$(($free + $tbd)) ]; then
+tba=$(($overlaysizemb + $homesizemb + $livesize + $swapsizemb))
+if [ $tba -gt $(($free + $tbd)) ]; then
echo "Unable to fit live image + overlay on available space on USB stick"
- echo "Size of live image: $livesize"
- [ "$overlaysizemb" -gt 0 ] && echo "Overlay size:
$overlaysizemb"
- [ "$homesizemb" -gt 0 ] && echo "Home overlay size:
$homesizemb"
- [ "$swapsizemb" -gt 0 ] && echo "Home overlay size:
$swapsizemb"
- echo "Available space: $(($free + $tbd))"
+ echo "+ Size of live image: $livesize"
+ [ "$overlaysizemb" -gt 0 ] && echo "+ Overlay size:
$overlaysizemb"
+ [ "$homesizemb" -gt 0 ] && echo "+ Home overlay size:
$homesizemb"
+ [ "$swapsizemb" -gt 0 ] && echo "+ Swap overlay size:
$swapsizemb"
+ echo "---------------------------"
+ echo "= Requested: $tba"
+ echo "- Available: $(($free + $tbd))"
+ echo "---------------------------"
+ echo "= To fit, free or decrease requested size total by: $(($tba
- $free + $tbd))"
exitclean
fi
--
Jason "zcat" Farrell
Show replies by date