People havn't cared about floppies in ages so convert to using

da0 instead of fd0

Worse though is the continued reference to block devices
which havn't existed since the 3.x days.

Approved by:	bcr (mentor)
This commit is contained in:
Eitan Adler 2012-11-01 03:53:41 +00:00
parent b3d3ee17d4
commit 20181e02ab
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=39888

View file

@ -5278,85 +5278,39 @@ C:\="DOS"</programlisting>
<qandaentry> <qandaentry>
<question id="user-floppymount"> <question id="user-floppymount">
<para>How do I let ordinary users mount floppies, CD-ROMs and <para>How do I let ordinary users mount CD-ROMs, DVDs,
other removable media?</para> USB drives, and other removable media?</para>
</question> </question>
<answer> <answer>
<para>Ordinary users can be permitted to mount devices. Here <para>As <username>root</username> set the sysctl variable
is how:</para> <varname>vfs.usermount</varname> to
<literal>1</literal>.</para>
<procedure> <screen>&prompt.root; <userinput>sysctl -w vfs.usermount=1</userinput></screen>
<step>
<para>As <username>root</username> set the sysctl variable
<varname>vfs.usermount</varname> to
<literal>1</literal>.</para>
<screen>&prompt.root; <userinput>sysctl -w vfs.usermount=1</userinput></screen> <para>To make this persist across reboots, add the line
</step> <literal><varname>vfs.usermount</varname>=1</literal> to
<filename>/etc/sysctl.conf</filename> so that
it is reset at system boot time.</para>
<step> <para>Users can only mount devices they have read
<para>As <username>root</username> assign the appropriate permissions to. To allow users to mount a device
permissions to the block device associated with the permissions must be set in
removable media.</para> <filename>/etc/devfs.conf</filename>.</para>
<para>For example, to allow users to mount the first <para>For example, to allow users to mount the first USB
floppy drive, use:</para> drive add:</para>
<screen>&prompt.root; <userinput>chmod 666 /dev/fd0</userinput></screen> <programlisting># Allow all users to mount a USB drive.
own /dev/da0 root:operator
perm /dev/da00 0666</programlisting>
<para>To allow users in the group <para>All users can now mount devices they could read
<groupname>operator</groupname> to mount the CD-ROM onto a directory that they own:</para>
drive, use:</para>
<screen>&prompt.root; <userinput>chgrp operator /dev/acd0c</userinput>
&prompt.root; <userinput>chmod 640 /dev/acd0c</userinput></screen>
</step>
<step>
<para>You will need to alter
<filename>/etc/devfs.conf</filename> to make these
changes permanent across reboots.</para>
<para>As <username>root</username>, add the necessary
lines to <filename>/etc/devfs.conf</filename>. For
example, to allow users to mount the first floppy drive
add:</para>
<programlisting># Allow all users to mount the floppy disk.
own /dev/fd0 root:operator
perm /dev/fd0 0666</programlisting>
<para>To allow users in the group
<groupname>operator</groupname> to mount the CD-ROM drive
add:</para>
<programlisting># Allow members of the group operator to mount CD-ROMs.
own /dev/acd0 root:operator
perm /dev/acd0 0660</programlisting>
</step>
<step>
<para>Finally, add the line
<literal><varname>vfs.usermount</varname>=1</literal> to
the file <filename>/etc/sysctl.conf</filename> so that
it is reset at system boot time.</para>
</step>
</procedure>
<para>All users can now mount the floppy
<devicename>/dev/fd0</devicename> onto a directory that they
own:</para>
<screen>&prompt.user; <userinput>mkdir <replaceable>~/my-mount-point</replaceable></userinput> <screen>&prompt.user; <userinput>mkdir <replaceable>~/my-mount-point</replaceable></userinput>
&prompt.user; <userinput>mount -t msdosfs /dev/fd0 <replaceable>~/my-mount-point</replaceable></userinput></screen> &prompt.user; <userinput>mount -t msdosfs /dev/da0<replaceable>~/my-mount-point</replaceable></userinput></screen>
<para>Users in group <groupname>operator</groupname> can now
mount the CD-ROM <devicename>/dev/acd0c</devicename> onto a
directory that they own:</para>
<screen>&prompt.user; <userinput>mkdir <replaceable>~/my-mount-point</replaceable></userinput>
&prompt.user; <userinput>mount -t cd9660 /dev/acd0c <replaceable>~/my-mount-point</replaceable></userinput></screen>
<para>Unmounting the device is simple:</para> <para>Unmounting the device is simple:</para>