From owner-freebsd-stable@FreeBSD.ORG Sat Aug 27 16:42:44 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2348B1065672 for ; Sat, 27 Aug 2011 16:42:44 +0000 (UTC) (envelope-from dart@es.net) Received: from mailgw.es.net (mail2.es.net [IPv6:2001:400:107:1::2]) by mx1.freebsd.org (Postfix) with ESMTP id 007D58FC08 for ; Sat, 27 Aug 2011 16:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=es.net; h=message-id : date : from : reply-to : mime-version : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=es.net; bh=3/PaNLOtVlO33rhmIaPe/TdUoRLD/1YqGGJj6Ll/h/U=; b=IJCWM2GktfPYyAyrb9r1DKS4Hxx9L+yvQ+nEyAM85nZVymv8M94ww8frRO5ZwvBx0ONY CuH88HXq9rxePbxHmJi6NPxXQjVf9vrEITUsB8GYODhavVo1aJI8FnD/gtut4sIO7TkN 5DvuepVcXXNMkWQG9iBlqxoCaBykOCl/3y4= Received: from MacBook-Pro-1597.local (c-24-6-230-73.hsd1.ca.comcast.net [24.6.230.73]) (authenticated bits=0) by mailgw.es.net (8.14.5/8.14.5) with ESMTP id p7RGggwA008756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 27 Aug 2011 09:42:43 -0700 Message-ID: <4E591E81.7040801@es.net> Date: Sat, 27 Aug 2011 09:42:41 -0700 From: Eli Dart Organization: Energy Sciences Network User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: Kevin Oberman References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.4.6813, 1.0.211, 0.0.0000 definitions=2011-08-26_06:2011-08-27, 2011-08-26, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=2 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1012030000 definitions=main-1108270170 Cc: "freebsd-stable@freebsd.org Stable" Subject: Re: Unable to shutdown X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dart@es.net List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2011 16:42:44 -0000 This sounds like it may have the same underlying cause as an issue I've been experiencing. Steps to reproduce: 1) Mount filesystem (Seagate 2TB USB disk) 2) wait a while, so the drive spins down 3) cd to a directory off the root of the mount point (the thing we're looking for here is a directory that is already in the filesystem buffer cache because of the filesystem mount). We want a directory that is not empty. 4) ls 5) ls will hang for a while as the drive spins up (this is to be expected) 6) ls returns nothing We now have a problem. The kernel thinks the directory is empty, even when its not. The drive is spun up now, and the rest of the filesystem will function normally, but that one directory will be considered empty by the kernel until it has reason to interact with disk (which means writing to the directory). Once the directory is written, its now corrupt. My guess is that there is something in the USB subsystem that doesn't deal well with the longer times necessary for bigger drives to spin back up (this is not a problem on 1TB drives). A workaround is to have little script that does a dd from the raw device to /dev/null before attempting to access the drive - this will ensure that its spun up. Needless to say, this doesn't work at all well for some production operations (e.g. rsync backup to USB disk), where disk I/O can cease for long enough for the drive to spin down in the middle of the job. --eli On 8/26/11 9:51 PM, Kevin Oberman wrote: > I've run into an odd problem with dismounting file systems on a > Seagate Expansion portable > USB drive. Running 8-stable on an amd64 system and with two FAT32 > (msdosfs) file systems > on the drive. > > The drive is "green" and spins down when idle. If an attempt is made > to shutdown the > system while the drive is spun down, the system goes through the usual > shutdown including > flushing all buffer out to disk, but when the final disk access to > mark the file systems as > clean, the drive never spins up and the system hangs until it is > powered down. I've found no > way to avoid this other then to remember to access the disk and cause > it to spin up before > shutting down. > > If I attempt to unmount the file systems when the drive is shut down. > the same thing > happens, but I can recover as the second file system is still mounted > and an ls(1) to that file > system will cause the disk to spin up and everything is fine. > > This looks like a bug, but I don't see why the unmounting of an > msdosfs system does not > spin up the drive. It's clearly hanging on some operation that is not > spinning up the drive, > but does block. > > Any ideas what is going on? Possible fix? -- Eli Dart NOC: (510) 486-7600 ESnet Network Engineering Group (AS293) (800) 333-7638 Lawrence Berkeley National Laboratory PGP Key fingerprint = C970 F8D3 CFDD 8FFF 5486 343A 2D31 4478 5F82 B2B3