Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Aug 2008 13:49:11 -0700 (PDT)
From:      Cy Schubert <cy@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/126633: Snapshot Utiity on a UFS-only System loads zfs kld
Message-ID:  <200808182049.m7IKnBI7003810@cwsys.cwsent.com>
Resent-Message-ID: <200808182110.m7ILA15V039072@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         126633
>Category:       ports
>Synopsis:       Snapshot Utiity on a UFS-only System loads zfs kld
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 18 21:10:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Cy Schubert
>Release:        FreeBSD-2.0
>Organization:
FreeBSD
>Environment:
System: FreeBSD cwsys 7.0-STABLE FreeBSD 7.0-STABLE #0: Sun Jul 13 14:50:29 PDT 2008 root@cwsys:/export/obj/opt/src/svn-stable7/sys/KOMQUATS i386


	
>Description:
The snapshot utility is a great application. I have a patch that would be 
helpful on UFS-only systems. When snapshot is run it issues zfs commands 
which automatically kldload the ZFS kld. Though I use ZFS on one of my 
servers, the rest of my systems don't use it yet and I have no plans to use 
it on my laptop FreeBSD system. Here is a patch that would only perform ZFS 
snapshot operations if the ZFS kernel module is loaded.
>How-To-Repeat:
Run snapshot or periodic-snapshot on a UFS-only system.
>Fix:

--- /usr/local/sbin/snapshot	2008-01-04 10:36:18.000000000 -0800
+++ snapshot.new	2008-05-15 15:08:02.000000000 -0700
@@ -142,7 +142,7 @@
                 fi
             fi
         fi
-        if (zfs list $fs_dir) >/dev/null 2>&1; then
+        if (kldstat -q -m zfs && zfs list $fs_dir) >/dev/null 2>&1; then
             #   ZFS filesystem
             fs_type="zfs"
             zfs=`zfs list -H -o name $fs_dir`
@@ -263,7 +263,7 @@
     fi
 
     #   operate on filesystem
-    if (zfs list $fs_dir) >/dev/null 2>&1; then
+    if (kldstat -q -m zfs && zfs list $fs_dir) >/dev/null 2>&1; then
         #   ZFS filesystem
         fs_name=`zfs list -H -o name $fs_dir`
 
@@ -357,7 +357,7 @@
     parseFTG "$fs"
 
     #   operate on filesystem
-    if (zfs list $fs_dir) >/dev/null 2>&1; then
+    if (kldstat -q -m zfs && zfs list $fs_dir) >/dev/null 2>&1; then
         #   ZFS filesystem
 
         #   check for existence of snapshot
@@ -420,7 +420,7 @@
     parseFTG "$fs"
 
     #   operate on filesystem
-    if (zfs list $fs_dir) >/dev/null 2>&1; then
+    if (kldstat -q -m zfs && zfs list $fs_dir) >/dev/null 2>&1; then
         #   ZFS filesystem
 
         #   check for existence of snapshot
>Release-Note:
>Audit-Trail:
>Unformatted:



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