From owner-freebsd-questions@FreeBSD.ORG Sun Jun 3 15:24:28 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BD17106566B for ; Sun, 3 Jun 2012 15:24:28 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 16E2A8FC08 for ; Sun, 3 Jun 2012 15:24:27 +0000 (UTC) Received: from r56.edvax.de (port-92-195-20-192.dynamic.qsc.de [92.195.20.192]) by mx01.qsc.de (Postfix) with ESMTP id D3B8A3CDF0; Sun, 3 Jun 2012 17:24:26 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q53FOQiV003101; Sun, 3 Jun 2012 17:24:26 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sun, 3 Jun 2012 17:24:26 +0200 From: Polytropon To: freebsd@dreamchaser.org Message-Id: <20120603172426.618e7e6a.freebsd@edvax.de> In-Reply-To: <4FCB7BBF.7090603@dreamchaser.org> References: <4FCB7BBF.7090603@dreamchaser.org> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List Subject: Re: umount device busy X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 15:24:28 -0000 On Sun, 03 Jun 2012 08:59:11 -0600, Gary Aitken wrote: > Something I'm overlooking here and a lot of questions I can't > seem to find the answers to... > > I mounted a usb drive > mount -t ntfs /dev/da0s1 /mnt/goflex > > Then, as nearly as I can remember... > I then poked around a bit using the xfce4 browser. > I tried to mkdir from the mount point as a normal user: > cd /mnt/goflex > %mkdir breakaway > mkdir: .: No such file or directory > After checking write premissions, which I didn't have, > I did an su -l and tried again, with the same results. > > I then tried to unmount the drive, believing it was mounted read-only: > #umount /mnt/goflex > umount: unmount of /mnt/goflex failed: Device busy > > As nearly as I can tell, I don't have anything pointing at that drive. > > Questions: > > 1. What does the "No such file or directory" mean from mkdir? > It's a relative dir name, and I'm sitting at a valid dir. I think I remember having read about problems with "Windows"-based file system use, such as valid directories becoming invalid. The error message you mentioned states /mnt/goflex is not a valid directory (anymore), that's why no directory entry can be created here. Consider NTFS being part of the problem, i. e. problems with the _ntfs file system driver provided by the OS (as it seems you're not using FUSE tools here - there are "fusefs-ntfs" and "ntfsprogs" in the ports collection which may provide a functionality the base system is missing here). > 2. How do I find out how the file-system was mounted? > mount (noargs) does not show read/write status It does - implicitely. For -o ro, it shows "read-only". > 3. I tried lsof but I don't get any output from it: > lsof +d /mnt/goflex -x -- /mnt/goflex > Where does it go if not to stdout? If no output redirection is applied, consider the output being empty, as no error message is displayed (so both stdout and stderr are silent). > 4. lsof has a *long* man page, so I'd like to save it temporarily > so I can search it in an editor. If I do man lsof >temp.tmp > the output contains backspace sequences which screw up searching. > How do I get man to produce plain text without the control sequences? You can use less's search (key "/") when using the "man lsof" command. You can also use a PDF viewer (including text search functionality) so you can keep the formatting details. The following command does the trick: zcat `man -w lsof` | groff -Tps -dpaper=a4 -P-pa4 -mandoc | ps2pdf - /tmp/man_1_lsof.pdf To convert to pure text, use -Tascii or -Tlatin1; however, this renders to pure text without keeping the formatting intact. > 6. And finally, any idea why umount says the device is busy? Maybe there are writes pending, or it's just "held open" by Xfce. Make sure no terminal session has the mount point as current working directory, which would imply "device busy", even if there's no actual reading or writing action. > Seems like I should have been able to find the answer to at > least one of those but I'm coming up short. You could use "umount -f" to force it, but that may result in files missing. Anyway, I've never actually used NTFS with FreeBSD so this could also be a source of the problem. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...