[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: USB pen drive

Ross Macintyre raz macs hw ac uk

Steven W. Orr said:
> On Thursday, Nov 27th 2003 at 23:23 -0000, quoth Andy Wallace:
> =>On Thu, 2003-11-27 at 16:13, Ross Macintyre wrote:
> =>> Hi,
> =>>   I hope someone can help.
> =>> I run a lab of RedHat Linux machines and want to be able to let the
> =>> students mount their USB pen drives.
> =>> I got a 512 MB drive, and this worked fine:
> =>>   an entry was made in /etc/fstab, and I mounted it (as the user that
> was
> =>> logged in), using 'mount /mnt/diskonkey'.
> =>>   mount shows this:
> =>>      /dev/sdb1 on /mnt/diskonkey type vfat (rw,nosuid,nodev)
> =>> I gor another USB pen drive (128MB), but when I insert this, no entry
> is
> =>> made in /etc/fstab. I am, however, able to mount it as root, by giving
> the
> =>> command 'mount -t vfat /dev/sda1(or /dev/sdb1 I can't remember) /mnta'
> =>>
> =>
> =>My experiences may be of use to you - I'm responsible for tech support
> =>for a large number of testers who all have USB pen drives, and who all
> =>may at some time put them into any one of four dozen PCs running the
> =>application they're testing...
> =>
> =>My experience has been that the first pen drive inserted (after boot) is
> =>assigned /dev/sda, the 2nd, /dev/sdb etc etc, and although
> =>/proc/bus/usb/devices keeps tabs on what's attached, /proc/scsi/*
> =>remembers all previous. However, it has a property "Attached" or
> =>"Unattached" which I use in a script to parse through
> =>/proc/scsi/usb-storage-n/n (n=0-255), stopping at the first "Attached",
> =>then translating that into (0=a, 1=b) etc. to detect which device to
> =>mount.
> =>
> =>This is using SuSE 8.2, which makes an auto entry in fstab of
> =>/mnt/<randomlookingstring>, but my script mounts it elsewhere - you
> =>don't have to use fstab.
> =>
> =>If you want the code snippet that does this, let me know - I don't have
> =>it in front of me now or I'd attach it.
> I'd just like to add one more thing: Read this month's Linux Journal.
> There's a whole article there on how it works and it goes into a fair
> amount of detail. Just one thing before you actually get to the article
> though. When you actually mount don't forget to use -o noatime, otherwise
> everytime you say ls it will write on the filesystem. And the drive does
> have a limited number of writes available.

thanks to both of you for replying.
Andy I would like to look at your scripts cos it will give me an insight
into what is happening.
Steven, I never know about the Linux Jounal, but thanks, I am going to
subscribe now.

I really would like to know why one PEN drive has an entry put into
/etc/fstab and yet the other one doesn't, cos both are recognised by the
system. I was wondering if it might have something to do with the entries
in /etc/hotplug? I particularly want /etc/fstab updated; that way I can
instruct students to just run one command when they are logged in on a
machine. Also the entry in /etc/fstab(I am running Redhat 8.0) should have
the permissions set correctly so that only *that* user can mount and
umount the device.

Looking at /var/log/messages the only thing I can see is that the one that
worked had this entry:
  Nov 28 kernel:   Vendor: M-Sys     Model: DiskOnKey         Re v: 3.04
and the one that didn't work, had this:
  Nov 28 kernel:   Vendor:           Model: USB DISK 2.0      Re v: 1.16

Now the entry in /etc/fstab is /mnt/diskonkey, so I was wondering if it
was something stupid like it failed to create the dir /mnt/USB DISK 2.0
because of the spaces. I wouldn't be surprised.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]