On a running linux system, what is a portable (among linux distributions) way to find out what filesystems the current kernel has compiled-in (not through modules) support for?
Consider for example my current Ubuntu x86_64 kernel: 3.11.0-24-generic #41-Ubuntu
. It has for instance no /proc/config.gz
, which would be my first thought otherwise.
The reason I'm interested is that I'd like to (programmatically) build a rescue environment with the current kernel and an initial ramdisk that the kernel will be able to load/mount.
Is is as simple as comparing /proc/filesystems
with lsmod
?
If so: Do the modules always have the exact same name (first column from lsmod
output) as the filesystem name (last column in /proc/filesystems
)?
Is there perhaps a more modern way such as /sys
instead of /proc
to look for info?
My current approach is as follows. Can someone confirm that it is correct, or advise how to do it instead?:
for fscand in $(awk '{print $NF}' /proc/filesystems)
do
if test $(lsmod | grep -c -e '^'${fscand}'[^a-z0-9_-]') -eq 0
then
candlist="${fscand} ${candlist}"
fi
done
for fscand in $candlist
do
echo $fscand is compiled-in
done