SnapafunFrank wrote:

Mikkel L. Ellertson wrote:

SnapafunFrank wrote:

The current actually working is that I can plug in a flash drive - wait a moment - and the files become accessible to and from it. That is sometimes! At other times I'm sure I'm doing damage because the device appears to be unmounted and will not have the files seen, but when I do mount it manually, root can see the files but user cannot, making me think at times that I have wiped the flash drive. Further, the Howto's I followed allowed me to have any device I plugged in recognized for what it is within /mnt - but that has never worked since the first reboot though all the files appear to be in place. The very first time I tried to test my work, this actually did work, and often whilst I was within that session.

( I used the

http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Flash-Memory-HOWTO.html#linux-2.6


to install udev - it's quite conclusive.)


If you set up rules for udev to give specific names to USB devices, in place of the names the kernel gives them, you will break the automounting that hotplug does. You can create your own rules to handle the mounting in place of the standard ones. This allows you to control how things get mounted. For example, when you plug in a PNY memory stick, you can have it get mounted on /mnt/pny instead /dev/removable. (Don't ask for the full details yet - I am still playing with this.


My link above may help ?

) You can get more specific, and do things like have 32MB sticks mount one place, and 64MB mount in another. Basicly, you can test any of the tags that udev know about, and build rules based on them.

While mounting specific memory devices in specific places may not be real usuefull, when you start talking about USB hard drives, that is another story. If you have more then one partition on the drive, then current hotplug code will not mount it. Also, if you have requirments that different partitions on the drive be mounted in specific places, you can handle them this way. Maybe one partition needs to mount on /backup, and another on /opt/pictures, or something like that.

Now, as far as users being able to access files on USB storage devices, it depends on how you mount them. If you just do something like
"mount /dev/sda1 /mnt/removable", then your users will not be able to access the files. But if you do something like
"mount /dev/sda1 /mnt/removable -o umask=0", then they will have access.


Using sda1 may not be the best choice in this example, as if you plug in a USB "PEN" drive, and it uses the default device, it will get automounted, but I think you get the idea. If you have udev set to create something like /dev/pen and /dev/pen1, then use pen1 in place of sda1, and it will work.

Mikkel


Thanks Mikkel

If you follow the above link you will be able to see what I did as I followed it precisely.

And as I have said before, during that particular session it actually worked exactly as explained in the above howto ~ that is until I got a little carried away with changing all my usb memory sticks around without waiting long enough for the system to catch up ~ end result - I corrupted my .ICEauthority file and within rescue mode had to delete that and start again with all my customizing. [ Still finding stuff that needs to be updated because of this. ]

Anyway, your comments above make a lot of sense so I'm off to check things out before posting this:

First up:

[EMAIL PROTECTED] frank]$ cat /etc/fstab
/dev/hda5 / ext2 defaults 1 1
/dev/hda1 /boot ext2 iocharset=iso8859-1,codepage=850 0 0
none /dev/pts devpts mode=0620 0 0
/dev/hda8 /home ext2 defaults 0 0
#I added to following three lines but before the reboot they were the last three entries here????
#And now to try to get user able to at least read the device contents I shall:
# - Comment out the next three entries
# - Copy the three entries below and edit them thus:
# - 1st go = same as for cdrom
#/udev/16MB1 /mnt/16MB vfat,ext2 user,noauto,rw 0 0
#/udev/64MB1 /mnt/64MB vfat,ext2 user,noauto,rw 0 0
#/udev/Camera1 /mnt/Camera vfat,ext2 user,noauto,rw 0 0
/udev/16MB1 /mnt/16MB auto umask=0,user,vfat,ext2,noauto,ro,exec 0 0
/udev/64MB1 /mnt/64MB auto umask=0,user,vfat,ext2,noauto,ro,exec 0 0
/udev/Camera1 /mnt/Camera auto umask=0,user,vfat,ext2,noauto,ro,exec 0 0
/udev/Works128MB1 /mnt/Works128MB vfat,ext2 user,noauto,rw 0 0
none /mnt/dvd-cd supermount dev=/dev/hdd,fs=auto,ro,--,iocharset=iso8859-1,codepage=850 0 0
none /mnt/dvd-rw supermount dev=/dev/hdc,fs=auto,--,umask=0,iocharset=iso8859-1,codepage=850 0 0
/dev/hda3 /mnt/empty ext2 defaults 1 2
none /mnt/floppy supermount dev=/dev/fd0,fs=auto,--,umask=0,iocharset=iso8859-1,sync,codepage=850 0 0
/dev/hdb2 /mnt/hdb2_boot ext2 defaults 1 2
/dev/hdb5 /mnt/hdb5_root ext2 defaults 1 2
/dev/hdb6 /mnt/hdb6_var ext2 defaults 1 2
/dev/hdb7 /mnt/hdb7_usr ext2 defaults 1 2
/dev/hdb9 /mnt/hdb9_home ext2 defaults 1 2
#Commented out the following line to try to get usb mass_storage to work for user - have put it back in before any more reboots.
none /mnt/removable supermount dev=/dev/sda1,fs=ext2:vfat,--,umask=0,iocharset=iso8859-1,codepage=850,noauto,nosuid,nodev,kudzu 0 0
/dev/hdb1 /mnt/win_c2 vfat umask=0,iocharset=iso8859-1,codepage=850 0 0
/dev/hda4 /mnt/win_h vfat umask=0,iocharset=iso8859-1,codepage=850 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/hda6 /usr ext2 defaults 1 2
/dev/hda9 /var ext2 defaults 1 2
/dev/hda7 swap swap swap 1 2
/dev/hdb8 swap swap defaults 0 0


OK. The USB devices are 16MB, 64MB, Works128MB whilst Camera1 is a Flash card from the camera.
Each of them has " noauto" and three of them has "ro" whilst one has "rw".
So I need a lesson here : none of them have the "-o" option Mikkel mentions ~ and what is the true meaning of "noauto" ?
For now I will only change the "ro" to "rw".


As to the naming convention mentioned by Mikkel, I believe that is done here:

[EMAIL PROTECTED] frank]$ cat /etc/udev/udev.rules
<...snip...>
<.../snip...>
# if this is a ide cdrom, name it the default name, and create a symlink to cdrom
BUS="ide", KERNEL="*[!0-9]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom", NAME="%k", SYMLINK="cdrom"


# create a symlink named after the device map name
# note devmap_name comes with extras/multipath
KERNEL="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK="%c"


# DRI devices always go into a subdirectory (as per the LSB spec)
KERNEL="card*", NAME="dri/card%n"

# Flash Memory 16MB
BUS="scsi", SYSFS_vendor="M-Sys*", NAME="16MB%n"

# Flash Memory 64MB
BUS="scsi", SYSFS_vendor="USB*", NAME="64MB%n"

# Card Reader for MyCanonCamera
BUS="scsi", SYSFS_vendor="SIIG*", NAME="Camera%n"

# Flash Memory "Works 128MB"
BUS="scsi", SYSFS_vendor="OTi*", NAME="Works128MB%n"
<...snip...>

Hmmm.... I am concerned on two things here, first my system is not mounting my flash drives as at first session ~ they all are seen as "removable2" only now.

My /mnt directory shows /dvd(see later for this one) + /dvd-cd + /dvd-rw along with /cdrom + /cdrom2 .

I have removed the two cdrom drives some time ago and guess I need to remove something here ~ but how does the system see the dvd-cd and dvd-rw ?
[ I believe the dvd entry maybe something I did in an attempt at one stage to mount a dvd that I could not see after I put it in.]


Enough for now ~ anyone care to get out their axe and start chopping at that /etc/fstab above ?

In case anyone wants to know what I'd like to have ~ basically dvd + cd + usb auto mounted and usable as user ( the dvd drives both accept cd as well ).

I'll worry about my USB 20GB hard drive later.

And yes Mikkel, you lost me with the "renaming not now auto~mounting " stuff as I understood that the howto I followed was pointing me to having things so mounted ?????
We live and learn I hope.

Er.... I tried reading man: fstab and that made no sense, searched for 'fstab howto' and 'fstab samples' and only got ".... enter into fstab the following ...." so does anyone know of any online howto ~ explanations of the /etc/fstab file ?


For now, the following appear to be totally different and is tying me up in knots. What do you understand about the following two entries taken from /etc/fstab :

/udev/16MB1 /mnt/16MB auto umask=0,user,vfat,ext2,noauto,rw,exec 0 0

none /mnt/removable supermount dev=/dev/sda1,fs=ext2:vfat,--,umask=0,iocharset=iso8859-1,codepage=850,noauto,nosuid,nodev,kudzu 0 0

To me the file types are different syntax ~ which way is correct ? or better ? [ vfat,ext2, or fs=auto ( or as above fs=ext2:vfat ) ]
I thought that " none " meant that that dev was a swap partition ~ obviously not ~ need this explained.
Should I be using 'supermount' ?
If "umask=0" sets things to 777 then why is "user" also included ?
And the real confusing one ~ In the same line of syntax I see 'auto' ~ 'noauto' ~ 'exec' ? Should this not be 'auto' ~ 'noexec' and 'noauto' removed to allow PnP with Linux ?


OK ~ so you need a couple of "fixes" before you handle this one. Catch anyone who dares tomorrow night.

--
Newbie Seeking USER_FUNCTIONALITY always!

Regards

SnapafunFrank

Big or small, a challenge requires the same commitment to resolve.
Registered Linux User # 324213



____________________________________________________
Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com
____________________________________________________

Reply via email to