@Sebastian-Roth
Thanks for the tip.
assuming we have only one disk on each machine, there are always 2 parts for Windows (winre and C:) and 2 for linux (swap and /).
My 1st idea is to do something like this:
#for linux
fdisk -l /dev/sda | awk '/ 83 / {print $1}'
or this
#for windows, it requires more pipes
fdisk -l /dev/sda | awk '/ 7 /' | sort -k5 -h | tail -n1 | awk '{print $1}'
I will work on this.
Thank you all for the great help.