How to mount a flashdrive and configure MPD

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
Post Reply
erickphilips
Posts: 14
Joined: Thu Jul 14, 2011 12:07 pm

How to mount a flashdrive and configure MPD

Post by erickphilips »

Hi guys. You might have noticed by my earlier posts I am now happily running openWRT Kamikaze 2.4 from an ASUS WL-500G Premium.
MPD is installed and configured to work with my usb sound card and I have wonderful crist internet radio to listen to.
The next step is to be able to mount a flash drive and have MPD play mp3s off it. I have the following packages installed
opkg install kmod-usb-core
opkg install kmod-usb2
opkg install kmod-usb-storage
opkg install kmod-usb-uhci
opkg install kmod-fs-ext2
opkg install kmod-fs-ext3
opkg install kmod-fs-vfat
opkg install kmod-sound-core
opkg install kmod-usb-audio
and my flash drive is currently formatted with an ext2 partition and I am having a hell of a time trying to work out how to mount the blessed thing.
I'm roughly following the instructions on http://wiki.openwrt.org/doc/howto/usb.storage here and am getting nowhere. Being a linux novice isn't helping.
Once I have it mounted I will need help configuring MPD to play music from it. I'm presuming that I need to edit the /etc/mpd.conf file first section but as I haven't got to that stage it's all a bit confusing.
Any help would be muchly appreciated.
Cheers
Mat
erickphilips
Posts: 14
Joined: Thu Jul 14, 2011 12:07 pm

Re: How to mount a flashdrive and configure MPD

Post by erickphilips »

OK so I think I've mounted it to mnt/shares/ but I can't be sure. Erm so next I do what.....?
craiglindley
Posts: 7
Joined: Tue Sep 13, 2011 12:15 pm

Re: How to mount a flashdrive and configure MPD

Post by craiglindley »

I have the same configuration running and it is sweet. I used an unpowered 4 port USB hub connected to the router to which I connected my USB sound adapter and the flash drive.

Here are my notes on what I did.

1. installed the kmod-usb-storage and kmod-fs-vfat packages
2. Created a mount point at: /root/music/flash
3. Created the usbmount script (see below) which is stored in /etc/init.d
4. Made this script executable: chmod +x usbmount
5. Enabled script: ./usbmount enable

Since I mounted the flash drive directly into MPD's directory structure MPD will create a new database when it is restarted. If this worked you can use the mpc command "mpc listall" to see the music contained in the MPD database.

Hope this helps

Craig Lindley

Copy the following into the file /etc/init.d/usbmount

#!/bin/sh /etc/rc.common
START=80
STOP=40
start()
{
sleep 5
echo -n "Mounting USB drive: "
mount -t vfat /dev/scsi/host0/bus0/target0/lun0/part1 /root/music/flash
echo "Done."
}
stop()
{
echo -n "Umounting USB drive: "
umount /dev/scsi/host0/bus0/target0/lun0/part2
echo "Done."
}
restart()
{
stop
start
}
Post Reply