Detecting filesystem on unmounted partition

Ed W lists at wildgooses.com
Mon Mar 28 10:40:22 UTC 2011


Hi, I'm trying to build a small initramfs where I need to mount a
potentially unknown filesystem partition. I would like to know the
filesystem type on that partition ahead of time so that I can sometimes
set particular mount options

On a non busybox system I can use blkid to detect "TYPE" (in fact seems
to also work on loopback type files).  Any thoughts on how I might do
this using only busybox tools (or simple derivations)? 

(One option seems to be to mount the filesystem, read the type, umount
and remount if needed - however, seems somewhat slow and clunky..?
Especially for journalled filesystems...)

Any suggestions?

Thanks

Ed W


More information about the busybox mailing list