On Mon, Mar 15, 2010 at 5:04 PM, Andreas Dilger <adilger@xxxxxxx> wrote: > On 2010-03-13, at 13:30, Francis Moreau wrote: >> >> I've some shell scripts which try to find out the filesystem hosted by >> a block device. >> >> They basically do this: >> >> mount /dev/sdc1 /mnt >> fs=$(stat -f -c %T $mount_point) >> umount /mnt > > Mounting an in-use filesystem is a bad idea. But it's not: /dev/sdc1 is not mounted anywhere before executing the script. Someone else pointed out that some other processes (such as hal, gnome stuff...) may have detected the new mount point and started to access it hence preventing umount(8) to work. -- Francis -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html