how do i use a memory stick on freebsd?

Polytropon freebsd at edvax.de
Fri May 28 15:31:56 UTC 2010


On Fri, 21 May 2010 12:03:42 -0700, Gary Kline <kline at thought.org> wrote:
> 
> guys, 
> 
> my wife emptied a bunch of files onto her memory stick;  the pc
> is not here.  i have never used one of these devices before and
> want to know how, if it is possible, to read her dos/lose
> material from my bsd system. 

It IS possible, and quite easy.



> 7.3, dell, plenty of disk, and yes,
> i know where the usb slot it!

It's right beneath the "4X" cup holder, I know. :-)



> do i need to put something in /usr/rc.conf?

You mean /etc/rc.conf? Usually not. The /etc/fstab file is where
you can add a default mountpoint and mount options for the USB
stick.

Usually, the device used to access USB sticks is /dev/da (Direct
Access), and I think it will be /dev/da0. Check the output of
dmesg or the last lines in the system log which will reveal the
correct device.

FAT file systems correspond to a slice on the device, /dev/da0s1
for example. You can mount this device.

If it is your first time, play with it, e. g.

	# mount_msdosfs -o ro /dev/da0s1 /mnt
	# ls /mnt

Is the intended content there? Good.

	# umount /mnt

Now add a rule to your file system table, making mount attempts
more easy.

	/dev/da0s1  /media/stick  msdosfs rw,noauto,noatime  0  0

This could be a valid entry, depending on the existance of the
directory.

Keep in mind: In order to mount USB sticks as a user you need
sufficient permissions to the involved files, as well as to
own the mount directory, and finally have

	vfs.usermount=1

in /etc/sysctl.conf. In case you mount as root (or prefix the
mount command with sudo, ur use the system's su), you don't need
to pay this attention.

You should also read

	man mount_msdosfs

and see if you want to use -m and -M: The old-fashioned FAT
file systems don't know file permissions, so files on the USB
stick will have the +x attribute, pretending they were executables
(which they usually aren't); -m and -M apply masks to "cut away"
this mis-information. It can also be possible that you need the
"large" option -o large.

Feel free to also read this:

	http://www.freebsd.org/doc/en/books/handbook/mount-unmount.html

	http://www.freebsd.org/doc/en/books/handbook/usb-disks.html

In any case, keep an eye on umounting the USB stick before
removing it. PCs are bad at hot plug operations. :-)



> build a driver or
> utility? 

This is FreeBSD, not "Windows". :-)



> or what?

Or nothing. :-)

If you want "nothing", KDE and Gnome (and Xfce, too) allow the
use of automounting USB devices (if sufficient permissions
allow this), through the means of HAL, DBUS and PolicyKit.
But that's too complicated to be explained in a man's life. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list