if {\bf /dev/sg0} is incorrect. For example, on FreeBSD systems, the
autochanger SCSI control device is generally {\bf /dev/pass2}.
-\item [/etc/bacula/mtx-changer \ /dev/sg0 \ slots \ 0 \ /dev/nst0 \ 0]
+\item [/etc/bacula/mtx-changer \ /dev/sg0 \ slots ]
\index[sd]{mtx-changer slots}
This command should return the number of slots in your autochanger.
-\item [/etc/bacula/mtx-changer \ /dev/sg0 \ unload \ ]
+\item [/etc/bacula/mtx-changer \ /dev/sg0 \ unload \ 1 \ /dev/nst0 \ 0 ]
\index[sd]{mtx-changer unload}
- If a tape is loaded, this should cause it to be unloaded.
+ If a tape is loaded from slot 1, this should cause it to be unloaded.
\item [/etc/bacula/mtx-changer \ /dev/sg0 \ load \ 3 \ /dev/nst0 \ 0 ]
\index[sd]{mtx-changer load}
-Assuming you have a tape in slot 3, it will be loaded into the read slot (0).
+Assuming you have a tape in slot 3, it will be loaded into drive (0).
\item [/etc/bacula/mtx-changer \ /dev/sg0 \ loaded \ 0 \ /dev/nst0 \ 0]
\index[sd]{mtx-changer loaded}
It should print "3"
+Note, we have used an "illegal" slot number 0. In this case, it is simply
+ignored because the slot number is not used. However, it must be specified
+because the drive parameter at the end of the command is needed to select
+the correct drive.
+
+\item [/etc/bacula/mtx-changer \ /dev/sg0 \ unload \ 3 /dev/nst0 \ 0]
+
+will unload the tape into slot 3.
-\item [/etc/bacula/mtx-changer \ /dev/sg0 \ unload]
\end{description}
Once all the above commands work correctly, assuming that you have the right
\footnotesize
\begin{verbatim}
#!/bin/sh
-/etc/bacula/mtx-changer /dev/sg0 unload
-/etc/bacula/mtx-changer /dev/sg0 load 3
+/etc/bacula/mtx-changer /dev/sg0 unload 1 /dev/nst0 0
+/etc/bacula/mtx-changer /dev/sg0 load 3 /dev/nst0 0
mt -f /dev/st0 rewind
mt -f /dev/st0 weof
\end{verbatim}
\footnotesize
\begin{verbatim}
#!/bin/sh
-/etc/bacula/mtx-changer /dev/sg0 unload
+/etc/bacula/mtx-changer /dev/sg0 unload 1 /dev/nst0 0
mt -f /dev/st0 offline
-/etc/bacula/mtx-changer /dev/sg0 load 3
+/etc/bacula/mtx-changer /dev/sg0 load 3 /dev/nst0 0
mt -f /dev/st0 rewind
mt -f /dev/st0 weof
\end{verbatim}