Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP]Mappare i device con udev
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
abaddon83
Guru
Guru


Joined: 17 Jan 2004
Posts: 494

PostPosted: Wed Nov 10, 2004 12:30 pm    Post subject: [TIP]Mappare i device con udev Reply with quote

Ciao a tutti spero che non sia stato già fatto, è una piccola guida per mappare i device usb in gentoo in modo diverso dal solito /dev/sda per esempio

INFO

Dunque questo tips è utile per tutti quelli che hanno bisogno che una periferica usb-storage e non, sia sempre identifcato con un ben preciso device es. /dev/chiavetta. In questo modo ogni vostro dipositivo verrà abbinato ad un suo proprio ed unico device e non ad uno generico tipo sda.


COSA SERVE
-hotplug
-sistema con udev
-kernel 2.6
-sysfs montato

CONFIGURAZIONE

Prima di iniziare collegate il vostro device, nel mio caso una fotocamera :P
e con dmesg guardate a che device ve l'ha abbinata.
Code:

#dmesg
usb 4-1: new full speed USB device using address 2
midi: probe of 4-1:1.0 failed with error -5
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: Digital   Model: Image Device      Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 32768 512-byte hdwr sectors (17 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
 sda: sda1
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0
USB Mass Storage device found at 2



Dovreste trovare qualche cosa tipo "sda", a questo punto lanciate il comando "udevinfo" che vi restituirà tutti i parametri della macchina fotografica in questo caso :)
Code:

#udevinfo -a -p /sys/block/sda

udevinfo starts with the device the node belongs to and then walks up the
device chain, to print for every device found, all possibly useful attributes
in the udev key format.
Only attributes within one device section may be used together in one rule,
to match the device for which the node will be created.

  looking at class device '/sys/block/sda':
    SYSFS{dev}="8:0"
    SYSFS{range}="16"
    SYSFS{removable}="1"
    SYSFS{size}="32768"
    SYSFS{stat}="      21      254      282      550        0        0        0        0        0     550      550"

follow the class device's "device"
  looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/host0/0:0:0:0':
    BUS="scsi"
    ID="0:0:0:0"
    SYSFS{detach_state}="0"
    SYSFS{device_blocked}="0"
    SYSFS{max_sectors}="240"
    SYSFS{model}="Image Device    "
    SYSFS{queue_depth}="1"
    SYSFS{rev}="1.00"
    SYSFS{scsi_level}="3"
    SYSFS{state}="running"
    SYSFS{timeout}="30"
    SYSFS{type}="0"
    SYSFS{vendor}="Digital "

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/host0':
    BUS=""
    ID="host0"
    SYSFS{detach_state}="0"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0':
    BUS="usb"
    ID="4-1:1.0"
    SYSFS{bAlternateSetting}=" 0"
    SYSFS{bInterfaceClass}="08"
    SYSFS{bInterfaceNumber}="00"
    SYSFS{bInterfaceProtocol}="50"
    SYSFS{bInterfaceSubClass}="06"
    SYSFS{bNumEndpoints}="03"
    SYSFS{detach_state}="0"
    SYSFS{iInterface}="00"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.2/usb4/4-1':
    BUS="usb"
    ID="4-1"
    SYSFS{bConfigurationValue}="1"
    SYSFS{bDeviceClass}="00"
    SYSFS{bDeviceProtocol}="00"
    SYSFS{bDeviceSubClass}="00"
    SYSFS{bMaxPower}="500mA"
    SYSFS{bNumConfigurations}="1"
    SYSFS{bNumInterfaces}=" 1"
    SYSFS{bcdDevice}="0100"
    SYSFS{bmAttributes}="80"
    SYSFS{detach_state}="0"
    SYSFS{devnum}="2"
    SYSFS{idProduct}="0822"
    SYSFS{idVendor}="0461"
    SYSFS{manufacturer}="DigitalImageDevice"
    SYSFS{maxchild}="0"
    SYSFS{product}="Mega-Pixel Digital Camera"
    SYSFS{serial}="01.00.00"
    SYSFS{speed}="12"
    SYSFS{version}=" 1.00"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.2/usb4':
    BUS="usb"
    ID="usb4"
    SYSFS{bConfigurationValue}="1"
    SYSFS{bDeviceClass}="09"
    SYSFS{bDeviceProtocol}="00"
    SYSFS{bDeviceSubClass}="00"
    SYSFS{bMaxPower}="  0mA"
    SYSFS{bNumConfigurations}="1"
    SYSFS{bNumInterfaces}=" 1"
    SYSFS{bcdDevice}="0206"
    SYSFS{bmAttributes}="c0"
    SYSFS{detach_state}="0"
    SYSFS{devnum}="1"
    SYSFS{idProduct}="0000"
    SYSFS{idVendor}="0000"
    SYSFS{manufacturer}="Linux 2.6.9-gentoo-r1 uhci_hcd"
    SYSFS{maxchild}="2"
    SYSFS{product}="Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3"
    SYSFS{serial}="0000:00:1d.2"
    SYSFS{speed}="12"
    SYSFS{version}=" 1.10"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.2':
    BUS="pci"
    ID="0000:00:1d.2"
    SYSFS{class}="0x0c0300"
    SYSFS{detach_state}="0"
    SYSFS{device}="0x24c7"
    SYSFS{irq}="9"
    SYSFS{subsystem_device}="0x102a"
    SYSFS{subsystem_vendor}="0x1734"
    SYSFS{vendor}="0x8086"

  looking at the device chain at '/sys/devices/pci0000:00':
    BUS=""
    ID="pci0000:00"
    SYSFS{detach_state}="0"


a noi interessa solo la parte che inzia con BUS="scsi", circa questa:
Code:

  BUS="scsi"
    ID="0:0:0:0"
    SYSFS{detach_state}="0"
    SYSFS{device_blocked}="0"
    SYSFS{max_sectors}="240"
    SYSFS{model}="Image Device    "
    SYSFS{queue_depth}="1"
    SYSFS{rev}="1.00"
    SYSFS{scsi_level}="3"
    SYSFS{state}="running"
    SYSFS{timeout}="30"
    SYSFS{type}="0"
    SYSFS{vendor}="Digital "


e in particolar modo questi 2 parametri:
-SYSFS{vendor}="Digital"
-SYSFS{model}="Image Device"

aprite il vostro editor di fiducia in /etc/udev/rules.d/10-local.rules
Code:

#nano /etc/udev/rules.d/10-local.rules


scorrete tutto il file fino ad arrivare in fondo e aggiungete la seguente riga:
Code:

BUS="scsi",SYSFS{vendor}="Digital",SYSFS{model}="Image Device", NAME="%k", SYMLINK="fuj-camera%n"


il %n nel nome serve a identificare la partizione, es fuj-camera0 , fuj-camera1, ecc...

Createvi una cartella in /mnt/fuj-camera per esempio e aprite il file /etc/fstab

Code:

#nano /etc/fstab


aggiungente quindi la seguente riga:
Code:

/dev/fuj-camera1        /mnt/fuj-camera  auto            noauto,users         0 0


a questo punto basterebbe montare la periferica in questo modo
Code:

#mount /mnt/fuj-camera


e il gioco è fatto.

RENDERE IL DEVICE AUTOMOUNT

Dunque udev ogni volta che sente una nuova periferica va a cercare in /etc/dev.d/nome_dev/*.dev ed esegue qualsiasi cosa che termina con .dev

basta quindi creare una nuova dir e un piccolo script:
Code:

#mkdir /etc/dev.d/fuj-camera1
#nano /etc/dev.d/fuj-camera1/automount.dev


e inserire queste righe:
Code:

#!/bin/bash
if [ "$ACTION" == "add" ] ; then
 logger -t dev.d "Mounting external HD"
 /bin/mount /mnt/fuj-camera
fi
if [ "$ACTION" == "remove" ] ; then
 logger -t dev.d "Unmounting external HD"
 /bin/umount /mnt/fuj-camera
fi


Salvare e uscire.

ora ogni volta che inserire/toglierete il device, esso verrà automaticamente montato e smontato


Spero posa essere utile a qualche d'uno... non bastonatemi troppo.. è il mio primo TIP :P

Ciao


Per maggiori info ecco il link da dove ho preso spunto:
http://www.slacky.it/tutorial/udev/HOWTO-udev.html

EDIT:
Aggiornato su suggerimento di [hammerfall]
_________________
Abaddon's House
Jabber account: abaddon@jabber.linux.it


Last edited by abaddon83 on Wed Nov 10, 2004 4:20 pm; edited 2 times in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30822
Location: here

PostPosted: Wed Nov 10, 2004 12:52 pm    Post subject: Reply with quote

Bel tip ora lo aggiungo ai post utilissimi
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
abaddon83
Guru
Guru


Joined: 17 Jan 2004
Posts: 494

PostPosted: Wed Nov 10, 2004 12:56 pm    Post subject: Reply with quote

miticooo :)

Grazie

Ciao
_________________
Abaddon's House
Jabber account: abaddon@jabber.linux.it
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Wed Nov 10, 2004 1:00 pm    Post subject: Reply with quote

Interessante... stavo giusto pianificando il passaggio a udev entro fine mese :-)
_________________
Ciao da me!
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30822
Location: here

PostPosted: Wed Nov 10, 2004 1:01 pm    Post subject: Reply with quote

randomaze wrote:
Interessante... stavo giusto pianificando il passaggio a udev entro fine mese :-)

Non e' nulla di doloroso puoi farlo in 5 minuti
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Wed Nov 10, 2004 1:10 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Non e' nulla di doloroso puoi farlo in 5 minuti


Si, lo immagino... ma preferisco fare in maniera "comoda" ;-)

In merito al montare automaticamente le chiavette USB può essere utile rileggere anche questo thread
_________________
Ciao da me!
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Wed Nov 10, 2004 2:51 pm    Post subject: Reply with quote

@abaddon83: ottimo tip :wink:
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
[hammerfall]
Apprentice
Apprentice


Joined: 27 May 2004
Posts: 243

PostPosted: Wed Nov 10, 2004 3:02 pm    Post subject: Reply with quote

Voglio farti un appunto: non e' molto corretto mettere le proprie regole nel file 50-udev.rules in quanto qui sono presenti le regole base del sistema.
Per mettere le proprie regole esiste l'apposito file
Code:
/etc/udev/rules.d/10-local.rules

che viene interpellato prima del file delle regole base.
Inoltre non sono d'accordo su
Code:
NAME="fuj-camera%n"
in genere e' piu' comodo fare
Code:
 NAME="%k", SYMLINK="fuj-camera%n"

In questo modo il device avra' il nome che avrebbe usato il kernel (utile nel caso di malfunzionamenti che blocchino il device) e poi viene creato un link simbolico col nome che decidi tu e al quale aggancerai le cartelle nel fstab. In questo modo anche se il nome di device e' occupato (altre periferiche scsi, unmount non corretti etc) il symlink puntera' sempre al device giusto.

A me capitano situazioni problematiche con un hd esterno usb2. ogni tanto, forse a causa del chip che converte usb<->ide l'hd muore e devo staccare e riattaccare il cavo per farlo riavviare. il nome device originale rimane pero' occupato (sda nel mio caso) e il disco viene visto come sdb. Con questo sistema il mio symlink punta sempre al posto giusto :twisted:
_________________
--------

Hammerfall ^_^
Back to top
View user's profile Send private message
Josuke
Veteran
Veteran


Joined: 07 May 2003
Posts: 1175
Location: Italy - Bolzano

PostPosted: Wed Nov 10, 2004 3:11 pm    Post subject: Reply with quote

veramente un ottimo tip...mi serviva proprio grazie mille :)
_________________
fletto i muscoli...e sono nel vuoto
Back to top
View user's profile Send private message
abaddon83
Guru
Guru


Joined: 17 Jan 2004
Posts: 494

PostPosted: Wed Nov 10, 2004 3:26 pm    Post subject: Reply with quote

[hammerfall] wrote:
Voglio farti un appunto: non e' molto corretto mettere le proprie regole nel file 50-udev.rules in quanto qui sono presenti le regole base del sistema.
Per mettere le proprie regole esiste l'apposito file
Code:
/etc/udev/rules.d/10-local.rules

[..]


hai ragione, solo che dove mi son documentato io addirittura dicevano di cambiare in udev.conf il percorso delle rulles e creare un altro file tipo udev.rulles solo che facendo così la prima volt ami tagliai completamente il file 50-udev.rules e parecchia roba cesso d'andare... -_-'' per questo avevo ripiegato lì.

comunque grazie dell'appunto ora correggo.


non ho ben capito la storia del sda e sdb e dei blocchi... guardando il dmseg infatti anche dopo queste modifiche la periferica usb me la becca sempre come sda e poi è udev che me la fa vedere anche come "fuj-camera" quindi in teoria se sda risulta occupata per qualsiasi motivo passa a sdb e udev aggiona fuj-camera a sdb.

Sbaglio?


Grazie a tutti :)
_________________
Abaddon's House
Jabber account: abaddon@jabber.linux.it
Back to top
View user's profile Send private message
[hammerfall]
Apprentice
Apprentice


Joined: 27 May 2004
Posts: 243

PostPosted: Wed Nov 10, 2004 3:45 pm    Post subject: Reply with quote

allora, la mia situazione e' particolare, in quanto se la periferica in oggetto funzionasse correttamente, il comportamento dovrebbe essere quello che hai detto tu: se attacco la camera mi crea /dev/fujitsu1 e se la tolgo penso che lo tolga o comunque marchi il device come non in uso cosi' che riattacando la periferica questa venga riassociata al medesimo nome di device.
Io pero' ho sto controller che fa i capricci, quindi il device /dev/sda (creato quando attacco l'hd) rimane occupato e presente quando il disco si blocca. quindi al successivo inserimento compare un altro nome (/dev/sdb) e ritrovo anche /dev/sda (che pero' risulta inaccessibile).
La stessa cosa accadrebbe anche col tuo set di regole: mi ritroverei con un /dev/disco1 e un /dev/disco2, utilizzando la mia versione invece ho si' un nome device diverso pero' il symlink punta sempre a quello giusto :)

Trovo comodo questo modo di scrivere le regole in questo modo anzitutto per ovviare il mio personale problema e in secondo luogo per mantenere anche i nomi standard dei device, comunque queste sono questioni di gusti personali :P
_________________
--------

Hammerfall ^_^
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Wed Nov 10, 2004 3:50 pm    Post subject: Reply with quote

[hammerfall] wrote:

[CUT]
Trovo comodo questo modo di scrivere le regole in questo modo anzitutto per ovviare il mio personale problema e in secondo luogo per mantenere anche i nomi standard dei device, comunque queste sono questioni di gusti personali :P


Concordo con te in questo modo si ottengono sia i device classici che il simlink. Penso che questa sia la soluzione migliore :wink:
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
motaboy
Developer
Developer


Joined: 15 Dec 2003
Posts: 1483

PostPosted: Wed Nov 10, 2004 4:05 pm    Post subject: Reply with quote

[hammerfall] wrote:
Io pero' ho sto controller che fa i capricci, quindi il device /dev/sda (creato quando attacco l'hd) rimane occupato e presente quando il disco si blocca. quindi al successivo inserimento compare un altro nome (/dev/sdb) e ritrovo anche /dev/sda (che pero' risulta inaccessibile).


Hai riportato il tuo problema a chi di dovere?
_________________
...
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Wed Nov 10, 2004 4:08 pm    Post subject: Reply with quote

motaboy wrote:

[CUT]
Hai riportato il tuo problema a chi di dovere?


Credo che il problema sia dell harddisk rimovibile, quindi si dovrebbe lamentare con il produttore :wink:
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
abaddon83
Guru
Guru


Joined: 17 Jan 2004
Posts: 494

PostPosted: Wed Nov 10, 2004 4:21 pm    Post subject: Reply with quote

ho capito :) modificato il TIP come suggerito :)

Thx
_________________
Abaddon's House
Jabber account: abaddon@jabber.linux.it
Back to top
View user's profile Send private message
[hammerfall]
Apprentice
Apprentice


Joined: 27 May 2004
Posts: 243

PostPosted: Wed Nov 10, 2004 5:22 pm    Post subject: Reply with quote

motaboy wrote:
Hai riportato il tuo problema a chi di dovere?

E' un problema dell' HW infatti mi fa lo stesso scherzo anche con windows. Ho notato pero' che se da win abilito la politica "rimozione veloce" anziche' "massime prestazioni" si pianta molto meno di frequente. Evidentemente il s.o. per massimizzare la velocita' differisce le scritture tenendo i dati in ram per poi spedirli in blocco a intervalli regolari, peccato che cio' probabilmente saturi la banda e/o faccia sbarellare il mio controller. Purtroppo non so come impostare un settaggio simile anche qui in linux.

p.s.: scusate se sono andato un po' ot. :roll:
_________________
--------

Hammerfall ^_^
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Wed Nov 10, 2004 5:24 pm    Post subject: Reply with quote

[hammerfall] wrote:
Ho notato pero' che se da win abilito la politica "rimozione veloce" anziche' "massime prestazioni" si pianta molto meno di frequente.


"Massime prestazioni" dovrebbe essere la versione bufferizzata.
Hai provato a dare l'opzione sync nell'fstab?
_________________
Ciao da me!
Back to top
View user's profile Send private message
Josuke
Veteran
Veteran


Joined: 07 May 2003
Posts: 1175
Location: Italy - Bolzano

PostPosted: Wed Nov 10, 2004 5:35 pm    Post subject: Reply with quote

scusate ma ho un problema ..sembra che nel secondo modo non mi vada...forse son tonno io per se faccio

Code:
BUS="scsi",SYSFS{vendor}="        ",SYSFS{model}="USB DISK Pro    ", NAME="usbdisk_pro%n"


va..se invece faccio:

Code:
BUS="scsi",SYSFS{vendor}="        ",SYSFS{model}="USB DISK Pro    ", NAME="%k", SYMLINK="usbdisk_pro%n"


non ci pensa nemmeno ad andare 8O
_________________
fletto i muscoli...e sono nel vuoto
Back to top
View user's profile Send private message
abaddon83
Guru
Guru


Joined: 17 Jan 2004
Posts: 494

PostPosted: Wed Nov 10, 2004 6:09 pm    Post subject: Reply with quote

io il secondo metodo non l'ho ancora provato, appena lo provo ti faccio sapere
_________________
Abaddon's House
Jabber account: abaddon@jabber.linux.it
Back to top
View user's profile Send private message
Nexus78
n00b
n00b


Joined: 12 Dec 2004
Posts: 11
Location: Pescara

PostPosted: Sun Feb 20, 2005 1:50 pm    Post subject: Reply with quote

Ciao a tutti,

ho mappato un hd usb esterno, un lettore mp3 ed una penna usb,

Code:

BUS="scsi",SYSFS{vendor}="USB 2.0",SYSFS{model}="Storage Device", NAME="%k", SYMLINK="olidata%n"
BUS="scsi",SYSFS{vendor}="SanDisk",SYSFS{model}="Cruzer Micro", NAME="%k", SYMLINK="sandisk%n"
BUS="scsi",SYSFS{vendor}="Digital ",SYSFS{model}="MP3 Music Player", NAME="%k", SYMLINK="magnex%n"


per l'hd nessun problema ma il lettore e la penna non vanno, quando provo a montarle mi da questo errore :

Code:

mount: /dev/sandisk1 is not a block device


Se invece provo a montarli con il loro device *reale* (sda1,sdc1,sdd1...) fila tutto liscio

questo e' l'fstab :
Code:

/dev/sandisk1           /mnt/usbstick   vfat            user,exec,rw,auto,mask=0  0 0
/dev/olidata1           /mnt/share   vfat  user,exec,rw,auto,umask=0 0 0
/dev/magnex1           /mnt/mp3   vfat  user,exec,rw,auto,umask=0 0 0


idee?

RISOLTO

Ho aggiunto KERNEL="sd?1" nelle rules di UDEV

Code:

BUS="scsi",SYSFS{vendor}="USB 2.0",SYSFS{model}="Storage Device", NAME="%k", SYMLINK="olidata%n"
BUS="usb",SYSFS{serial}="SNDKA9B554322E708401", NAME="%k", KERNEL="sd?1", SYMLINK="sandisk%n"
BUS="scsi",SYSFS{vendor}="Digital ",SYSFS{model}="MP3 Music Player", KERNEL="sd?1", NAME="%k", SYMLINK="magnex%n"
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Mon Feb 21, 2005 11:23 am    Post subject: Reply with quote

Volevo fare una precisazione riguardo la parte relativa all'automount. Così per come è scritta quella sezione il discorso in pratica non funziona dal momento che come descritto nella pagina ma di udev:

Quote:

After device node creation, removal, or network device renaming, udev
executes the programs in the directory tree under /etc/dev.d/. The
name of a program must end with .dev suffix, to be recognized.
In addition to the hotplug environment variables, DEVNAME is exported
to make the name of the created node, or the name the network device is
renamed to, available to the executed program. The programs in every
directory are sorted in lexical order, while the directories are
searched in the following order:

/etc/dev.d/$(DEVNAME)/*.dev
/etc/dev.d/$(SUBSYSTEM)/*.dev
/etc/dev.d/default/*.dev


Ma nel nostro caso le regole implicano che DEVNAME="sda" e quindi gli script di automount non verranno ma i eseguiti. Le regole corrette affinchè tali script vengano eseguiti sono (nel mio caso particolare):

Code:

BUS="scsi",SYSFS{vendor}="        ",SYSFS{model}="EyeQ 3132z1.00", SYMLINK="%k", NAME="digital-camera%n"

BUS="scsi",SYSFS{vendor}="OTi     ",SYSFS{model}="Flash Disk      ", SYMLINK="%k", NAME="usbkey%n"


Ovvero il device che creiamo è nel primo caso digital-camera e sdX sarà un link simbolico a quest'ultimo.

Se qualcuno ha trovato una soluzione più elegante me lo faccia sapere ;)
_________________
Registered as User #281564 and Machines #163761


Last edited by gutter on Mon Feb 21, 2005 10:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4787
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Mon Feb 21, 2005 9:17 pm    Post subject: Reply with quote

gutter wrote:

...

Se qualcuno ha trovato una soluzione più elegante me lo faccia sapere ;)

Naturalmente non sono io quel qualcuno, ma posso confermare che la tua precisazione è essenziale.

Altrimenti, riuscivo a creare il dispositivo, ma non a realizzare il mount.

E naturalmente, grazie abaddon83 per l'ottimo tip.
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Mon Feb 21, 2005 10:41 pm    Post subject: Reply with quote

Ho un problema con l'automounting, ho impostato come suggerito ma il montaggio automatico non funziona tramite script e non riesco a verificare che cosa accada...

Code:

altair philips_mp3 # ls /dev/philipsMp3_
philipsMp3_   philipsMp3_0  philipsMp3_1 
altair philips_mp3 # ll /dev/philipsMp3_*
lrwxrwxrwx  1 root root 3 21 feb 21:01 /dev/philipsMp3_ -> sda
lrwxrwxrwx  1 root root 3 21 feb 21:01 /dev/philipsMp3_0 -> sg0
lrwxrwxrwx  1 root root 4 21 feb 21:01 /dev/philipsMp3_1 -> sda1
altair philips_mp3 # mount | grep philips
altair philips_mp3 # mount /mnt/philipsMp3_1/
altair philips_mp3 # ls /mnt/philipsMp3_1/
settings.sec  _system
altair philips_mp3 #


Edit.. ma sg0 che e' ?
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Mon Feb 21, 2005 10:45 pm    Post subject: Reply with quote

Domanda stupidissima (scusami in anticipo): hai dato i permessi di esecuzione agli script?

Posta un:

Code:
 ls -lR /etc/dev.d/

_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Mon Feb 21, 2005 10:51 pm    Post subject: Reply with quote

penso di si ..
Code:

altair everything # ls -lR /etc/dev.d/
/etc/dev.d/:
totale 0
drwxr-xr-x  2 root root 48  3 ago  2004 default
drwxr-xr-x  2 root root 80  9 feb 00:32 net
drwxr-xr-x  2 root root 80 21 feb 20:51 philips_mp3

/etc/dev.d/default:
totale 0

/etc/dev.d/net:
totale 4
-rwxr-xr-x  1 root root 537  9 feb 23:36 hotplug.dev

/etc/dev.d/philips_mp3:
totale 4
-rwxr-xr-x  1 root root 231 21 feb 21:01 automount.dev
altair everything #
altair everything #

_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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