Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Slackware

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-28-2008, 12:54 PM
=SERGE=
 
Posts: n/a
How to get a usbdisk to recieve alwayas the same device name (sdc for example)?

hi,

well i'm sure it's simple to fix i just run for 1st time into the problem.
When i plug in a usb disk it always assigned a different device name sdd or
sde etc.
I'd it to be assigned always the same name, say, I want my 250disk be sdc.

sd* devices for usbdisks are created be the system when needed.
I thought I could just make them with MAKEDEV and then write in fstab.
But I didn't find MAKEDEV script.

How should i act?

thank you


Reply With Quote
  #2 (permalink)  
Old 06-28-2008, 01:14 PM
Helmut Hullen
 
Posts: n/a
Re: How to get a usbdisk to recieve alwayas the same device name (sdc for example)?

Hallo, =SERGE=,

Du meintest am 28.06.08:

> sd* devices for usbdisks are created be the system when needed.
> I thought I could just make them with MAKEDEV and then write in
> fstab. But I didn't find MAKEDEV script.


You find "MAKEDEV" in the "devs" package. But "udev" deletes it. On my
machine I've moved MAKEDEV to "/usr/sbin".

You should look what "udev" makes when you insert an USB stick or an USB
disk. And you should look for other names than (p.e.) /dev/sdc1.
"udev" shows "/dev/disk/by-id/" or "/dev/disk/by-label/" too.

Viele Gruesse
Helmut

"Ubuntu" - an African word, meaning "Slackware is too hard for me".

Reply With Quote
  #3 (permalink)  
Old 06-28-2008, 02:15 PM
Joost Kremers
 
Posts: n/a
Re: How to get a usbdisk to recieve alwayas the same device name (sdc for example)?

=SERGE= wrote:
> well i'm sure it's simple to fix i just run for 1st time into the problem.
> When i plug in a usb disk it always assigned a different device name sdd or
> sde etc.
> I'd it to be assigned always the same name, say, I want my 250disk be sdc.
>
> sd* devices for usbdisks are created be the system when needed.
> I thought I could just make them with MAKEDEV and then write in fstab.
> But I didn't find MAKEDEV script.
>
> How should i act?


best thing is probably to read up on udev a bit. when a new device is
detected, udev responds by creating a device node for it. you can write
udev rules to make sure that a particular device is always given a specific
device name. or better, that a fixed symlink is always created to the
proper device. i.e. you could make sure that wheneven you plug in your
external drive, udev automatically creates a symlink /dev/myextdrive
pointing to the right device node. see /etc/udev/rules.d/ and google 'udev
rules' or something.

however, you can also let your desktop environment take care of things by
automounting devices. i simply assign volume names to my external
drives/usb sticks (even FAT supports volume names), and then i know they'll
always mounted under /media/<vol_name> (the directory is created when
necessary).


--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
Reply With Quote
  #4 (permalink)  
Old 06-28-2008, 05:21 PM
Dan C
 
Posts: n/a
Re: How to get a usbdisk to recieve alwayas the same device name (sdc for example)?

On Sat, 28 Jun 2008 16:54:23 +0400, =SERGE= wrote:

> well i'm sure it's simple to fix i just run for 1st time into the problem.
> When i plug in a usb disk it always assigned a different device name sdd or
> sde etc.
> I'd it to be assigned always the same name, say, I want my 250disk be sdc.
>
> sd* devices for usbdisks are created be the system when needed.
> I thought I could just make them with MAKEDEV and then write in fstab.
> But I didn't find MAKEDEV script.


MADEDEV is obselete. These days 'udev' handles this type of thing, as
others have already told you. Do some Googling/reading on udev, and have
a look at how to write (simple) udev rules. The rules themselves are
contained in the /etc/udev/rules.d directory.


--
"Bother!" said Pooh, as he cut his initials in the snow.

Reply With Quote
  #5 (permalink)  
Old 06-28-2008, 05:33 PM
jjg
 
Posts: n/a
Re: How to get a usbdisk to recieve alwayas the same device name (sdc for example)?

=SERGE= wrote:

> hi,
>
> well i'm sure it's simple to fix i just run for 1st time into the problem.
> When i plug in a usb disk it always assigned a different device name sdd
> or sde etc.
> I'd it to be assigned always the same name, say, I want my 250disk be sdc.
>
> sd* devices for usbdisks are created be the system when needed.
> I thought I could just make them with MAKEDEV and then write in fstab.
> But I didn't find MAKEDEV script.
>
> How should i act?
>
> thank you


As another reaction said already: look for /dev/disk/by-label or by-id, and
you will find that it is a link to /dev/sd<whatever it happens to be at the
time>. And it is fixed to the device, so you don't even have to worry about
the sdxy designation. Just use the label or id, and thanks to the link
mechanism everything solves itself!
Reply With Quote
  #6 (permalink)  
Old 06-28-2008, 06:40 PM
loki harfagr
 
Posts: n/a
Re: How to get a usbdisk to recieve alwayas the same device name(sdc for example)?

On Sat, 28 Jun 2008 12:21:33 -0500, Dan C wrote:

> MADEDEV is obselete.


Congratulations for this part, you synchronized a
Lacanian lapsus and a modquote-maker!-)
Reply With Quote
  #7 (permalink)  
Old 06-28-2008, 11:30 PM
=?ISO-8859-1?B?u1Gr?=
 
Posts: n/a
Re: How to get a usbdisk to recieve alwayas the same device name(sdc for example)?

On Sat, 28 Jun 2008 16:54:23 +0400
"=SERGE=" <serge_mtu@mtu-net.ru> wrote:

> well i'm sure it's simple to fix i just run for 1st time into the
> problem. When i plug in a usb disk it always assigned a different
> device name sdd or sde etc.
> I'd it to be assigned always the same name, say, I want my 250disk be
> sdc


<http://www.reactivated.net/writing_udev_rules.html> should help.
Reply With Quote
  #8 (permalink)  
Old 06-29-2008, 06:15 AM
=SERGE=
 
Posts: n/a
Re: How to get a usbdisk to recieve alwayas the same device name (sdc for example)?

Thank you very much to all

Surely udev rules howto will help.
There is the same problem with my ide disks atached to a ideraid (it works
only as ide controller no raid mode)
The disks are recognosed as scsi disk with the names /dev/sd*
What to do this case? may be they will be mounted always in the same order
as they attached to the controller?
So there shouldnt be a problem.



"»Q«" <boxcars@gmx.net> wrote in message
news:20080628183004.5bc5071f@bellgrove.remarqs.net ...
> On Sat, 28 Jun 2008 16:54:23 +0400
> "=SERGE=" <serge_mtu@mtu-net.ru> wrote:
>
>> well i'm sure it's simple to fix i just run for 1st time into the
>> problem. When i plug in a usb disk it always assigned a different
>> device name sdd or sde etc.
>> I'd it to be assigned always the same name, say, I want my 250disk be
>> sdc

>
> <http://www.reactivated.net/writing_udev_rules.html> should help.



Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Slackware


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:04 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109