Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Feb 2008 08:20:12 GMT
From:      Dominic Fandrey <kamikaze@bsdforen.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/120784: [patch] allow mount from fstab with 3rd party tools like ntfs-3g
Message-ID:  <200802180820.m1I8KCpB021661@www.freebsd.org>
Resent-Message-ID: <200802180830.m1I8U2rS016137@freefall.freebsd.org>

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

>Number:         120784
>Category:       bin
>Synopsis:       [patch] allow mount from fstab with 3rd party tools like ntfs-3g
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 18 08:30:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Dominic Fandrey
>Release:        RELENG_7
>Organization:
private
>Environment:
# uname -a                                        0 /usr/src
FreeBSD mobileKamikaze.norad 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #3: Wed Feb 13 17:52:28 CET 2008     root@mobileKamikaze.norad:/usr/obj/HP6510b/amd64/usr/src/sys/HP6510b  amd64
>Description:
With the new mount system 3rd party mounts like the following do not work any more (this is from my fstab):

/dev/ntfs/2vault	/mnt/vault	ntfs-3g	rw,late,gid=5,umask=113,dmask=002		0	0

Because the old style mount is only used for known types like ntfs. My workaround was so far to do the following:

# mv /sbin/mount_ntfs /sbin/mount_ntfs.orig
# ln -s /usr/sbin/mount_ntfs-3g /sbin/mount_ntfs

I don't like this method and it has to be applied after every installworld.

So instead I hacked the mount source to fall back to the old style, when mounting failed.
>How-To-Repeat:
Try using any 3rd party mount tool like mount_ntfs-3g or mount_sshfs (fuse ports) in "mount -t ntfs-3g" style. They will not work. Instead you'll have to directly use "mount_ntfs-3g".
>Fix:
Files sbin/mount.orig/.mount.c.swp and sbin/mount/.mount.c.swp differ
diff -Pur sbin/mount.orig/mount.c sbin/mount/mount.c
--- sbin/mount.orig/mount.c	2008-02-18 09:07:45.000000000 +0100
+++ sbin/mount/mount.c	2008-02-18 09:11:16.000000000 +0100
@@ -560,7 +560,12 @@
 	if (use_mountprog(vfstype)) {
 		ret = exec_mountprog(name, execname, argv);
 	} else {
-		ret = mount_fs(vfstype, argc, argv); 
+		ret = mount_fs(vfstype, argc, argv);
+		if (ret < 0) {
+			if (verbose)
+				warn("falling back to old style mount");
+			ret = exec_mountprog(name, execname, argv);
+		}
 	}
 
 	free(optbuf);
diff -Pur sbin/mount.orig/mount_fs.c sbin/mount/mount_fs.c
--- sbin/mount.orig/mount_fs.c	2008-02-18 09:07:45.000000000 +0100
+++ sbin/mount/mount_fs.c	2008-02-18 08:58:31.000000000 +0100
@@ -131,8 +131,6 @@
 	build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
 	
 	ret = nmount(iov, iovlen, mntflags);
-	if (ret < 0)
-		err(1, "%s %s", dev, errmsg);
 
 	return (ret);
 }


>Release-Note:
>Audit-Trail:
>Unformatted:



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