On Wed, Jun 06, 2007 at 10:57:57AM -0600, Oscar Chavarria wrote:
>  I want to copy files to it. I introduced the key and was recognized as da0.
>  I did ls dev/da0 ==> dev/da0
>  Then
>  mount /dev/da0 /home ==> incorrect super block.

You're trying to mount the drive as a UFS filesystem; this is the
default for mount.

Are there no other devices starting with da0? Because usually USB
keydrives are partitioned and then the first partition is formatted as
FAT32. So you probably want /dev/da0s1, or sometimes /dev/da0s4 if it exists.

It is also not a good idea to mount on /home, because it will mask your
home directory.

If you want to mount a disk as a normal user instead of root, there are
some things that need to be set up correctly, see below.

It's better to use something like:

mount_msdosfs -m 644 -M 755 -o noatime,noexec,nosuid,sync /dev/da0s1 /mnt/mydir

I've written a small shell script to do this for me;

# Mount a thumbdrive with a MSDOS filesystem

# It is assumed that $DIR exists, and is owned by $USER.

# Check if $DIR is already used.
if mount|grep $DIR >/dev/null; then
    echo "$DIR is already mounted!"
    exit 1;

# Check if $DEV is available.
if ! ls $DEV >/dev/null 2>&1; then
    echo "$DEV does not exist!"
    exit 1;    

# Everything OK, try to mount.
mount_msdosfs -m 644 -M 755 -o noatime,noexec,nosuid,sync $DEV $DIR

- /mnt/$USER should be an existing directory, and that you should be
  it's owner. 
- the script will fail if there is already an USB disk attached. 
  (it should use da1s1 in that case)
- the sysctl vfs.usermount should be set to 1 to allow normal users to
  mount filesystems
- the permissions on the /dev/da0 device whould be set such as to allow
  you access. See http://www.xs4all.nl/~rsmith/freebsd/index.html#devfs

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)

Attachment: pgpNOKFvItepo.pgp
Description: PGP signature

Reply via email to