I am trying to find out if there is a way to get details of blkid of an unmounted volume, through some native golang library. I am particularly interested in fstype of the volume
I don't think there is a native library - I couldn't find one.
I think you've got 3 choices
blkid
utilitylibblkid
source and re-implement it in go1 is very easy. 2 is harder. 3 might be easy depending on exactly which feature of blkid
you want. strace blkid args
and seem how many system calls it does to get the result you want to get an idea.
I'd probably go with 1. as blkid
is one of the core linux tools which you are guaranteed to have I think.