Re-starting a gjournal provider

Pawel Jakub Dawidek pjd at FreeBSD.org
Wed Jul 29 14:04:22 UTC 2009


On Sun, Jul 19, 2009 at 03:01:02AM -0600, Anthony Chavez wrote:
> Hello freebsd-fs,
> 
> I'm trying to get gjournal working on a "removable" hard disk.  I use
> the term loosely, because I'm using a very simple eSATA enclosure: an
> AMS Venus DS5 [1].
> 
> If I swap out disks, atacontrol cap ad0 seems sufficient enough to
> detect the new drive: the reported device model, serial number, firmware
> revision, and CHS values change as one would expect.
> 
> My interpretation of [2] section 5.3 and gjournal(8) is that the
> following sequence of commands should ensure me that all write buffers
> have been flushed and bring the system to a point where it is safe to
> remove a disk.
> 
> sync; sync; sync
> gjournal sync
> umount /dev/ad0s1.journal
> gjournal stop ad0s1.journal

You should first unmount and then call 'gjournal sync'.

> However, once they are executed, /dev/ad0s1.journal disappears and when
> I swap out the disk it doesn't come back.  The only way I've found to
> bring it back is atacontrol detach ata0; atacontrol attach ata0, which
> doesn't seem like a wise thing to do if I have another device on the
> same channel.

It doesn't come back because something (ATA layer?) doesn't properly
remove ad0 provider. When you remove the disk, /dev/ad0 should disappear
and reappear once you insert it again.

You can still do this trick after you insert the disk again so the GEOM
can schedule retaste:

	# true > /dev/ad0

> My question is, do I need to issue gjournal stop before I swap disks?
> And if so, is there any way that I can avoid the atacontrol
> detach/attach cycle that would need to take place before any mount is
> attempted so that /dev/ad0s1.journal appears (if in the drive inserted
> at the time does in fact utilize gjournal; I may want to experiment with
> having disks with either gjournal or soft updates)?
> 
> And while I'm on the subject, are the (gjournal) syncs commands
> preceeding umount absolutely necessary in the case of removable media?

'gjournal sync' should follow unmount, not the other way around. And its
better to do it, but 'gjournal stop' should do the same.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20090729/af00d705/attachment.pgp


More information about the freebsd-fs mailing list