Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Howto change names of /dev/sg?

33 views
Skip to first unread message

Simon Brandmair

unread,
Jul 18, 2011, 4:30:02 PM7/18/11
to
Hello,

I would like to change the device names of the /dev/sg? devices.
/dev/sg0 is my hard drive, /dev/sg1 my cdrom drive. I would like them to
be /dev/sg1 and /dev/sg2.

If I understand it right, these names aren't given by udev, but by the
kernel, so a udev rule doesn't work.

Background: I have an encrypted usb stick (SafeStick), that - strangely
- requires to be /dev/sg0 in order to get decrypted.

Any ideas?
Simon


--
Zum AUSTRAGEN schicken Sie eine Mail an debian-user-g...@lists.debian.org
mit dem Subject "unsubscribe". Probleme? Mail an listm...@lists.debian.org (engl)
Archive: http://lists.debian.org/j023h9$j96$1...@news.albasani.net

Tim Boneko

unread,
Jul 19, 2011, 11:00:02 AM7/19/11
to
Am Montag, den 18.07.2011, 20:02 +0000 schrieb Simon Brandmair:
> Hello,

We DO speak german :-D

> I would like to change the device names of the /dev/sg? devices.
> /dev/sg0 is my hard drive, /dev/sg1 my cdrom drive. I would like them to
> be /dev/sg1 and /dev/sg2.

Ich vermute mal, dass man dazu im Kernel- Quelltext rummachen müsste...
*schauder*
Deine Devicenamen kommen mir komisch vor. Sind die Geräte an SATA
angeschlossen? Dann müsste die Platte sdNY heißen, die erste Partition
am ersten SATA- Anschluss hieße dann sda1. CDROMs heißen gerne mal sr0,
sr1 usw.

Kann es sein, dass du einen selbst gebauten Kernel hast, dem der Support
für SCSI- Platten fehlt?

tim
--
No courtesy copies, please!
Bitte keine Privatmails parallel zur ML!


--
Zum AUSTRAGEN schicken Sie eine Mail an debian-user-g...@lists.debian.org
mit dem Subject "unsubscribe". Probleme? Mail an listm...@lists.debian.org (engl)

Archive: http://lists.debian.org/1311087311....@lucille.indehell

Simon Brandmair

unread,
Jul 19, 2011, 1:30:02 PM7/19/11
to
Hi,

On 19/7/2011 17:00 Tim Boneko wrote:
> Am Montag, den 18.07.2011, 20:02 +0000 schrieb Simon Brandmair:
>> Hello,
>
> We DO speak german :-D

Ops, ich wollte eigentlich auf der englischsprachigen Liste posten.

>
>> I would like to change the device names of the /dev/sg? devices.
>> /dev/sg0 is my hard drive, /dev/sg1 my cdrom drive. I would like them to
>> be /dev/sg1 and /dev/sg2.
>
> Ich vermute mal, dass man dazu im Kernel- Quelltext rummachen müsste...
> *schauder*

So ähnlich war auch meine Vermutung.

> Deine Devicenamen kommen mir komisch vor. Sind die Geräte an SATA
> angeschlossen? Dann müsste die Platte sdNY heißen, die erste Partition
> am ersten SATA- Anschluss hieße dann sda1. CDROMs heißen gerne mal sr0,
> sr1 usw.
>
> Kann es sein, dass du einen selbst gebauten Kernel hast, dem der Support
> für SCSI- Platten fehlt?

Ne. Die erste SATA-Partition ist auch sda1, CDROM ist sr0.

Hier mal der Anfang des Outpunts von 'udevadm info --name=/dev/sg1 \
--attribute-walk':
looking at device
'/devices/pci0000:00/0000:00:14.1/host4/target4:0:0/4:0:0:0/scsi_generic/sg1':
KERNEL=="sg1" SUBSYSTEM=="scsi_generic" DRIVER==""

looking at parent device
'/devices/pci0000:00/0000:00:14.1/host4/target4:0:0/4:0:0:0':
KERNELS=="4:0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sr"
ATTRS{device_blocked}=="0"
ATTRS{type}=="5"
ATTRS{scsi_level}=="6"
ATTRS{vendor}=="HL-DT-ST"
ATTRS{model}=="DVDRAM GSA-4167B"
ATTRS{rev}=="DL11"
ATTRS{state}=="running"
ATTRS{timeout}=="30"
ATTRS{iocounterbits}=="32"
ATTRS{iorequest_cnt}=="0x354ab"
ATTRS{iodone_cnt}=="0xd532"
ATTRS{ioerr_cnt}=="0x0"
ATTRS{modalias}=="scsi:t-0x05"
ATTRS{evt_media_change}=="0"
ATTRS{queue_depth}=="1"
ATTRS{queue_type}=="none"

Danach scheint /dev/sr0 das Parent-Device von /dev/sg1 zu sein. Ich
denke, insoweit ist alles in Ordnung. Die Frage ist nur, ob es eine
Möglichkeit gibt, die Reihenfolge der sg? zu ändern.

Cheers,
Simon


--
Zum AUSTRAGEN schicken Sie eine Mail an debian-user-g...@lists.debian.org
mit dem Subject "unsubscribe". Probleme? Mail an listm...@lists.debian.org (engl)

Archive: http://lists.debian.org/j04d7e$pgo$1...@news.albasani.net

Elimar Riesebieter

unread,
Jul 22, 2011, 1:00:01 PM7/22/11
to
* Simon Brandmair [110718 20:02 +0000]:

> Hello,
>
> I would like to change the device names of the /dev/sg? devices.
> /dev/sg0 is my hard drive, /dev/sg1 my cdrom drive. I would like them to
> be /dev/sg1 and /dev/sg2.
>
> If I understand it right, these names aren't given by udev, but by the
> kernel, so a udev rule doesn't work.

http://www.reactivated.net/writing_udev_rules.html

Elimar
--
We all know Linux is great... it does infinite loops in 5 seconds.
-- Linus Torvalds


--
Zum AUSTRAGEN schicken Sie eine Mail an debian-user-g...@lists.debian.org
mit dem Subject "unsubscribe". Probleme? Mail an listm...@lists.debian.org (engl)

Archive: http://lists.debian.org/2011072216...@samweis.home.lxtec.de

Simon Brandmair

unread,
Jul 23, 2011, 6:20:03 AM7/23/11
to
On 22/7/2011 19:00 Elimar Riesebieter wrote:

> * Simon Brandmair [110718 20:02 +0000]:
>
>> Hello,
>>
>> I would like to change the device names of the /dev/sg? devices.
>> /dev/sg0 is my hard drive, /dev/sg1 my cdrom drive. I would like them to
>> be /dev/sg1 and /dev/sg2.
>>
>> If I understand it right, these names aren't given by udev, but by the
>> kernel, so a udev rule doesn't work.
>
> http://www.reactivated.net/writing_udev_rules.html

Hm, ich kannte den Link schon, wei� aber nicht, was ich damit anfangen
soll. Wie soll denn eine udev-Rule aussehen, die sg0 mit sg1 tauscht?

Hier nochmal der Anfang von 'udevadm info --name=/dev/sg1 \
--attribute-walk':


'/devices/pci0000:00/0000:00:14.1/host4/target4:0:0/4:0:0:0/scsi_generic/sg1':
KERNEL=="sg1" SUBSYSTEM=="scsi_generic" DRIVER==""

Ciao,
Simon


--
Zum AUSTRAGEN schicken Sie eine Mail an debian-user-g...@lists.debian.org
mit dem Subject "unsubscribe". Probleme? Mail an listm...@lists.debian.org (engl)

Archive: http://lists.debian.org/j0e5ga$vg2$1...@news.albasani.net

0 new messages