# How to access usb device?

## cgmd

I am totally new to gentoo and trying to learn my way around. I don't know about using usb devices. When I plug such a device in, how do I access it to make it work? Must it be mounted? Where is it normally located? Where can I read about these basics??

Sorry for the lame question...

Thanks

----------

## TheRAt

What types of USB devices ?? Storage, scanners, printers ??

----------

## Zepp

Yes it depends on the device. For usb mass storage device you gotta be sure you have included support for it in your kernel. If it is included then once you plug in the device a new dev entry should appear sda# sda1 if its the first device. anyway can just mount that doing say

```
mount /dev/sda1 /mnt/usb
```

or for convenience add an fstab entry for it  :Razz: 

----------

## cgmd

The devices, in particular, that I want to utilize through usb are: trackball, digital camera, hp scanner, and ipod. 

So I plug in one of the devices... I see nothing happen. What next must I do? 

That's where I am lost  :Sad:   .

Thanks...

----------

## TheRAt

Try these: Digital Camera, Scanner, iPod.

The trackball setup should be very similar to setting up a mouse...

[*EDIT*] Links corrected  :Embarassed: 

----------

## opentaka

you wanna look at 

dmesg or /var/log/messages etc

whenever you connect e usb device..

----------

## cgmd

TheRAt wrote  *Quote:*   

> Try these: Digital Camera, Scanner, iPod. 

 

These are links to http://gentoo-wiki.com/TIP_Dealing_with_masked_packages

My question is what masked packages have to do with usb devices? Am I misunderstanding something?

Thanks...

----------

## TheRAt

 *cgmd wrote:*   

> My question is what masked packages have to do with usb devices? Am I misunderstanding something?

 

Copy / Paste malfunction  :Embarassed: 

Try the links now...

----------

## mhelvens

I have an USB harddisk I want to connect. USB mass storage is enabled in my kernel and so is SCSI. But there is no sda1, just sda. And when I try to mount that, it sais 'No medium found'.

Can anyone help me?

Thanks!

----------

## Frodg

take out the usb drive.. count to ten - insert it and post the dmesg information..

----------

## mhelvens

Here it is. Thanks for the quick response!

```
.....

usb 1-2: new high speed USB device using ehci_hcd and address 5

scsi2 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 5

usb-storage: waiting for device to settle before scanning

  Vendor: USB 2.0   Model: Storage Device    Rev: 0100

  Type:   Direct-Access                      ANSI SCSI revision: 00

SCSI device sdb: 390721968 512-byte hdwr sectors (200050 MB)

sdb: assuming drive cache: write through

SCSI device sdb: 390721968 512-byte hdwr sectors (200050 MB)

sdb: assuming drive cache: write through

 /dev/scsi/host2/bus0/target0/lun0: p1

Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0

Attached scsi generic sg1 at scsi2, channel 0, id 0, lun 0,  type 0

usb-storage: device scan complete
```

So, should I mount '/dev/scsi/host1/bus0/target0/lun0', maybe?

----------

## Frodg

 *Quote:*   

> Attached scsi generic sg1 at scsi1, channel 0, id 0, lun 0,  type 0 

 

is there first

then later after you replace it:

 *Quote:*   

> Attached scsi generic sg1 at scsi2, channel 0, id 0, lun 0,  type 0 

 

SO I would look for /dev/sg1 being created and removed every time you connect and reconnect.... test this.

I would then try to mount your drive on /dev/sg1 and see what happens.....

(I could be wrong though)  :Smile: 

----------

## mhelvens

That is (apparently) not a block device. Instead I think it is sdb. But when I try to mount that it sais 'you must specify the filesystem type'. I'm not really sure, to be honest. It's either NTFS or Fat32. But there is no Fat32 option and with ntfs it sais 'unknow filesystem type 'ntfs''.

----------

## mhelvens

I managed to mount it as usbfs, but the content certainly isn't my harddisk. So I don't know where to go next...

----------

## TheRAt

 *Michiel_H wrote:*   

> That is (apparently) not a block device. Instead I think it is sdb. But when I try to mount that it sais 'you must specify the filesystem type'. I'm not really sure, to be honest. It's either NTFS or Fat32. But there is no Fat32 option and with ntfs it sais 'unknow filesystem type 'ntfs''.

 

Have you compiled support for ntfs / fat32 in your kernel ??

----------

## mhelvens

Good point. I'm compiling the kernel now. I couldn't specifically find FAT32, but FAT was on. I now added NTFS support.

Does NTFS write support work flawlessly now, by the way?

----------

## omnicloud

It's the same as it used to be a several months ago. You can write to a file if you don't changte the file size (etc)

----------

## mhelvens

I don't know how it used to be several months ago, but I gather the support still isn't very good.  :Smile: 

----------

## omnicloud

Its basically there if you REALLY need it.

----------

## mhelvens

But, "if you don't change the filesize (etc)" just doesn't sound very good. I can't create new files in there?

Anyway, after enabling ntfs support I still can't get the USB drive to work. Any more ideas?

----------

## omnicloud

Like I said, if you REALLY need it. I don't think they have figured out how to modify the MTF without destroying it yet.

----------

## omnicloud

Make sure you add support in your kernel for SCSI disks and under USB with USB Mass Storage

----------

## RuiP

Hi, are you try to connect a pen drive?

I just had the following to my /etc/fstab:

```

/dev/sda1   /mnt/pen   vfat   rw,noauto,user   0 0

```

and make a /mnt/pen dir.

(or you can replace /pen for what you what...)

I also do:

```

sudo rc-update add coldplug default

```

Oh, and you need to have fat support on your kernel. With 'auto' is mounted as fat... boring with linux names, but full compatible when you plug into window$ boxes.

----------

## TheRAt

 *omnicloud wrote:*   

> Like I said, if you REALLY need it. I don't think they have figured out how to modify the MTF without destroying it yet.

 

Take a look at Captive

```
# eix -v captive

* sys-fs/captive 

     Available versions:  ~1.1.5-r2 

     Installed:           no

     Homepage:            http://www.jankratochvil.net/project/captive/

     Description:         Captive uses binary Windows drivers for full NTFS r/w access.

     License:             GPL-2

Found 1 matches
```

----------

## omnicloud

I see, well, he was asking about the kernel support, i didn't know about that. Can I use that to check an ntfs disk on linux for errors? Mine is mounting read only because it's not clean and I have no windows machine to repair it.

----------

## TheRAt

 *omnicloud wrote:*   

> I see, well, he was asking about the kernel support, i didn't know about that. Can I use that to check an ntfs disk on linux for errors? Mine is mounting read only because it's not clean and I have no windows machine to repair it.

 

Not sure if this allows one to check the windows partition / disk for errors.. You might like to examine the website for captive, and look through the mailing list linked from there...

----------

## omnicloud

It's doesn't seem very stable and one of it's dependencies is no longer developed...

----------

## mhelvens

I still have the same problem. I don't know what it is I have to mount.

I have kernel support for SCSI disks, USB Mass Storage, FAT and NTFS. Still the same dmesg info as before.

What can I try next?

----------

## cgmd

TheRAt... Thanks for posting the links above. Unfortunately, I'm running a 2.4 kernel and the documents pertain to a 2.6 kernel  :Crying or Very sad: 

Do you have any links fir 2.4 kernel usb support?

Thanks, again...

----------

