Applet for detecting the filesystem type.

William Thompson wt at electro-mechanical.com
Wed Nov 24 13:15:59 UTC 2010


On Wed, Nov 24, 2010 at 02:12:56PM +0100, Tito wrote:
> On Tuesday 23 November 2010 11:00:57 Sameer Naik wrote:
> > Hello,
> > 
> > I am using busybox-1.15.2. I am writing a hotplug script for mdev to
> > automount usb disk drives with ext2, ext3, vfat, ntfs-3g file systems.
> > In my hotplug script i need to figure out the label of the disk
> 
> Hi,
> why do you need to autodetect it, just try if one of them works:
> 
> for fstype in ext2 ext3 vfat ntfs-3g last
> do
> 	if test "x$fstype" = "xlast" ; then
> 		echo "Fstype not supported"
> 		break
> 	fi
> 	mount -t $fstype /dev/$UUID  /mnt/$LABEL
> 	if test "x$?" = "x0" ; then
> 		break
> 	fi
> done

I've been wanting to do a detection as well, but my purpose was to determine
if the device contained a filesystem, lvm, raid, etc.  Busybox cannot do
this from what I can see.  I had to resort to adding blkid with it's
dependancies so I could do this.


More information about the busybox mailing list