docs/106148: [PATCH] extend the documentation for handling USB drives
Roland Smith
rsmith at xs4all.nl
Sat Dec 2 23:13:01 UTC 2006
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</programlisting>
+
+ <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</programlisting>
+
+ <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=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>
---- /usr/doc/en_US.ISO8859-1/books/handbook/disks/chapter.sgml patch ----
Roland
--
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)
-------------- 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-doc/attachments/20061203/00fe76ef/attachment.sig>
More information about the freebsd-doc
mailing list