From owner-freebsd-rc@FreeBSD.ORG Sun Jan 24 22:58:57 2010 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A8A3106566B; Sun, 24 Jan 2010 22:58:57 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) by mx1.freebsd.org (Postfix) with ESMTP id 0533A8FC08; Sun, 24 Jan 2010 22:58:56 +0000 (UTC) Received: from elsa.codelab.cz (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 968AD19E023; Sun, 24 Jan 2010 23:58:55 +0100 (CET) Received: from [192.168.1.2] (r5bb235.net.upc.cz [86.49.61.235]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 4698219E019; Sun, 24 Jan 2010 23:58:53 +0100 (CET) Message-ID: <4B5CD0AC.7090302@quip.cz> Date: Sun, 24 Jan 2010 23:58:52 +0100 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.7) Gecko/20100104 SeaMonkey/2.0.2 MIME-Version: 1.0 To: freebsd-geom@freebsd.org Content-Type: multipart/mixed; boundary="------------090909040006080506080000" Cc: freebsd-rc@FreeBSD.org Subject: ordering problem with gjournal and iSCSI initiator X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2010 22:58:57 -0000 This is a multi-part message in MIME format. --------------090909040006080506080000 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Hi, I don't know what mailing list is better for this problem, so I post to both. I have server with local partition using gjournal (mfid0s2f.journal). It is mounted from fstab by this line: /dev/mfid0s2f.journal /vol0 ufs rw,async,nosuid,noexec,noatime 2 2 Then I have storage connected by iSCSI initiator by attached rc script. It should be mounted by this script according to fstab.iscsi line: /dev/da0p1.journal /vol1 ufs rw,async,nosuid,noexec,noatime 2 2 But there is a problem, both partitions are journaled and journal is on local disk. It means that only the first partition is checked and mounted at boot time. GEOM_JOURNAL: Journal 2395012627: mfid0s2d contains journal. GEOM_JOURNAL: Journal 1544711416: mfid0s2e contains journal. GEOM_JOURNAL: Journal 2395012627: mfid0s2f contains data. GEOM_JOURNAL: Journal mfid0s2f clean. GEOM_JOURNAL: BIO_FLUSH not supported by mfid0s2d. GEOM_JOURNAL: BIO_FLUSH not supported by mfid0s2f. Root mount waiting for: GJOURNAL Root mount waiting for: GJOURNAL Root mount waiting for: GJOURNAL Root mount waiting for: GJOURNAL Root mount waiting for: GJOURNAL GEOM_JOURNAL: Timeout. Journal gjournal 1544711416 cannot be completed. This is because second data provider is not available at this time. rc.d/iscsi is executed later. (after NETWORKING, SERVERS, before DAEMON) But da0p1.journal is not created later (after iscsi created /dev/da0) with this message: GEOM_JOURNAL: Journal 1544711416: da0p1 contains data. GEOM_JOURNAL: Timeout. Journal gjournal 1544711416 cannot be completed. And that's why /vol1 can't be mounted by rc.d/iscsi. My question is: Is there any "Right Way" to handle this case? How can I "create" da0p1.journal later and complete the gjournal + mount? The device da0p1.journal is only created if I manually do: unmount /vol0 gjournal stop mfid0s2f.journal kldunload geom_journal kldload geom_journal Then there are both entries created: /dev/mfid0s2f.journal /dev/da0p1.journal And both can be manualy mounted Miroslav Lachman --------------090909040006080506080000 Content-Type: text/plain; name="iscsi.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iscsi.txt" #!/bin/sh # PROVIDE: iscsi # REQUIRE: NETWORKING # BEFORE: DAEMON # KEYWORD: nojail shutdown # # Add the following lines to /etc/rc.conf to enable iscsi: # # iscsi_enable="YES" # iscsi_fstab="/etc/fstab.iscsi" . /etc/rc.subr name=iscsi rcvar=`set_rcvar` command=/sbin/iscontrol iscsi_enable=${iscsi_enable:-"NO"} iscsi_fstab=${iscsi_fstab:-"/etc/fstab.iscsi"} iscsi_exports=${iscsi_exports:-"/etc/exports.iscsi"} iscsi_debug=${iscsi_debug:-0} start_cmd="iscsi_start" faststop_cmp="iscsi_stop" stop_cmd="iscsi_stop" iscsi_wait() { dev=$1 trap "echo 'wait loop cancelled'; exit 1" 2 count=0 while true; do if [ -c $dev ]; then break; fi if [ $count -eq 0 ]; then echo -n Waiting for ${dev}': ' fi count=$((${count} + 1)) if [ $count -eq 6 ]; then echo " Failed for dev=$dev" return 0 break fi echo -n '.' sleep 5; done echo "$dev ok." return 1 } iscsi_start() { # # load needed modules for m in iscsi_initiator geom_label; do kldstat -qm $m || kldload $m done sysctl debug.iscsi_initiator=$iscsi_debug # # start iscontrol for each target if [ -n "${iscsi_targets}" ]; then for target in ${iscsi_targets}; do ${command} ${rc_flags} -n ${target} done fi if [ -f "${iscsi_fstab}" ]; then while read spec file type opt t1 t2 do case ${spec} in \#*|'') ;; *) if iscsi_wait ${spec}; then break; fi echo type=$type spec=$spec file=$file fsck -p ${spec} && mkdir -p ${file} && mount ${spec} ${file} chmod 755 ${file} ;; esac done < ${iscsi_fstab} fi if [ -f "${iscsi_exports}" ]; then cat ${iscsi_exports} >> /etc/exports #/etc/rc.d/mountd reload kill -1 `cat /var/run/mountd.pid` fi } iscsi_stop() { echo 'iscsi stopping' while read spec file type opt t1 t2 do case ${spec} in \#*|'') ;; *) echo iscsi: umount $spec umount -fv $spec ;; esac done < ${iscsi_fstab} } load_rc_config $name run_rc_command "$1" --------------090909040006080506080000--