# USB stick - different devices?

## blaster999

Hello,

I can mount USB sticks - just start hotplug and mount. The problem is that sometimes the stick is represented by /dev/sda and sometimes - as /dev/sda1 - seems to depend on the stick. Can anyone confirm this or suggest some solution (e.g. what to put in fstab?). I would be grateful for any comment.

----------

## NeddySeagoon

blaster999,

The stick is /dev/sda the filesystem it contains in the partition /dev/sda1.

It can contain more than one filesystem, since it has a partition table just like any other disk device.

----------

## Naib

 *blaster999 wrote:*   

> Hello,
> 
> I can mount USB sticks - just start hotplug and mount. The problem is that sometimes the stick is represented by /dev/sda and sometimes - as /dev/sda1 - seems to depend on the stick. Can anyone confirm this or suggest some solution (e.g. what to put in fstab?). I would be grateful for any comment.

 

The best bet is to move over to udev from devFS. The flaw with devFS was it could not tie devices easily to a certain /dev entry.

With udev you can write a rule that induvidually identifies a particular device (by its own manufacturer ID number). From this you can then make udev make its own symlnk named that you want.

eg

```

BUS="scsi", KERNEL="sd*", SYSFS(serial)="B8177840FE1CB499", NAME="%k", SYMLINK="usbkey"

```

I have a USB stick and I via a udev prog got its serial number. Entered teh above into a rules file. Now everytime it is mounted it might be sda1 or sda2... BUT this device will always create a symlink called "usbkey"

my fstab now is:

```

/dev/usbkey             /mnt/usbstick   vfat            noauto,user             0 0

```

----------

## blaster999

First of all, thanks for your answers.

 *NeddySeagoon wrote:*   

> The stick is /dev/sda the filesystem it contains in the partition /dev/sda1. 
> 
> It can contain more than one filesystem, since it has a partition table just like any other disk device.

 

Well, when I insert some sticks, there is no sda1! Only sda (however, there IS a filesystem, which can be easily mounted and accessed by mounting sda). I've seen this using two usb sticks.

 *Naib wrote:*   

> 
> 
> The best bet is to move over to udev from devFS. The flaw with devFS was it could not tie devices easily to a certain /dev entry. 
> 
> With udev you can write a rule that induvidually identifies a particular device (by its own manufacturer ID number).
> ...

 

I often use someone else's usb sticks (and I don't have mine), so the id is unpredictable.

----------

## tuam

 *blaster999 wrote:*   

> 
> 
> Well, when I insert some sticks, there is no sda1! Only sda (however, there IS a filesystem, which can be easily mounted and accessed by mounting sda). I've seen this using two usb sticks.
> 
> 

 

Yes, some models are like HDs with partitions, others are just "huge floppies".

FF,

 Daniel

----------

## blaster999

 *tuam wrote:*   

>  Yes, some models are like HDs with partitions, others are just "huge floppies". 

 

Can something be done then to unify these two? Or I have to have several fstab entries?

One more question: are usb sticks supported by supermount?

And again, thanks for your replies.

----------

