Openwrt usb-storage – Montage d’une clé usb
Notre Fonera (2202) fraîchement installée sous OpenWrt est (presque) prête à accueillir des périphériques de stockages USB. Voici un premier test avec une clé usb.
Avant toute chose, il faudra installer les modules noyau pour la gestion du stockage usb et les systèmes de fichier fat (fat 16 et fat32). La clef utilisée étant formatée en fat16.
root@OpenWrt:/# opkg install kmod-usb-storage Installing kmod-usb-storage (2.6.26.5-atheros-1) to root... Downloading http://downloads.openwrt.org/snapshots/atheros/packages/./kmod-usb-storage_2.6.26.5-atheros-1_mips.ipk Connecting to downloads.openwrt.org (195.56.146.238:80) kmod-usb-storage_2.6 100% |************************************************************************************************************| 47028 00:00:00 ETA Installing kmod-scsi-core (2.6.26.5-atheros-1) to root... Downloading http://downloads.openwrt.org/snapshots/atheros/packages/./kmod-scsi-core_2.6.26.5-atheros-1_mips.ipk Connecting to downloads.openwrt.org (195.56.146.238:80) kmod-scsi-core_2.6.2 100% |************************************************************************************************************| 69267 00:00:00 ETA Configuring kmod-scsi-core Configuring kmod-usb-storage root@OpenWrt:/# dmesg ... SCSI subsystem initialized Driver 'sd' needs updating - please use bus_type methods Initializing USB Mass Storage driver... scsi0 : SCSI emulation for USB Mass Storage devices usbcore: registered new interface driver usb-storage USB Mass Storage support registered. usb-storage: device found at 2 usb-storage: waiting for device to settle before scanning scsi 0:0:0:0: Direct-Access SanDisk U3 Cruzer Micro 4.05 PQ: 0 ANSI: 2 sd 0:0:0:0: [sda] 8013453 512-byte hardware sectors (4103 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00 sd 0:0:0:0: [sda] Assuming drive cache: write through sd 0:0:0:0: [sda] 8013453 512-byte hardware sectors (4103 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00 sd 0:0:0:0: [sda] Assuming drive cache: write through sda: sda1 sd 0:0:0:0: [sda] Attached SCSI removable disk scsi 0:0:0:1: CD-ROM SanDisk U3 Cruzer Micro 4.05 PQ: 0 ANSI: 2 usb-storage: device scan complete |
Ok pour ça… On obtient un disque scsi émulé sda et une partition : sda1. Occupons nous maintenant de la gestion des systèmes de fichiers fat.
root@OpenWrt:/# opkg list|grep vfat kmod-fs-vfat - 2.6.26.5-atheros-1 - Kernel module for VFAT filesystem support root@OpenWrt:/# opkg install kmod-fs-vfat Installing kmod-fs-vfat (2.6.26.5-atheros-1) to root... Downloading http://downloads.openwrt.org/snapshots/atheros/packages/./kmod-fs-vfat_2.6.26.5-atheros-1_mips.ipk Connecting to downloads.openwrt.org (195.56.146.238:80) kmod-fs-vfat_2.6.26. 100% |************************************************************************************************************| 37463 --:--:-- ETA Installing kmod-nls-base (2.6.26.5-atheros-1) to root... Downloading http://downloads.openwrt.org/snapshots/atheros/packages/./kmod-nls-base_2.6.26.5-atheros-1_mips.ipk Connecting to downloads.openwrt.org (195.56.146.238:80) kmod-nls-base_2.6.26 100% |************************************************************************************************************| 3704 --:--:-- ETA Configuring kmod-fs-vfat Configuring kmod-nls-base |
Premier essai : pas très concluant :
root@OpenWrt:/# mount -t vfat /dev/sda1 /mnt/usbdrive/ mount: mounting /dev/sda1 on /mnt/usbdrive/ failed: Invalid argument root@OpenWrt:/# logread ... Oct 16 08:33:36 OpenWrt user.err kernel: FAT: codepage cp437 not found Oct 16 08:38:49 OpenWrt user.err kernel: FAT: codepage cp437 not found Oct 16 08:39:11 OpenWrt user.err kernel: FAT: codepage cp437 not found Oct 16 08:39:45 OpenWrt user.err kernel: FAT: codepage cp437 not found Oct 16 08:40:08 OpenWrt user.err kernel: FAT: codepage cp437 not found Oct 16 08:40:37 OpenWrt user.err kernel: FAT: codepage cp437 not found |
Il s’agit d’un problème de page d’encodage… Nous avons dû louper un module…
root@OpenWrt:/# opkg list |grep cp437 kmod-nls-cp437 - 2.6.26.7-atheros-1 - Kernel module for NLS Codepage 437 (United States, Canada) root@OpenWrt:/usr/local/apache2/htdocs/cam1# opkg install kmod-nls-cp437 Installing kmod-nls-cp437 (2.6.26.7-atheros-1) to root... Downloading http://downloads.openwrt.org/snapshots/atheros/packages/./kmod-nls-cp437_2.6.26.7-atheros-1_mips.ipk Connecting to downloads.openwrt.org (195.56.146.238:80) kmod-nls-cp437_2.6.2 100% |*********************************************************************************************************************************************************| 2954 --:--:-- ETA Configuring kmod-nls-cp437 |
Deuxième essai : On progresse… mais ce n’est pas ça !
root@OpenWrt:/# mount -t vfat /dev/sda1 /mnt/usbdrive/ mount: mounting /dev/sda1 on /mnt/usbdrive/ failed: Invalid argument root@OpenWrt:/# logread ... Oct 16 08:42:28 OpenWrt user.err kernel: FAT: IO charset iso8859-1 not found Oct 16 08:43:10 OpenWrt user.err kernel: FAT: IO charset iso8859-1 not found |
Codage caractères ce coup-ci…
root@OpenWrt:/# opkg list|grep iso88 kmod-nls-iso8859-1 - 2.6.26.5-atheros-1 - Kernel module for NLS ISO 8859-1 (Latin 1) kmod-nls-iso8859-15 - 2.6.26.5-atheros-1 - Kernel module for NLS ISO 8859-15 (Latin 9) kmod-nls-iso8859-2 - 2.6.26.5-atheros-1 - Kernel module for NLS ISO 8859-2 (Latin 2) root@OpenWrt:/# opkg install kmod-nls-iso8859-1 Installing kmod-nls-iso8859-1 (2.6.26.5-atheros-1) to root... Downloading http://downloads.openwrt.org/snapshots/atheros/packages/./kmod-nls-iso8859-1_2.6.26.5-atheros-1_mips.ipk Connecting to downloads.openwrt.org (195.56.146.238:80) kmod-nls-iso8859-1_2 100% |*******************************| 2622 --:--:-- ETA Configuring kmod-nls-iso8859-1 |
Troisième essai : C’est la bonne !
root@OpenWrt:/# mount -t vfat /dev/sda1 /mnt/usbdrive/ root@OpenWrt:/# |
Laissez votre message après le bip...Biiiiip
Commentaires
Le dernier snapshot inclut une version 2.6.27 du noyau… Les opkg install installent les modules pour cette version. Si ton installation est un peu ancienne (avant le 25/10), il te faut mettre à jour :
opkg update && opkg upgrade
Et flasher le noyau (l’upgrade ne le fait pas)
mtd -e vmlinux.bin.l7 write openwrt-atheros-vmlinux vmlinux.bin.l7 -r
Je pense que ton problème peut venir de là…
[...] de précédents retours d’expériences, j’ai montré comment installer Openwrt et gérer des périphériques de stockage usb sur une Fonera 2.0. L’idée aujourd’hui est de pousser plus loin en transformant cette [...]
J’ai bien installé tous les modules, mais je n’ai pas /dev/sda1.
# dmesg|grep usb
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
usbcore: registered new interface driver usb-storage
# dmesg|grep sda1
(rien de rien)
J’ai la derniere version d’Openwrt, 8.09.1.
Merci en avant.
Problem solved:
dmesg|grep scsi
scsi0 : SCSI emulation for USB Mass Storage devices
scsi 0:0:0:0: Direct-Access JetFlash TS2GJFV30 8.07 PQ: 0 ANSI: 2
scsi1 : SCSI emulation for USB Mass Storage devices
scsi 1:0:0:0: Direct-Access Generic USB Flash Disk PMAP PQ: 0 ANSI: 0 CCS
First device is not mounted. I think it is not supported.
Second device works right.
Great tuto! Thanks Jopa!
PD. J’ai étudié francais au lycée il y a beaucoup du temps. Je le comprends, mais c’est difficile de le parler/écrire pour moi. Pardon.
Excellent article, merci beaucoup!
J’essayais depuis une semaine de monter une clé usb sur mon openwrt sans succès, jusqu’à ce que je tombe sur votre page!
Etape suivante: je souhaite mettre à profit l’espace de stockage de la clé usb pour installer de nouveaux modules et composants (par exemple open vpn qui doit être assez gourmand en espace flash).
Avez vous un document qui explique comment faire cela ?
Bonjour José,
j’ai le même problème que vous, et je suis bloqué… comment avez-vous fait?
Merci!
PS : vous pouvez répondre en anglais si vous préférez!



J’ai bien installé tous les modules, mais je reste bloqué à l’étape 1.
On dirait que les modules ne sont pas pris en compte.
Je sèche !