Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 2006 11:25:34 -0500
From:      "M. L. Dodson" <mldodson@houston.rr.com>
To:        John-Mark Gurney <gurney_j@resnet.uoregon.edu>
Cc:        freebsd-firewire@freebsd.org
Subject:   Re: devfs and hot unplugging firewire device
Message-ID:  <200609191125.35128.mldodson@houston.rr.com>
In-Reply-To: <20060919160447.GC23915@funkthat.com>
References:  <200609191005.17015.mldodson@houston.rr.com> <20060919160447.GC23915@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 19 September 2006 11:04, John-Mark Gurney wrote:
> M. L. Dodson wrote this message on Tue, Sep 19, 2006 at 10:05 -0500:
> > When I finished a dump/restore, I just pulled the cable (the
> > firewire disk partitions were not mounted).  When I plugged in the
>
> The problem is that the old devices still are open for writing.. If
> you were to umount -f the old fs, most likely, the devices would
> wither away, and things would be back to normal...
>

Hmmm... I just looked at the umount man page.  I guess the
behaviour you describe can be implied by it, but it is certainly
not obvious (at least to me).  So, if I understand you, if instead
of "umount /mnt", I do "umount -f /mnt", the behaviour will be as
I expected: the device will be completely unmounted and the device
will disappear when I pull the cable?

> I hope you were fsync'ing the files before you unmounted the disk
> to ensure that the file was completely written to disk, otherwise
> you could end up w/ the an incomplete file...
>

Actually, my sequence was: fsck the /dev/da0s1* (excluding b and
c), and that was where I noticed the problem (on the second
firewire disk in the sequence of 7 disks dumped), then dump the g
partition to a file on the server's main disk.  Then I did a
restore -if <dumped to file> in the directory I wanted the stuff
to go into.  I did it this way so I could exclude some unimportant
stuff that was in the /home directory on the firewire disk
(corresponding to /dev/da0s1g).  The only time I mounted the disk
was to rsync between the firewire /home (/dev/da0s1g) and the
restored data directory to check for errors.  (This data cost
weeks of computation for many of the files, so better to take a
little time to wear belt AND suspenders).  The firewire disk was
only ever read from, not written to except for the fsck.  Your
answer implies to me that if I had never mounted the device it
would have gone away when I pulled the cable.  Right?

> > My question: Should I be doing something to signal devfs I'm going
> > to unplug a device so it won't get confused when I plug in another
> > similar, but not the same, device?  camcontrol commands like
> > "camcontrol eject <options>" and "camcontrol rescan all" seemed to
> > not have the results I expected.  What's going on here?
>
> umount the file system...  I unplug firewire drives that don't have
> mounted filesystems, and haven't had an issue with it...

OK, that is certainly what I get from your first couple of
paragraphs.  Thanks for the explanation!

Bud Dodson
-- 
M. L. Dodson
Email:	mldodson-at-houston-dot-rr-dot-com
Phone:	eight_three_two-56_three-386_one




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609191125.35128.mldodson>