Périphériques USB sous Unix (suite)
Il y a quelques temps, je parlais d'un problème de mount de disques USB sous Linux. Vous m'avez alors conseillé (en commentaire) ceci :
En réalité, je me suis aidé d'un post que j'ai trouvé sur les forums de linuxquestions.org.
When a removable USB device is plugged in/out of a Linux box, there's no telling if Linux will assign that piece of hardware the same ID (ie. /dev/sdc1) each time. This of course wreaks havoc when trying to write an rsync backup script that starts by mounting the removable drive. Here's how to ensure that multiple *identical* removable hdd's can all get mounted and used.
En conclusion, merci tout le monde, et à bientôt pour de nouvelles aventures.
- Tu peux essayer de mounter tes disques en utilisant leur label. Sur les kernels linux récents (avec udev quoi) tu peux y accéder via /dev/disk/by-label.
- Tu peux instaurer des règles de nommage pour certains périphériques. Il y a une page de la documentation Ubuntu a ce sujet : http://doc.ubuntu-fr.org/udev
- Sinon, il y a HAL qui est bien pour pas ce prendre la tête avec tout ça.
- Auto-mount devrait faire l'affaire, en effet.
En réalité, je me suis aidé d'un post que j'ai trouvé sur les forums de linuxquestions.org.
When a removable USB device is plugged in/out of a Linux box, there's no telling if Linux will assign that piece of hardware the same ID (ie. /dev/sdc1) each time. This of course wreaks havoc when trying to write an rsync backup script that starts by mounting the removable drive. Here's how to ensure that multiple *identical* removable hdd's can all get mounted and used.
- Create or edit the following new file :
nano /etc/udev/rules.d/10-local.rules
Code:## gk - Persistent name for removable USB hdd's used for backup
Note that the SYSFS{manufacturer} data comes from this command (while the drive is connected but not mounted on the server) :
BUS=="usb", KERNEL=="sd?1", SYSFS{manufacturer}=="Prolific Technology Inc.", NAME="%k", SYMLINK+="usbhdd1"udevinfo -a -p $(udevinfo -q path -n /dev/sdc)
- Once the rule is created, disconnect, then reconnect the removable device so udev re-reads it's ruleset. Now there should be a new symlink, /dev/usbhdd%n, that points to the actual device file, in this case, /dev/sdc1.
- Modify /etc/fstab so you can mount /dev/usbhdd1 at /media/usbhdd:
- nano /etc/fstab and add the following:
/dev/usbhdd1 /media/usbhdd ext3 rw,user,noauto 0 0
En conclusion, merci tout le monde, et à bientôt pour de nouvelles aventures.

Youpi ! \o/
(Le post hyper constructif...)
Effectivement j'utilise régulièrement le mount par label mais pas au boot. j'avais bêtement pensé que ça fonctionnerai en l'utilisant dans le fstab, désolé.
Enregistrer un commentaire
Créer un lien