From mboxrd@z Thu Jan 1 00:00:00 1970 From: Francis Moreau Subject: Re: sys_umount() returns EBUSY when doing: sh -c "mount /dev/sdc1 /mnt; umount /mnt" Date: Mon, 15 Mar 2010 21:19:05 +0100 Message-ID: <38b2ab8a1003151319h42d023dek4c9912ca5039c80d@mail.gmail.com> References: <38b2ab8a1003130056u4b025839i556a797ccad894de@mail.gmail.com> <38b2ab8a1003131230q469158b3qd7dcb9f880ea68e1@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org To: Andreas Dilger Return-path: Received: from fg-out-1718.google.com ([72.14.220.158]:41266 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936628Ab0COUTH convert rfc822-to-8bit (ORCPT ); Mon, 15 Mar 2010 16:19:07 -0400 Received: by fg-out-1718.google.com with SMTP id l26so1458742fgb.1 for ; Mon, 15 Mar 2010 13:19:06 -0700 (PDT) In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Mar 15, 2010 at 5:04 PM, Andreas Dilger 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: >> >> =A0mount /dev/sdc1 /mnt >> =A0fs=3D$(stat -f -c %T $mount_point) >> =A0umount /mnt > > Mounting an in-use filesystem is a bad idea. But it's not: /dev/sdc1 is not mounted anywhere before executing the sc= ript. 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. --=20 =46rancis -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html