HOWTO accesss USB memory key

  • Follow


Dear all,

I have just got a USB memory key or stick. I wonder how do I access this
device? Do I have to mount something? I am running RH9
Sincerely
Patrick
0
Reply patricg (14) 1/9/2004 11:41:40 AM

Patrick Guio <patricg@fys.uio.no> wrote:
> I have just got a USB memory key or stick. I wonder how do I access this
> device?

You need USB support, USB mass storage, SCSI emulation and SCSI disk
support. Then you'll see the USB stick as a SCSI disk.
Davide

-- 
| So what is the best way to protect yourself against the ILOVEYOU
| virus? Install Linux. If that's not an option, try uninstalling
| Windows.     -- Geoff Johnson 
0
Reply davideyeahsure (1281) 1/9/2004 11:46:55 AM


On Fri, 9 Jan 2004, Davide Bianchi wrote:


> Patrick Guio <patricg@fys.uio.no> wrote:
> > I have just got a USB memory key or stick. I wonder how do I access this
> > device?
>
> You need USB support, USB mass storage, SCSI emulation and SCSI disk
> support. Then you'll see the USB stick as a SCSI disk.
> Davide
>

Hi Davide,

I have no experience with this kind of stuff. Could you detail what I have
to do?
So long here what I get when running lsmod|grep usb

usb-storage            74656   0
scsi_mod              107544   5 [sg sr_mod ide-scsi usb-storage]
hci_usb                 9752   0 (unused)
bluez                  40260   1 [hci_usb]
usb-uhci               26412   0 (unused)
usbcore                79040   1 [usb-storage hci_usb hid usb-uhci ehci-hcd]

Sincerely

Patrick

0
Reply patricg (14) 1/9/2004 12:29:09 PM

Patrick Guio <patricg@fys.uio.no> wrote:
> I have no experience with this kind of stuff. Could you detail what I have
> to do?

If this is your list of stuff, you should already have everything.
dmesg | grep sd should show you which device is your USB stick.
This is what I have on my system:

# dmesg | grep sd
SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
sda: Write Protect is off
 sda: sda1
UMSDOS 0.86k (compatibility level 0.4, fast msdos)

So, my USB stick is /dev/sda.
At this point you have to do just a
mount -t auto /dev/sda /where/you/want/it/mounted

And that should be it. Of course '/where/you/want/it/mounted' must
exists!

Davide

-- 
| I have replaced NT with Linux. Linux -- heir of the byte that dogged
| me.    -- Allan Willis 
0
Reply davideyeahsure (1281) 1/9/2004 12:53:33 PM

On Fri, 9 Jan 2004, Davide Bianchi wrote:

>
> If this is your list of stuff, you should already have everything.
> dmesg | grep sd should show you which device is your USB stick.
> This is what I have on my system:
>
> # dmesg | grep sd
> SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
> sda: Write Protect is off
>  sda: sda1
> UMSDOS 0.86k (compatibility level 0.4, fast msdos)
>
> So, my USB stick is /dev/sda.
> At this point you have to do just a
> mount -t auto /dev/sda /where/you/want/it/mounted
>
> And that should be it. Of course '/where/you/want/it/mounted' must
> exists!
>
> Davide
>

Thanks Davide,

I have actually two keys, one contains some DOS/vindoz data/progs (256MB).
I can access it with type vfat:
mount -t auto /dev/sda1 /mnt/memstick
the other one is from DELL and completely new (128MB). I can mount it with
mount -t auto /dev/sdb1 /mnt/memstick
What is the difference between these two devices?
Both type appear to be vfat. Can it be of other type? Do I have to format
the new memory stick?
How can I mount the key without being root and be able to write as my
username and not root?
Sincerely
Patrick


0
Reply patricg (14) 1/9/2004 1:41:08 PM

Patrick Guio <patricg@fys.uio.no> wrote:
> What is the difference between these two devices?

....you ask me?

> Both type appear to be vfat.

Usually they are. 

> the new memory stick?

No, since isn't a real disk in there.

> How can I mount the key without being root and be able to write as my
> username and not root?

Be sure that you own the directory where you want to mount the USB stick,
and add the relevant line in your /etc/fstab, use the 'user' option and
you are ready to go.

Davide

-- 
| If JavaScript is walking alone late at night through a bad part of
| town with a pocket full of $20 bills, ActiveX is dropping your
| trousers in the middle of the yard of a maximum-security prison,
| bending over, and yelling 'Come and get it, boys!' --Adam 
| 
| 
0
Reply davideyeahsure (1281) 1/9/2004 1:45:31 PM

Patrick Guio <patricg@fys.uio.no> writes:

> I have just got a USB memory key or stick. I wonder how do I access this
> device? Do I have to mount something? I am running RH9

Short answer: try mounting /dev/sda1 as a vfat filesystem

Long answer:
The system will automatically recognize it as a SCSI hard drive, but
as with all drives (CD's, floppies, etc) it has to be mounted as a
filesystem before you can access the files on it.  If you have no
other SCSI disks on your machine, and this is the only USB drive
you've plugged in since the machine last rebooted, your drive will
almost certainly be /dev/sda.  Unfortunately, in the general case it
can be very difficult to know beforehand exactly what device it
will be recognized as.

If you look in /var/log/messages, you will see likes something like

Jan  7 12:15:29 torus kernel: hub.c: new USB device 02:05.0-2.2, assigned addres
s 4
Jan  7 12:15:29 torus kernel: scsi2 : SCSI emulation for USB Mass Storage device
s
Jan  7 12:15:29 torus kernel:   Vendor: LEXAR     Model: JUMPDRIVE         Rev:
1.01
Jan  7 12:15:29 torus kernel:   Type:   Direct-Access                      ANSI
SCSI revision: 02
Jan  7 12:15:29 torus kernel: Attached scsi removable disk sdb at scsi2, channel
 0, id 0, lun 0
Jan  7 12:15:29 torus kernel: SCSI device sdb: 251904 512-byte hdwr sectors (129
 MB)
Jan  7 12:15:29 torus kernel: sdb: Write Protect is off

The `sdb' tells you that the device is /dev/sdb, so can be mounted
with a command like

mount -t vfat /dev/sdb1 /mnt/key

assuming that the drive has a single FAT partition (the destination
directory /mnt/key has to exist or this command will fail).  Before
unplugging the drive, you should unmount it:

umount /mnt/key

or else you risk trashing the file system.

This has to be done as root, which then means that the key drive can
only be written to by root.  To get round this you must add lines to
the /etc/fstab file to allow other users to mount the drive, just as
for other removable media.  The situation can get rather complicated
if you use more than one USB drive, especially if they have different
filesystems or you want only some of them to be user mountable; do a
Google Groups search on my email address and "key drive" for more
info.

-- 
Stephen Cornell          cornell@zoo.cam.ac.uk         Tel/fax +44-1223-336644
University of Cambridge, Zoology Department, Downing Street, CAMBRIDGE CB2 3EJ
0
Reply cornell (34) 1/9/2004 4:12:36 PM

Stephen Cornell <cornell@zoo.cam.ac.uk> writes:

>Patrick Guio <patricg@fys.uio.no> writes:

>> I have just got a USB memory key or stick. I wonder how do I access this
>> device? Do I have to mount something? I am running RH9

>will be recognized as.

Do (as root) " fdisk -l " before and after hot-plugging.
There will be a difference indicating the new "partition"
that you have to use in the mount-command.

Greetings, Holger
0
Reply hp1 (160) 1/9/2004 5:16:15 PM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 9 Jan 2004 13:29:09 +0100,
 Patrick Guio <patricg@fys.uio.no> wrote:
> On Fri, 9 Jan 2004, Davide Bianchi wrote:
>
>
>> Patrick Guio <patricg@fys.uio.no> wrote:
>> > I have just got a USB memory key or stick. I wonder how do I access this
>> > device?
>>
>> You need USB support, USB mass storage, SCSI emulation and SCSI disk
>> support. Then you'll see the USB stick as a SCSI disk.
>> Davide
>>
>
> Hi Davide,
>
> I have no experience with this kind of stuff. Could you detail what I have
> to do?
> So long here what I get when running lsmod|grep usb
>


Have you tried just plugging it in the USB port? 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQE//0lAd90bcYOAWPYRApScAKC6B173XnxFipWKQYHOa9n5kSlzpwCcCr9R
1qB8RWFQ2fOqZTgCGUqon1Y=
=nsnm
-----END PGP SIGNATURE-----

-- 
Jim Richardson     http://www.eskimo.com/~warlock

Microsoft - because god hates us

0
Reply warlock (9518) 1/10/2004 12:37:20 AM

8 Replies
31 Views

(page loaded in 0.45 seconds)


Reply: