Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USB stick - different devices?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
blaster999
l33t
l33t


Joined: 09 May 2004
Posts: 902
Location: Between keyboard and chair

PostPosted: Tue Oct 19, 2004 6:11 pm    Post subject: USB stick - different devices? Reply with quote

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.
_________________
60s: sex, drugs, rock'n'roll
90s: sux, bugs, drag'n'drop
---
Some multimedia keys refuse to work? See my mini-howto:
https://forums.gentoo.org/viewtopic.php?p=1896734#1896734
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55461
Location: 56N 3W

PostPosted: Tue Oct 19, 2004 6:24 pm    Post subject: Reply with quote

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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6090
Location: Removed by Neddy

PostPosted: Tue Oct 19, 2004 6:33 pm    Post subject: Re: USB stick - different devices? Reply with quote

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

Code:

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:

Code:

/dev/usbkey             /mnt/usbstick   vfat            noauto,user             0 0
Back to top
View user's profile Send private message
blaster999
l33t
l33t


Joined: 09 May 2004
Posts: 902
Location: Between keyboard and chair

PostPosted: Tue Oct 19, 2004 6:43 pm    Post subject: Reply with quote

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.
_________________
60s: sex, drugs, rock'n'roll
90s: sux, bugs, drag'n'drop
---
Some multimedia keys refuse to work? See my mini-howto:
https://forums.gentoo.org/viewtopic.php?p=1896734#1896734
Back to top
View user's profile Send private message
tuam
l33t
l33t


Joined: 04 May 2004
Posts: 765
Location: CGN, Germany

PostPosted: Tue Oct 19, 2004 9:56 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
blaster999
l33t
l33t


Joined: 09 May 2004
Posts: 902
Location: Between keyboard and chair

PostPosted: Wed Oct 20, 2004 8:19 am    Post subject: Reply with quote

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.
_________________
60s: sex, drugs, rock'n'roll
90s: sux, bugs, drag'n'drop
---
Some multimedia keys refuse to work? See my mini-howto:
https://forums.gentoo.org/viewtopic.php?p=1896734#1896734
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum