Re: how do i use a memory stick on freebsd?



On Fri, 21 May 2010 12:03:42 -0700, Gary Kline <kline@xxxxxxxxxxx> 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, ...
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Mount usb devices
    ... Can F9 mount *BSD file systems? ... USB drives and Fedora and get a good howto. ... I found nothing at all useful regarding mounting usb devices. ...
    (Fedora)
  • Re: [PATCH] private mounts
    ... TYPE A) general purpose user-mountable file systems ... Restricting where the user could mount ... TYPE B) per-user namespace / attachable namespace / etc. ...
    (Linux-Kernel)
  • hi, problem with Canyon portable HDD with USB interface
    ... Can't mount Canyon portable HDD with USB interface ... bfa00000-cfbfffff: PCI Bus #01 ... I/O behind bridge: 0000b000-0000bfff ...
    (Linux-Kernel)
  • Re: [PATCH] private mounts
    ... > TYPE A) general purpose user-mountable file systems ... > 1) Restricting where the user could mount ... given enforcement of requiring private namespaces ... > namespace per user). ...
    (Linux-Kernel)
  • Re: [9fans] 9P vs. FUSE
    ... fit into Linux VFS layer just fine. ... It's easier, I suppose, to put boring file systems in, ... one discussion about putting private name ... to what I did on the original: codify the mount point to be at ...
    (comp.os.plan9)