From owner-freebsd-bugs@FreeBSD.ORG Sun May 21 10:40:25 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B9D5916A42C for ; Sun, 21 May 2006 10:40:25 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8250C43D6E for ; Sun, 21 May 2006 10:40:20 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k4LAeK2p040446 for ; Sun, 21 May 2006 10:40:20 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k4LAeK4D040445; Sun, 21 May 2006 10:40:20 GMT (envelope-from gnats) Date: Sun, 21 May 2006 10:40:20 GMT Message-Id: <200605211040.k4LAeK4D040445@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Helmut Schellong Cc: Subject: Re: bin/97513: umount: unmount of /card failed: Device busy ?! X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Helmut Schellong List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 May 2006 10:40:28 -0000 The following reply was made to PR bin/97513; it has been noted by GNATS. From: Helmut Schellong To: Tilman Linneweh Cc: freebsd-bugs@freebsd.org Subject: Re: bin/97513: umount: unmount of /card failed: Device busy ?! Date: Sun, 21 May 2006 04:09:19 +0200 Tilman Linneweh wrote: > Synopsis: umount: unmount of /card failed: Device busy ?! > > State-Changed-From-To: open->feedback > State-Changed-By: arved > State-Changed-When: Sat May 20 11:35:52 UTC 2006 > State-Changed-Why: > You need to add more information to make your PR useful. > > Not everyone knows that /dev/da1 is your ZIP drive. > Did you verify that no files are open on /card (fstat(1), lsof) > > http://www.freebsd.org/cgi/query-pr.cgi?pr=97513 > > /dev/da1 (s2,s1) ist a CompactFlash Card 8 GB. Sometimes da0. At the time of the message "Device busy" I had not run any other process that accessed /dev/da1. The script safecard only. Before the runtime of the script the filesytem on Card was unmounted. safecard: ======================================================================= #!/u/bin/bsh MDIR=/card [ -d "$MDIR" ] || mkdir "$MDIR" LST='/boot /home /root /u /dos/cie' [ -n "$*" ] && LST="$*" camcontrol devlist | grep -m '19>.%{5,}da[0-9]' | readl Z || { echo camcontrol; exit 1; } set DEV:.50 expr "$Z" :DEV '%(%%)' || { echo "expr da#"; exit 2; } DEV="/dev/${DEV}s2" [ -c "$DEV" -o -b "$DEV" ] || { echo "DEV=$DEV"; exit 3; } echo "Kartengerät: $DEV" safe.bsh "$DEV" "$MDIR" "$LST" || echo "$0: -> safe.bsh: Exit=$?" : safe.bsh ============================================== #!/u/bin/bsh TMP=/tmp/safe_$$ [ $# -ne 3 ] && exit 1 [ ! -e "$1" -o ! -d "$2" -o -z "$3" ] && exit 2 DEV="$1" MDIR="$2" LST="$3" C="$0" expr "$0" :C '%([^/]%{1,}%)$' echo "%n$C: TMP=$TMP" echo ---------------------------------------------------------------- M=0 mount > $TMP || exit grep -q "$DEV .%{2,} $MDIR " $TMP || M=1 [ M -eq 1 ] && mount -v $DEV $MDIR || exit sleep 3 set DIR:.500 F:.1000 for DIR in $LST do [ -d $DIR ] || continue echo "$C: $DIR ..." find $DIR -print > $TMP [ -s $TMP ] || continue <$TMP while readl F do if [ -L "$F" ] then [ -f "$F" -o -d "$F" ] || { echo "$C: Typ != -f -d: $F"; continue } fstat -tv T "$F" || { echo "$C: Gebrochener Link: $F"; continue } [ -e "$MDIR$F" ] && [ ! -L "$MDIR$F" ] && { echo "$C: Kein SYMLINK: $MDIR$F"; continue } [ -e "$MDIR$F" ] && continue echo "$C: SYMLINK:" else [ -d "$F" ] && { [ -d "$MDIR$F" ] && continue [ -e "$MDIR$F" ] && { echo "$C: Kein DIR: $MDIR$F"; continue } mkdir -pv "$MDIR$F"; continue } [ -e "$MDIR$F" ] && [ ! "$F" -nt "$MDIR$F" ] && continue fi cp -Rpv "$F" "$MDIR$F" done >< done rm $TMP [ M -eq 1 ] && umount -v "$MDIR" || { sleep 5; umount -v "$MDIR"; } || exit echo ---------------------------------------------------------------- ======================================================================= -- Mit freundlichen Grüßen Helmut Schellong var@schellong.biz www.schellong.de www.schellong.com www.schellong.biz http://www.schellong.de/c.htm