Re: umount device busy
On 06/04/12 13:40, Polytropon wrote: > On Mon, 04 Jun 2012 13:15:33 -0600, Gary Aitken wrote: >> Can you tell me where any of this is documented? >> I can't find squat about gamin. >> no man page and no docs in the /usr/local tree > > Welcome to the realm of modern software and its aversion > against documentation. :-) > > In such cases, you often need to use a web browser, google, > and search for keywords related to your problem. Actually, did, but missed it. I know I had the spelling right because I was flooded with "gaRmin" results and had to check. I'll go hide in the corner now... >> Checked the port options for gamin itself and see there's >> a place to turn on the poller, to that should solve that problem. > > No, this setting is done in a configuration file (installed > version of course). The setting is > > poll /mnt/* > poll /media/* > > or > > poll /dev/* > > or the like - not sure, I'm not using it. It's also an option at build time. Or at least it shows up there: [*] GAM_POLLER Use gamin's poller instead of kqueue's >> But where does one learn about disabling specific directories >> or other info? > > In arbitrary web forums, wikis and user pages. :-) > > Here's an example: > > http://people.gnome.org/~veillard/gamin/config.html Found that easily now, thanks. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
On Mon, 4 Jun 2012, Gary Aitken wrote: On 06/04/12 08:15, Warren Block wrote: gamin opens the directory (of the newly-mounted device) so it can check for new files being created or files being renamed, and then notify the window manager, which updates the user's desktop. The open makes the device in-use, preventing an unmount. Setting gamin to "poll" helps. (I assume it opens the directory, scans, then closes it again, so there's a race condition there, but I haven't encountered it.) gamin can also be disabled for certain directories. That works (AFAIR, it's been a while), but then you lose instant icon updates on the very directories where it is the most useful. Can you tell me where any of this is documented? I can't find squat about gamin. Found on a google-quest after lsof or stat showed gamin locking the directory where I was mounting stuff: http://people.gnome.org/~veillard/gamin/config.html ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
On 06/04/12 02:28, Lars Eighner wrote: >>> This almost always means someone (i.e. you) is sitting in the directory. >>> If you tried this while su'ed and the un-su'ed you were still in the >>> directory /mnt/goflex, you'd get this message. This may also happen if >>> someone (i.e. you) is in the directory on another vtty. Naturally it can >>> also mean some operation is in progress, but generally you would have >>> recognized and avoided that. >> >> That's what I kept thinking. Backed out of all su ops, checked all >> xterms; nada. no other vtys opened. In any case, the mount was done >> after X was started, and switching vtys crashes X so I don't do that. > > This needs fixing. no kidding. at the moment, other stuff has priority... 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? > >>> You've got me! But why is there anything after -x? I don't quite >>> understand. >> >> Otherwise -x thinks the /mnt/goflex belongs to it. > > But what if you leave out ALL the stuff after -x. Isn't it redundant with > the +d switch? (That's not a Socratic question: I don't know.) That's what you get when you build a command line while reading the man page :-) At least in this instance, you get the same result. > Anyway, I found the lsof FAQ by make extract in the port. I quess I am not > too good at reading Makefiles because I don't see why it isn't copied to > /usr/local/share/lsof with the README and whatnot. Thanks, got it. Gary ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
On Mon, 04 Jun 2012 13:15:33 -0600, Gary Aitken wrote: > Can you tell me where any of this is documented? > I can't find squat about gamin. > no man page and no docs in the /usr/local tree Welcome to the realm of modern software and its aversion against documentation. :-) In such cases, you often need to use a web browser, google, and search for keywords related to your problem. > Checked the port options for gamin itself and see there's > a place to turn on the poller, to that should solve that problem. No, this setting is done in a configuration file (installed version of course). The setting is poll /mnt/* poll /media/* or poll /dev/* or the like - not sure, I'm not using it. > But where does one learn about disabling specific directories > or other info? In arbitrary web forums, wikis and user pages. :-) Here's an example: http://people.gnome.org/~veillard/gamin/config.html Of course you need to conclude to use either ~/.gaminrc for your user, or something different than /etc/gamin/mandatory_gaminrc for system-wide use. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
On 06/04/12 08:15, Warren Block wrote: > gamin opens the directory (of the newly-mounted device) so it can check for > new files being created or files being renamed, and then notify the window > manager, which updates the user's desktop. The open makes the device in-use, > preventing an unmount. > > Setting gamin to "poll" helps. (I assume it opens the directory, scans, then > closes it again, so there's a race condition there, but I haven't encountered > it.) > > gamin can also be disabled for certain directories. That works (AFAIR, it's > been a while), but then you lose instant icon updates on the very directories > where it is the most useful. Can you tell me where any of this is documented? I can't find squat about gamin. no man page and no docs in the /usr/local tree Checked the port options for gamin itself and see there's a place to turn on the poller, to that should solve that problem. But where does one learn about disabling specific directories or other info? Thanks, Gary ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount 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. no NTFS driver for FreeBSD is really well done. fusefs based ntfs driver in my opinion is more usable (but not really good) try umount -f ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
On Mon, 4 Jun 2012, Gary Aitken wrote: On 06/03/12 21:05, Polytropon wrote: Maybe the ganim "lock" is regarding a device file? Not sure about that, I'm not using it here. I'm not sure what the deal is here, but exiting X does solve the problem. I didn't try just killing the environment by shutting down the wm and leaving X up, but if I forget and do something like that again I'll try to remember to try it. gamin opens the directory (of the newly-mounted device) so it can check for new files being created or files being renamed, and then notify the window manager, which updates the user's desktop. The open makes the device in-use, preventing an unmount. Setting gamin to "poll" helps. (I assume it opens the directory, scans, then closes it again, so there's a race condition there, but I haven't encountered it.) gamin can also be disabled for certain directories. That works (AFAIR, it's been a while), but then you lose instant icon updates on the very directories where it is the most useful. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
On Mon, 04 Jun 2012 01:56:49 -0600, Gary Aitken wrote: > On 06/03/12 21:05, Polytropon wrote: > > Maybe the ganim "lock" is regarding a device file? Not sure > > about that, I'm not using it here. > > I'm not sure what the deal is here, but exiting X does solve > the problem. I didn't try just killing the environment by > shutting down the wm and leaving X up, but if I forget and > do something like that again I'll try to remember to try it. I assume ganim get launched as a background process by Xfce when starting X, and fortunately it exits when exiting X (and _not_ staying active as a daemon). > >> In any case, the mount was done after X was started, and switching > >> vtys crashes X so I don't do that. > > > > That sounds a bit wrong... > > Agreed, but I saw someone else was having a similar problem > with 9.0 release a bit earlier on a system, and no problem > with 8.3. At least I think that was it. Hmmm, just looked > and there's a firefox-bin.core and an xfce-appfinder.core. > Timestamps look about right for when I did a vty switch. So it's not only X crashing, it's also applications crashing (and so causing a core dump). -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
On Sun, 3 Jun 2012, Gary Aitken wrote: This almost always means someone (i.e. you) is sitting in the directory. If you tried this while su'ed and the un-su'ed you were still in the directory /mnt/goflex, you'd get this message. This may also happen if someone (i.e. you) is in the directory on another vtty. Naturally it can also mean some operation is in progress, but generally you would have recognized and avoided that. That's what I kept thinking. Backed out of all su ops, checked all xterms; nada. no other vtys opened. In any case, the mount was done after X was started, and switching vtys crashes X so I don't do that. This needs fixing. I thought maybe so, but didn't know for sure. Thanks. But Lars' "mount -p" is more assuring. I like it because if you happen to have a configuration you would like to use again, you can capture the output and make it your fstab, + or - automount adjustments. 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? You've got me! But why is there anything after -x? I don't quite understand. Otherwise -x thinks the /mnt/goflex belongs to it. But what if you leave out ALL the stuff after -x. Isn't it redundant with the +d switch? (That's not a Socratic question: I don't know.) Anyway, I found the lsof FAQ by make extract in the port. I quess I am not too good at reading Makefiles because I don't see why it isn't copied to /usr/local/share/lsof with the README and whatnot. man -t lsof | sp2ascii > savefile.txt Where'd you get/find sp2ascii? I don't see one anywhere, not even on google. (Except this thread...) Secret weapon? That's a good question. Turns out all kinds of ps converters are installed by ghostscript. -- Lars Eighner http://www.larseighner.com/index.html 8800 N IH35 APT 1191 AUSTIN TX 78753-5266 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
On 06/03/12 21:05, Polytropon wrote: > Good idea. However, you can do efficient backups of "Windows" > data by using the "ntfsprogs" tools. This makes sure they can > even be read under non-"Windows" systems. I'll look into that. >>> if you are using xfce4, then you have most likely got gamin >>> running as well, this caused the same problem for me when >>> trying to umount an external USB drive >> >> gamin *is* installed, and I did have the file browser up and >> using it to look at the ntfs disk. I thought it might be >> holding a file open, so first I backed it out to something >> not on the ntfs disk, then exited it. Made no difference. > > Maybe the ganim "lock" is regarding a device file? Not sure > about that, I'm not using it here. I'm not sure what the deal is here, but exiting X does solve the problem. I didn't try just killing the environment by shutting down the wm and leaving X up, but if I forget and do something like that again I'll try to remember to try it. >> In any case, the mount was done after X was started, and switching >> vtys crashes X so I don't do that. > > That sounds a bit wrong... Agreed, but I saw someone else was having a similar problem with 9.0 release a bit earlier on a system, and no problem with 8.3. At least I think that was it. Hmmm, just looked and there's a firefox-bin.core and an xfce-appfinder.core. Timestamps look about right for when I did a vty switch. > Typo maybe? A command like "ps2ascii" sounds more reasonable if > we consider PS being the output format. The command duh. need sleep. thanks. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
On Sun, 03 Jun 2012 20:28:28 -0600, Gary Aitken wrote: > > 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). > > may try that but will probably decide to use two different drives > for removable backup, one for windoze and one for fbsd. Good idea. However, you can do efficient backups of "Windows" data by using the "ntfsprogs" tools. This makes sure they can even be read under non-"Windows" systems. > > if you are using xfce4, then you have most likely got gamin > > running as well, this caused the same problem for me when > > trying to umount an external USB drive > > gamin *is* installed, and I did have the file browser up and > using it to look at the ntfs disk. I thought it might be > holding a file open, so first I backed it out to something > not on the ntfs disk, then exited it. Made no difference. Maybe the ganim "lock" is regarding a device file? Not sure about that, I'm not using it here. > In any case, the mount was done after X was started, and switching > vtys crashes X so I don't do that. That sounds a bit wrong... > >> 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. > > Thanks. I get a > grops: can't open file `a4` but I'll deal with that later. That's just for formatting the paper format (ISO A4 here). You can omit those options, the default format (in your case I assume it will be letter) will be selected. > > man -t lsof | sp2ascii > savefile.txt > > Where'd you get/find sp2ascii? I don't see one anywhere, not even on google. > (Except this thread...) Secret weapon? Typo maybe? A command like "ps2ascii" sounds more reasonable if we consider PS being the output format. The command % man -t lsof | ps2ascii > man_1_lsof.txt works as intended. The only remaining control character is ^L, means "page break" (for "form feed" to be precise). > > 6. And finally, any idea why umount says the device is busy? > > > You could use "umount -f" to force it, but that may result in > > files missing. > > hope not, but not a heck of a lot of choices at this point. > Since I didn't do squat because of the failed mkdir, seems hopeful. You can always call the command % sync to request writing any pending buffers; however, the system will decide when the actual writes to the media will happen. :-) > I've mounted them ro a number of times, but never tried writing before. In that case, using "fuse-ntfs" seems to be the better choice as the NTFS support of the base system is considered "good enough for r/o". > > something that *might* be helpful to you, it's a basic little man page > > browser in Qt > > left side of the pane shows a treeview of filesystem, so you can navigate > > /bin, /usr/bin, etc.. when you click on a file it looks for the > > corresponding man page and shows it on the right pane formatted html, which > > is a webkit panel. > > > > https://github.com/creamy/man-browser > > > > it is intended as a way to quickly look at what's installed on your system > > and possibly 'discover' and learn about previously 'unknown' commands. > > Thanks. There's also a traditional way: xman. You can use it like % xman -bothshown then select "Manual Page" and then select a command from the directory on top. It's quite simple, but renders fast. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
Combining several responses to save traffic; thanks all >> 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.On 06/03/12 09:24, >> Polytropon wrote: > 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. It's still valid. I can cd there and look at anything in the subtree. > 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). may try that but will probably decide to use two different drives for removable backup, one for windoze and one for fbsd. > if you are using xfce4, then you have most likely got gamin running as well, > this caused the same problem for me when trying to umount an external USB > drive gamin *is* installed, and I did have the file browser up and using it to look at the ntfs disk. I thought it might be holding a file open, so first I backed it out to something not on the ntfs disk, then exited it. Made no difference. Also, no gamin currently running. But as Warren Block noted, it causes this problem, so I'm assuming that is it. > I resolved my umount problem by including the -f switch > > #umount -f /mnt/goflex Which is what I am ending up doing. > This almost always means someone (i.e. you) is sitting in the directory. > If you tried this while su'ed and the un-su'ed you were still in the > directory /mnt/goflex, you'd get this message. This may also happen if > someone (i.e. you) is in the directory on another vtty. Naturally it can > also mean some operation is in progress, but generally you would have > recognized and avoided that. That's what I kept thinking. Backed out of all su ops, checked all xterms; nada. no other vtys opened. In any case, the mount was done after X was started, and switching vtys crashes X so I don't do that. > You did not provide a history with this problem, but generally it means some > part of the path before the last does not exist. I get it for using a > leading /, when I meant a relative path, or not using the leading slash when > I meant an absolute path -- and of course for misspelling some part of the > path. Nice to know someone else admits to that too :-). In this case, not the problem. >> 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". > > Yes, it does. :) > 'readonly' means just that. 'readonly' NOT shown means read/write. I thought maybe so, but didn't know for sure. Thanks. But Lars' "mount -p" is more assuring. >> 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 > e
Re: umount device busy
On Sun, Jun 3, 2012 at 7:59 AM, 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. > > 2. How do I find out how the file-system was mounted? >mount (noargs) does not show read/write status > > 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? > > 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? > > 5. The lsof man page references a faq which is supposed to be part of the > distribution. >find . -ls | grep lsof doesn't show any faq. > > 6. And finally, any idea why umount says the device is busy? > > Seems like I should have been able to find the answer to at least one of > those but I'm coming up short. > > Thanks for relevant pointers, > > Gary > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscr...@freebsd.org" > something that *might* be helpful to you, it's a basic little man page browser in Qt left side of the pane shows a treeview of filesystem, so you can navigate /bin, /usr/bin, etc.. when you click on a file it looks for the corresponding man page and shows it on the right pane formatted html, which is a webkit panel. https://github.com/creamy/man-browser i built it on a FreeBSD machine but it also works with cygwin systems and probably GNU/Linux as well but i have not tried it. it is intended as a way to quickly look at what's installed on your system and possibly 'discover' and learn about previously 'unknown' commands. Waitman Gobble San Jose California USA ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
On Sun, 3 Jun 2012, Gary Aitken wrote: 6. And finally, any idea why umount says the device is busy? xfce uses gamin to scan for new files and directories, but it causes just this problem. Edit /usr/local/etc/gamin/gaminrc and set it to poll the device directory: poll /mnt/* ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
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. > > 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. The specific complaint was concerning '.' this indicates a filesystem error. Note: it is (or, at least 'used to be') documented that _writing_ to NTFS filesystems was likely to have problems. > > 2. How do I find out how the file-system was mounted? > mount (noargs) does not show read/write status Yes, it does. :) 'readonly' means just that. 'readonly' NOT shown means read/write. > 6. And finally, any idea why umount says the device is busy? ABSOLUTELY! *GRIN* You did a cd to a directory located on that device. you started a 'su' process. Maybe you did a cd to 'somewhere else', or maybe not. Then you tried to umount the device. The current process may have the 'working directory' open on that drive. The _PARENT_ of the su process *DOES* have the 'working directory' open there. The O/S rightly refuses to unmount the device in such a situation. :) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
On Sun, 3 Jun 2012, 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 This almost always means someone (i.e. you) is sitting in the directory. If you tried this while su'ed and the un-su'ed you were still in the directory /mnt/goflex, you'd get this message. This may also happen if someone (i.e. you) is in the directory on another vtty. Naturally it can also mean some operation is in progress, but generally you would have recognized and avoided that. As nearly as I can tell, I don't have anything pointing at that drive. As I said, were you in the directory when you su'd? If so, you need to drop back and get out before you su again an umount. 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. You did not provide a history with this problem, but generally it means some part of the path before the last does not exist. I get it for using a leading /, when I meant a relative path, or not using the leading slash when I meant an absolute path -- and of course for misspelling some part of the path. 2. How do I find out how the file-system was mounted? mount (noargs) does not show read/write status Did you try $mount -p ? 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? You've got me! But why is there anything after -x? I don't quite understand. 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? man -t lsof | sp2ascii > savefile.txt 5. The lsof man page references a faq which is supposed to be part of the distribution. find . -ls | grep lsof doesn't show any faq. I can't find it either, but I don't know why the above did not show /usr/local/share/lsof . /usr/local/share is where to look for such things, and /usr/local/share/doc is generally where any docs that are install are / found. 6. And finally, any idea why umount says the device is busy? Answered above. When you su, where you may go while su'd has no effect on where you left yourself. You (as a normal user) are still on the mounted directory so the mounted device is busy. You have to drop back (exit su) and move out of the device before you can umount it. Seems like I should have been able to find the answer to at least one of those but I'm coming up short. Thanks for relevant pointers, -- Lars Eighner http://www.larseighner.com/index.html 8800 N IH35 APT 1191 AUSTIN TX 78753-5266 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
Hi Gary, if you are using xfce4, then you have most likely got gamin running as well, this caused the same problem for me when trying to umount an external USB drive I resolved my umount problem by including the -f switch #umount -f /mnt/goflex Dave Whytcross - Original Message - From: "Gary Aitken" To: "FreeBSD Mailing List" Sent: Monday, June 04, 2012 12:59 AM Subject: umount device busy 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. 2. How do I find out how the file-system was mounted? mount (noargs) does not show read/write status 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? 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? 5. The lsof man page references a faq which is supposed to be part of the distribution. find . -ls | grep lsof doesn't show any faq. 6. And finally, any idea why umount says the device is busy? Seems like I should have been able to find the answer to at least one of those but I'm coming up short. Thanks for relevant pointers, Gary ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Re: umount device busy
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, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
umount device busy
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. 2. How do I find out how the file-system was mounted? mount (noargs) does not show read/write status 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? 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? 5. The lsof man page references a faq which is supposed to be part of the distribution. find . -ls | grep lsof doesn't show any faq. 6. And finally, any idea why umount says the device is busy? Seems like I should have been able to find the answer to at least one of those but I'm coming up short. Thanks for relevant pointers, Gary ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"