Stick memory USB

2008-05-25 Thread nej ALL
Hi,

I'm new on FreeBSD not on unix.

I want to mount automatically an usb-stick memory into my machine ?
I get some problems.

Need help.

- /etc/devfs.rules
add path 'da*' mode 0660 group operator

Actions:
1) ls -al   /dev/da*
ls: No match.

2) I Plug into the USB port, the ImageMate 12-in-1 Card Reader/Writer
(SanDisk)

3) ls -al   /dev/da*
crw-rw  1 root  operator0, 136 25 mai 14:11 /dev/da0
crw-rw  1 root  operator0, 138 25 mai 14:11 /dev/da1
crw-rw  1 root  operator0, 140 25 mai 14:11 /dev/da2
crw-rw  1 root  operator0, 141 25 mai 14:11 /dev/da3

4) I put the memory stick into the Card reader's slot

5) ls -al/dev/da*
crw-rw  1 root  operator0, 136 25 mai 14:11 /dev/da0
crw-rw  1 root  operator0, 138 25 mai 14:11 /dev/da1
crw-rw  1 root  operator0, 140 25 mai 14:11 /dev/da2
crw-rw  1 root  operator0, 141 25 mai 14:11 /dev/da3

the /dev/da2s1 isn't here.

6) mount_msdosfs   /dev/da2s1/mnt/cleusb/
mount_msdosfs: /dev/da2s1: No such file or directory

7) fdisk/dev/da2
*** Working on device /dev/da2 ***
parameters extracted from in-core disklabel are:
cylinders=30 heads=64 sectors/track=32 (2048 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=30 heads=64 sectors/track=32 (2048 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 4 (0x04),(Primary DOS with 16 bit FAT ( 32MB))
start 64, size 62656 (30 Meg), flag 0
beg: cyl 1/ head 0/ sector 1;
end: cyl 979/ head 1/ sector 32
The data for partition 2 is:
UNUSED
The data for partition 3 is:
UNUSED
The data for partition 4 is:
UNUSED

8) ls -al   /dev/da*
crw-rw  1 root  operator0, 136 25 mai 14:11 /dev/da0
crw-rw  1 root  operator0, 138 25 mai 14:11 /dev/da1
crw-rw  1 root  operator0, 140 25 mai 14:11 /dev/da2
crw-rw  1 root  operator0, 141 25 mai 14:11 /dev/da3

9) mount_msdosfs   /dev/da2/mnt/cleusb
mount_msdosfs: /dev/da2: Invalid argument

The command mount_msdosfs terminated abnormally but created in the /dev
directory  the /dev/da2s1 file.

10) ls -al  /dev/da*
crw-rw  1 root  operator0, 136 25 mai 14:11 /dev/da0
crw-rw  1 root  operator0, 136 25 mai 14:11 /dev/da0
crw-rw  1 root  operator0, 138 25 mai 14:11 /dev/da1
crw-rw  1 root  operator0, 140 25 mai 14:11 /dev/da2
crw-rw  1 root  operator0, 142 25 mai 14:11 /dev/da2s1
crw-rw  1 root  operator0, 141 25 mai 14:11 /dev/da3

11) And now i can mount and umount the stick memory.

Please, can someone explain to me why, when i plug the stick memory into the
slot of the card reader,  the system doesn't create the /dev/da2s1 file in
the the /dev directory.

And why i use the mount_msdosfs command, this command creates /dev/da2s1
file in the /dev directory.

Thank you for your answers !

Sorry for my english.

Best regards

Nej

Email : [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Stick memory USB

2008-05-25 Thread Chuck Robey
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

nej ALL wrote:
 Hi,
 
 I'm new on FreeBSD not on unix.
 
 I want to mount automatically an usb-stick memory into my machine ?
 I get some problems.
 
 Need help.

You're trying with your devfs stuff to create the file, but you have to realize
it's a device representing a filesystem, not just a file.  What you want to read
is the mount and fstab man pages, mount to find out how to mount your memory
stick, and fstab to figure out how to get it to happen automatically.  The devfs
stuff is all mistaken, I think, you want that when you want to change
permissions or make softlinks of devices, not to create them in the first place,
 least that's how I';'ve always used it, and I know very well that the correct
line in /etc/fstab WILL automount your memory stick.

I could give you the exact line, but I think you would rather look that up
yourself (I know I would).

 
 - /etc/devfs.rules
 add path 'da*' mode 0660 group operator
 
 Actions:
 1) ls -al   /dev/da*
 ls: No match.
 
 2) I Plug into the USB port, the ImageMate 12-in-1 Card Reader/Writer
 (SanDisk)
 
 3) ls -al   /dev/da*
 crw-rw  1 root  operator0, 136 25 mai 14:11 /dev/da0
 crw-rw  1 root  operator0, 138 25 mai 14:11 /dev/da1
 crw-rw  1 root  operator0, 140 25 mai 14:11 /dev/da2
 crw-rw  1 root  operator0, 141 25 mai 14:11 /dev/da3
 
 4) I put the memory stick into the Card reader's slot
 
 5) ls -al/dev/da*
 crw-rw  1 root  operator0, 136 25 mai 14:11 /dev/da0
 crw-rw  1 root  operator0, 138 25 mai 14:11 /dev/da1
 crw-rw  1 root  operator0, 140 25 mai 14:11 /dev/da2
 crw-rw  1 root  operator0, 141 25 mai 14:11 /dev/da3
 
 the /dev/da2s1 isn't here.
 
 6) mount_msdosfs   /dev/da2s1/mnt/cleusb/
 mount_msdosfs: /dev/da2s1: No such file or directory
 
 7) fdisk/dev/da2
 *** Working on device /dev/da2 ***
 parameters extracted from in-core disklabel are:
 cylinders=30 heads=64 sectors/track=32 (2048 blks/cyl)
 
 parameters to be used for BIOS calculations are:
 cylinders=30 heads=64 sectors/track=32 (2048 blks/cyl)
 
 Media sector size is 512
 Warning: BIOS sector numbering starts with sector 1
 Information from DOS bootblock is:
 The data for partition 1 is:
 sysid 4 (0x04),(Primary DOS with 16 bit FAT ( 32MB))
 start 64, size 62656 (30 Meg), flag 0
 beg: cyl 1/ head 0/ sector 1;
 end: cyl 979/ head 1/ sector 32
 The data for partition 2 is:
 UNUSED
 The data for partition 3 is:
 UNUSED
 The data for partition 4 is:
 UNUSED
 
 8) ls -al   /dev/da*
 crw-rw  1 root  operator0, 136 25 mai 14:11 /dev/da0
 crw-rw  1 root  operator0, 138 25 mai 14:11 /dev/da1
 crw-rw  1 root  operator0, 140 25 mai 14:11 /dev/da2
 crw-rw  1 root  operator0, 141 25 mai 14:11 /dev/da3
 
 9) mount_msdosfs   /dev/da2/mnt/cleusb
 mount_msdosfs: /dev/da2: Invalid argument
 
 The command mount_msdosfs terminated abnormally but created in the /dev
 directory  the /dev/da2s1 file.
 
 10) ls -al  /dev/da*
 crw-rw  1 root  operator0, 136 25 mai 14:11 /dev/da0
 crw-rw  1 root  operator0, 136 25 mai 14:11 /dev/da0
 crw-rw  1 root  operator0, 138 25 mai 14:11 /dev/da1
 crw-rw  1 root  operator0, 140 25 mai 14:11 /dev/da2
 crw-rw  1 root  operator0, 142 25 mai 14:11 /dev/da2s1
 crw-rw  1 root  operator0, 141 25 mai 14:11 /dev/da3
 
 11) And now i can mount and umount the stick memory.
 
 Please, can someone explain to me why, when i plug the stick memory into the
 slot of the card reader,  the system doesn't create the /dev/da2s1 file in
 the the /dev directory.
 
 And why i use the mount_msdosfs command, this command creates /dev/da2s1
 file in the /dev directory.
 
 Thank you for your answers !
 
 Sorry for my english.
 
 Best regards
 
 Nej
 
 Email : [EMAIL PROTECTED]
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIOa34z62J6PPcoOkRAgH6AKCUgvP/EqN9INW2oQ+F+JCob71WYwCfaoJB
E1viOjy7youaf0uoJ/EDK9I=
=VDLR
-END PGP SIGNATURE-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Stick memory USB

2008-05-25 Thread Mark Ovens

Chuck Robey wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

nej ALL wrote:

Hi,

I'm new on FreeBSD not on unix.

I want to mount automatically an usb-stick memory into my machine ?
I get some problems.

Need help.


You're trying with your devfs stuff to create the file, but you have to realize
it's a device representing a filesystem, not just a file.  What you want to read
is the mount and fstab man pages, mount to find out how to mount your memory
stick, and fstab to figure out how to get it to happen automatically.  The devfs
stuff is all mistaken, I think, you want that when you want to change
permissions or make softlinks of devices, not to create them in the first place,
 least that's how I';'ve always used it, and I know very well that the correct
line in /etc/fstab WILL automount your memory stick.



Are you sure Chuck? The devfs rules stuff is to allow non-root users to
mount removable media isn't it? I followed the instructions at
http://gphoto.sourceforge.net/doc/manual/permissions-usb.html - the
FreeBSD-specific stuff is near the bottom of the page - but I have
*exactly* the same problem as the OP with my mobile phone.

It is detected as da2 and da3 (phone and memory stick - mine's a SCSI
system so da0 and da1 are the HDDs) but only the top-level device nodes
(/dev/da[23]) are created.

I can try to mount /dev/da3 until I'm blue in the face and it always
fails but as soon as I attempt to mount /dev/da3s1 it fails first time
but succeeds the second time because the /dev/da3s1 device node gets
created on the first (failed) mount attempt.

It doesn't matter whether I have an entry in /etc/fstab for /dev/da3s1
or not, it stills fails, but creates the device, on the first attempt.

Maybe something has changed? The page I linked to above refers to
FreeBSD 5 but I'm running 6.3-STABLE.

Regards,

Mark




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Stick memory USB

2008-05-25 Thread Sergey Zaharchenko
Hello Mark!

Mon, May 26, 2008 at 05:40:50AM +0100 you wrote:

  It is detected as da2 and da3 (phone and memory stick - mine's a SCSI
  system so da0 and da1 are the HDDs) but only the top-level device nodes
  (/dev/da[23]) are created.
 
  I can try to mount /dev/da3 until I'm blue in the face and it always
  fails but as soon as I attempt to mount /dev/da3s1 it fails first time
  but succeeds the second time because the /dev/da3s1 device node gets
  created on the first (failed) mount attempt.

I had a similar problem with my card reader. AFAIU the problem with
those is that they don't report media change events; the system gets to
know what's there only when it tries to access it, one way or the other.
This might be of help both to you and to the OP:

http://lists.freebsd.org/pipermail/freebsd-questions/2007-January/138907.html

It's not beautiful, but it works.

-- 
DoubleF
No virus detected in this message. Ehrm, wait a minute...
/kernel: pid 56921 (antivirus), uid 32000: exited on signal 9
Oh yes, no virus:)


pgpkIaQcGOOrU.pgp
Description: PGP signature