From rsmith@xs4all.nl  Fri Dec  1 18:15:55 2006
Return-Path: <rsmith@xs4all.nl>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id D8BD816A415;
	Fri,  1 Dec 2006 18:15:55 +0000 (UTC)
	(envelope-from rsmith@xs4all.nl)
Received: from smtp-vbr12.xs4all.nl (smtp-vbr12.xs4all.nl [194.109.24.32])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1E24A43CAE;
	Fri,  1 Dec 2006 18:15:39 +0000 (GMT)
	(envelope-from rsmith@xs4all.nl)
Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160])
	by smtp-vbr12.xs4all.nl (8.13.8/8.13.8) with ESMTP id kB1IFrPS012580;
	Fri, 1 Dec 2006 19:15:54 +0100 (CET)
	(envelope-from rsmith@xs4all.nl)
Received: by slackbox.xs4all.nl (Postfix, from userid 1001)
	id 67AA8B844; Fri,  1 Dec 2006 19:15:53 +0100 (CET)
Message-Id: <20061201181553.67AA8B844@slackbox.xs4all.nl>
Date: Fri,  1 Dec 2006 19:15:53 +0100 (CET)
From: Roland Smith <rsmith@xs4all.nl>
Reply-To: Roland Smith <rsmith@xs4all.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc: doc@freebsd.org
Subject: [PATCH] extend the documentation for handling USB drives
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         106148
>Category:       docs
>Synopsis:       [PATCH] extend the documentation for handling USB drives
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    blackend
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 01 18:20:10 GMT 2006
>Closed-Date:    Thu Dec 07 11:48:54 GMT 2006
>Last-Modified:  Thu Dec  7 11:50:05 GMT 2006
>Originator:     Roland Smith
>Release:        FreeBSD 6.2-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD slackbox.xs4all.nl 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Sat Nov 25 00:14:25 CET 2006 rsmith@slackbox.xs4all.nl:/usr/obj/usr/src/sys/RFS amd64


	
>Description:
The disks chapter of the handbook is quite short in its description of the
handling of USB mass-storage drives. The included patch is an attempt to
expand/clarify this for new users.

	
>How-To-Repeat:
N/A
>Fix:
This patch has been tested to apply cleanly on revision 1.265 and 1.267.

------- patch for en_US.ISO8859-1/books/handbook/disks/chapter.sgml -------
--- chapter.sgml.orig	Sun Oct  8 17:01:02 2006
+++ chapter.sgml	Sun Oct  8 17:48:40 2006
@@ -777,6 +777,68 @@
       <para>to your configuration file for USB 2.0 support.  Note
 	&man.uhci.4; and &man.ohci.4; drivers are still needed if you
 	want USB 1.X support.</para>
+
+      <para>To make these devices mountable as a normal user, certain steps
+	have to be taken. First, the devices that are created when a USB
+	storage device is connected need to be accessible. A solution is to
+	create a group (e.g. named usb) that users of these devices need to
+	belong to. This is done with &man.pw.8;. The users in question also
+	need to be added to that group. This is also done with
+	&man.pw.8;. Second, when the devices are created, they have to be
+	accessible by this group. This is accomplished by adding a line for
+	these devices to &man.devfs.rules.5;;
+      </para>
+
+      <programlisting>add path 'da*' mode 0660 group usb</programlisting>
+
+      <note>
+	<para>If you already have SCSI disks in your system, you want to
+	  do this a bit different. E.g., if you already have
+	  disks <filename>da0</filename> through <filename>da2</filename>
+	  attached to the system, change the line as follows:
+	</para>
+
+	<programlisting>add path 'da[3-9]*' mode 0660 group usb</programlisting>
+
+	<para>This will exclude the already existing disks from the usb
+	  group.
+	</para>
+
+      </note>
+
+      <para>Next, the kernel has to be configured to allow regular users to
+	mount filesystems. The easiest way is to add the following line to
+	&man.sysctl.conf.5;:
+      </para>
+
+      <programlisting>vfs.usermount=1</programlisting>
+
+     <para>Note that this only takes effect after the next
+       reboot. Alternatively, one can also use &man.sysctl.8; to set this
+       variable.
+     </para>
+
+     <para>The final step is to create a directory where the filesystem is
+       to be mounted. This directory needs to be owned by the user that is
+       to mount the filesystem. One way to do that is for root to create a
+       subdirectory owned by that user
+       as <filename>/mnt/$USER</filename> (replace $USER by the login name
+       of the actual user):
+     </para>
+
+    <programlisting>
+mkdir /mnt/$USER
+chown $USER:$USER /mnt/$USER</programlisting>
+
+     <para>Suppose a USB thumbdrives is plugged in, and a
+       device <filename>/dev/da0s1</filename> appears. Since these devices
+       usually come preformatted with a FAT filesystem, one can mount them
+       like this:
+     </para>
+
+     <programlisting>mount_msdosfs -m 644 -M 755 /dev/da0s1
+       /mnt/$USER</programlisting>
+
     </sect2>
 
     <sect2>
------- patch for en_US.ISO8859-1/books/handbook/disks/chapter.sgml -------
>Release-Note:
>Audit-Trail:

From: Marc Fonvieille <blackend@FreeBSD.org>
To: Roland Smith <rsmith@xs4all.nl>
Cc: FreeBSD-gnats-submit@FreeBSD.org, doc@FreeBSD.org
Subject: Re: docs/106148: [PATCH] extend the documentation for handling USB drives
Date: Sat, 2 Dec 2006 10:22:30 +0100

 On Fri, Dec 01, 2006 at 07:15:53PM +0100, Roland Smith wrote:
 > 
 > >Description:
 > The disks chapter of the handbook is quite short in its description of the
 > handling of USB mass-storage drives. The included patch is an attempt to
 > expand/clarify this for new users.
 > 
 > 	
 > >How-To-Repeat:
 > N/A
 > >Fix:
 > This patch has been tested to apply cleanly on revision 1.265 and 1.267.
 > 
 > ------- patch for en_US.ISO8859-1/books/handbook/disks/chapter.sgml -------
 > --- chapter.sgml.orig	Sun Oct  8 17:01:02 2006
 > +++ chapter.sgml	Sun Oct  8 17:48:40 2006
 > @@ -777,6 +777,68 @@
 >        <para>to your configuration file for USB 2.0 support.  Note
 >  	&man.uhci.4; and &man.ohci.4; drivers are still needed if you
 >  	want USB 1.X support.</para>
 > +
 > +      <para>To make these devices mountable as a normal user, certain steps
 > +	have to be taken. First, the devices that are created when a USB
 > +	storage device is connected need to be accessible. A solution is to
 > +	create a group (e.g. named usb) that users of these devices need to
 > +	belong to. This is done with &man.pw.8;. The users in question also
 > +	need to be added to that group. This is also done with
 > +	&man.pw.8;. Second, when the devices are created, they have to be
 > +	accessible by this group. This is accomplished by adding a line for
 > +	these devices to &man.devfs.rules.5;;
 > +      </para>
 > +
 > +      <programlisting>add path 'da*' mode 0660 group usb</programlisting>
 > +
 > +      <note>
 > +	<para>If you already have SCSI disks in your system, you want to
 > +	  do this a bit different. E.g., if you already have
 > +	  disks <filename>da0</filename> through <filename>da2</filename>
 > +	  attached to the system, change the line as follows:
 > +	</para>
 > +
 > +	<programlisting>add path 'da[3-9]*' mode 0660 group usb</programlisting>
 > +
 > +	<para>This will exclude the already existing disks from the usb
 > +	  group.
 > +	</para>
 
 [...]
 
 Your idea is a great improvement to the current section, but I think it
 would be better to use the same scheme as the one used by the FreeBSD
 GNOME team for HAL, i.e, using operator group as in
 http://www.freebsd.org/gnome/docs/faq2.html#q19
 This would keep a consistency between our docs and would be compatible
 with GNOME and other things using HAL.
 
 -- 
 Marc

From: Roland Smith <rsmith@xs4all.nl>
To: Marc Fonvieille <blackend@FreeBSD.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org, doc@FreeBSD.org
Subject: Re: docs/106148: [PATCH] extend the documentation for handling USB drives
Date: Sat, 2 Dec 2006 12:55:48 +0100

 --3V7upXqbjpZ4EhLz
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Sat, Dec 02, 2006 at 10:22:30AM +0100, Marc Fonvieille wrote:
 > On Fri, Dec 01, 2006 at 07:15:53PM +0100, Roland Smith wrote:
 > >=20
 > > >Description:
 > > The disks chapter of the handbook is quite short in its description of =
 the
 > > handling of USB mass-storage drives. The included patch is an attempt to
 > > expand/clarify this for new users.
 > >=20
 > >=20
 > > ------- patch for en_US.ISO8859-1/books/handbook/disks/chapter.sgml ---=
 ----
 > > --- chapter.sgml.orig	Sun Oct  8 17:01:02 2006
 > > +++ chapter.sgml	Sun Oct  8 17:48:40 2006
 > > @@ -777,6 +777,68 @@
 > >        <para>to your configuration file for USB 2.0 support.  Note
 > >  	&man.uhci.4; and &man.ohci.4; drivers are still needed if you
 > >  	want USB 1.X support.</para>
 > > +
 > > +      <para>To make these devices mountable as a normal user, certain =
 steps
 > > +	have to be taken. First, the devices that are created when a USB
 > > +	storage device is connected need to be accessible. A solution is to
 > > +	create a group (e.g. named usb) that users of these devices need to
 > > +	belong to. This is done with &man.pw.8;. The users in question also
 > > +	need to be added to that group. This is also done with
 > > +	&man.pw.8;. Second, when the devices are created, they have to be
 > > +	accessible by this group. This is accomplished by adding a line for
 > > +	these devices to &man.devfs.rules.5;;
 > > +      </para>
 > > +
 > > +      <programlisting>add path 'da*' mode 0660 group usb</programlisti=
 ng>
 > > +
 > > +      <note>
 > > +	<para>If you already have SCSI disks in your system, you want to
 > > +	  do this a bit different. E.g., if you already have
 > > +	  disks <filename>da0</filename> through <filename>da2</filename>
 > > +	  attached to the system, change the line as follows:
 > > +	</para>
 > > +
 > > +	<programlisting>add path 'da[3-9]*' mode 0660 group usb</programlisti=
 ng>
 > > +
 > > +	<para>This will exclude the already existing disks from the usb
 > > +	  group.
 > > +	</para>
 >=20
 > [...]
 >=20
 > Your idea is a great improvement to the current section, but I think it
 > would be better to use the same scheme as the one used by the FreeBSD
 > GNOME team for HAL, i.e, using operator group as in
 > http://www.freebsd.org/gnome/docs/faq2.html#q19
 > This would keep a consistency between our docs and would be compatible
 > with GNOME and other things using HAL.
 
 Ok. I'll rework the patch and post it tomorrow.=20
 
 Roland
 --=20
 R.F.Smith                                   http://www.xs4all.nl/~rsmith/
 [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
 pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
 
 --3V7upXqbjpZ4EhLz
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.5 (FreeBSD)
 
 iD8DBQFFcWnEEnfvsMMhpyURAsoEAKCZiFwl3M0ixnv+E1LZ8izBrKfUkgCffDXX
 Lj3rf2FvVJBDhCb+Fd35xtE=
 =YMW4
 -----END PGP SIGNATURE-----
 
 --3V7upXqbjpZ4EhLz--

From: Roland Smith <rsmith@xs4all.nl>
To: Marc Fonvieille <blackend@FreeBSD.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org, doc@FreeBSD.org
Subject: Re: docs/106148: [PATCH] extend the documentation for handling USB drives
Date: Sun, 3 Dec 2006 00:12:49 +0100

 --VbJkn9YxBvnuCH5J
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Sat, Dec 02, 2006 at 10:22:30AM +0100, Marc Fonvieille wrote:
 
 > Your idea is a great improvement to the current section, but I think it
 > would be better to use the same scheme as the one used by the FreeBSD
 > GNOME team for HAL, i.e, using operator group as in
 > http://www.freebsd.org/gnome/docs/faq2.html#q19
 > This would keep a consistency between our docs and would be compatible
 > with GNOME and other things using HAL.
 
 Here is the new patch, as promised:
 
 ---- /usr/doc/en_US.ISO8859-1/books/handbook/disks/chapter.sgml patch ----
 --- chapter.sgml.orig	Sun Oct  8 17:01:02 2006
 +++ chapter.sgml	Sat Dec  2 12:55:30 2006
 @@ -777,6 +777,67 @@
        <para>to your configuration file for USB 2.0 support.  Note
  	&man.uhci.4; and &man.ohci.4; drivers are still needed if you
  	want USB 1.X support.</para>
 +
 +      <para>To make these devices mountable as a normal user, certain steps
 +	have to be taken. First, the devices that are created when a USB
 +	storage device is connected need to be accessible by the user. A
 +	solution is to make all users of these devices a member of the
 +	operator group. This is also done with &man.pw.8;. Second, when the
 +	devices are created, the operator group should be able to read and
 +	write them. This is accomplished by adding a line for these devices
 +	to &man.devfs.rules.5;;
 +      </para>
 +
 +      <programlisting>add path 'da*' mode 0660 group operator</programlist=
 ing>
 +
 +      <note>
 +	<para>If there already are SCSI disks in the system, it must be
 +	  done a bit different. E.g., if the system already contains
 +	  disks <filename>da0</filename> through <filename>da2</filename>
 +	  attached to the system, change the line as follows:
 +	</para>
 +
 +	<programlisting>add path 'da[3-9]*' mode 0660 group operator</programlist=
 ing>
 +
 +	<para>This will exclude the already existing disks from belonging
 +	  to the operator group.
 +	</para>
 +
 +      </note>
 +
 +      <para>Next, the kernel has to be configured to allow regular users to
 +	mount filesystems. The easiest way is to add the following line to
 +	&man.sysctl.conf.5;:
 +      </para>
 +
 +      <programlisting>vfs.usermount=3D1</programlisting>
 +
 +     <para>Note that this only takes effect after the next
 +       reboot. Alternatively, one can also use &man.sysctl.8; to set this
 +       variable.
 +     </para>
 +
 +     <para>The final step is to create a directory where the filesystem is
 +       to be mounted. This directory needs to be owned by the user that is
 +       to mount the filesystem. One way to do that is for root to create a
 +       subdirectory owned by that user
 +       as <filename>/mnt/$USER</filename> (replace $USER by the login name
 +       of the actual user):
 +     </para>
 +
 +    <programlisting>
 +mkdir /mnt/$USER
 +chown $USER:$USER /mnt/$USER</programlisting>
 +
 +     <para>Suppose a USB thumbdrives is plugged in, and a
 +       device <filename>/dev/da0s1</filename> appears. Since these devices
 +       usually come preformatted with a FAT filesystem, one can mount them
 +       like this:
 +     </para>
 +
 +     <programlisting>mount_msdosfs -m 644 -M 755 /dev/da0s1
 +       /mnt/$USER</programlisting>
 +
      </sect2>
 =20
      <sect2>
 
 ---- /usr/doc/en_US.ISO8859-1/books/handbook/disks/chapter.sgml patch ----
 
 Roland
 --=20
 R.F.Smith                                   http://www.xs4all.nl/~rsmith/
 [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
 pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
 
 --VbJkn9YxBvnuCH5J
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.5 (FreeBSD)
 
 iD8DBQFFcghxEnfvsMMhpyURAkrtAKCXRK5eq7m1pscMswjnqktefb6tWQCcDswe
 JfhDiF2TC7ZXyjzs3Qx85Fg=
 =s9gU
 -----END PGP SIGNATURE-----
 
 --VbJkn9YxBvnuCH5J--
Responsible-Changed-From-To: freebsd-doc->blackend 
Responsible-Changed-By: blackend 
Responsible-Changed-When: Sun Dec 3 19:47:06 UTC 2006 
Responsible-Changed-Why:  
I'll take care of it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106148 

From: Ceri Davies <ceri@submonkey.net>
To: Roland Smith <rsmith@xs4all.nl>
Cc: FreeBSD Gnats Submit <freebsd-gnats-submit@FreeBSD.org>,
	blackend@FreeBSD.org
Subject: Re: docs/106148: [PATCH] extend the documentation for handling USB drives
Date: Tue, 5 Dec 2006 21:53:39 +0000

 On Sat, Dec 02, 2006 at 11:20:26PM +0000, Roland Smith wrote:
 
 >  +     <para>Suppose a USB thumbdrives is plugged in, and a
 
 Typo: s/ves/ve/
 
 Ceri
 -- 
 That must be wonderful!  I don't understand it at all.
                                                   -- Moliere
State-Changed-From-To: open->closed 
State-Changed-By: blackend 
State-Changed-When: Thu Dec 7 11:47:41 UTC 2006 
State-Changed-Why:  
I committed a slightly different version of your patch (SGML tagging and 
some little fixes). 
Thanks for the submission. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106148 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/106148: commit references a PR
Date: Thu,  7 Dec 2006 11:48:47 +0000 (UTC)

 blackend    2006-12-07 11:47:36 UTC
 
   FreeBSD doc repository
 
   Modified files:
     en_US.ISO8859-1/books/handbook/disks chapter.sgml 
   Log:
   In the USB storage section:
   Describe how to make USB devices mountable as a normal user.
   
   PR:             docs/106148
   Submitted by:   Roland Smith <rsmith@xs4all.nl>
   With some help from:    ceri@
   
   Revision  Changes    Path
   1.268     +57 -0     doc/en_US.ISO8859-1/books/handbook/disks/chapter.sgml
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
