LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-04-2007, 06:07 AM   #1
noidea
LQ Newbie
 
Registered: Jan 2006
Posts: 24

Rep: Reputation: 15
MP3 Player Automounting


Hi

When I plug my lg mp3 player into my pc it automounts as /media/----------- - however it works fine
---------- - is not a name I would like to use how do I change it?

My usb stick mounts as /media/disk and this is fine

I am using slackware 12

Thanks in Advance
 
Old 07-04-2007, 06:10 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I think you just need to change the label of the FAT32 filesystem.
 
Old 07-04-2007, 06:12 AM   #3
noidea
LQ Newbie
 
Registered: Jan 2006
Posts: 24

Original Poster
Rep: Reputation: 15
How would I do that not in fstab as I am using the automounting feature?
 
Old 07-04-2007, 08:00 AM   #4
janhe
Member
 
Registered: Jul 2007
Location: Belgium
Distribution: slackware64 14.2, slackware 13.1
Posts: 371

Rep: Reputation: 54
It seems like the hal/d-bus mechanism mounts removable media under /media/$label_of_filesystem
e.g.: the first slackware install cdrom gets mounted under /media/Slack12d1
Quote:
I think you just need to change the label of the FAT32 filesystem.
So you will have to change the label on the filesystem itself.

BTW, is there a way to, say, automatically create symlinks like /media/cdrom -> /media/Slack12d1 ?
 
Old 07-04-2007, 09:26 AM   #5
randomsel
Member
 
Registered: Oct 2006
Location: Wilmington, DE
Distribution: Slackware 11
Posts: 201

Rep: Reputation: 30
try setting it up in fstab, according to Pat, HAL will honor fstab, so if I want /dev/hdb1 to always mount in /media/cdrom, I'd put it there
 
Old 07-04-2007, 01:42 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If you have the mtools package installed you can use "mlabel" to label a fat32 filesystem.

You can see how udev sees the drive with:
udevinfo -q env -n /dev/sd##

You can use "sudo tail -f /var/log/messages" to monitor what device it is assigned to when you plug in your player.

---

If you install mtools, you may need to edit /etc/mtools.conf to assign a drive letter to a device. I added these lines:
Code:
drive d: file="/dev/sdc1"
drive e: file="/dev/sdd1"
Be sure to use minfo first to check that it is the correct device:
Code:
jschiwal@hpamd64:~> sudo minfo d:
device information:
===================
filename="/dev/sdc1"
sectors per track: 32
heads: 16
cylinders: 979

mformat command line: mformat -t 979 -h 16 -s 32 -H 99 d:

bootsector information
======================
banner:"!W;n6IHC"
sector size: 512 bytes
cluster size: 32 sectors
reserved (boot) sectors: 1
fats: 2
max available root directory slots: 512
small size: 0 sectors
media descriptor byte: 0xf8
sectors per fat: 62
sectors per track: 32
heads: 16
hidden sectors: 99
big size: 501149 sectors
physical drive id: 0x80
reserved=0x1
dos4=0x29
serial number: 3B691AFD
disk label="DOCS       "
disk type="FAT16   "
Create a label with:
sudo /usr/bin/mlabel d:newlabel

Then if the filesystem on the device is assigned to /dev/sdc1, you can use:
sudo /usr/bin/mlabel d:

I tried this out before posting. The filesystem didn't have a label before I used the mlabel program. Now when I insert it, it is mounted on /media/DOCS automatically.
 
Old 07-04-2007, 01:53 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
Originally Posted by randomsel
try setting it up in fstab, according to Pat, HAL will honor fstab, so if I want /dev/hdb1 to always mount in /media/cdrom, I'd put it there
I've done this for larger filesystems but not for pendrives. There are some problems with this. First of all you need to use either "UUID=" or "LABEL=" in /etc/fstab. Not a device like /dev/hdb1 because the next time you insert the device, it may not be /dev/hdb. It may be /dev/hdc instead. Also, you need to use the noauto option so that when you boot and it isn't inserted, you won't have the boot process fail. I use "uid=" and "gid=" options to have exclusive access, combined with the "user" option, I can mount it as a normal user. However HAL doesn't automount it for me. This may be distro dependent based on the contents of the /etc/udev/rules.d/ config files and whatever hal helper program or script is called in the run+= entry. This will be different for each distro.

Since UUID= or LABEL= needs to be used anyway, might as well just label the filesystem and be done with it.

Last edited by jschiwal; 07-04-2007 at 01:54 PM.
 
Old 07-04-2007, 05:30 PM   #8
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
A custom udev rules file to create persistent device nodes/symlinks for the device plus entries in /etc/fstab will work just fine.
 
Old 07-05-2007, 01:36 AM   #9
noidea
LQ Newbie
 
Registered: Jan 2006
Posts: 24

Original Poster
Rep: Reputation: 15
Thanks for the replies I will give udev rule a shot later tonight and I will let you know how I went
 
Old 07-05-2007, 07:03 AM   #10
noidea
LQ Newbie
 
Registered: Jan 2006
Posts: 24

Original Poster
Rep: Reputation: 15
I did the label option as described by jschiwal. It seems to work fine

Thanks alot
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Portable MP3 player with corrupted mp3 files today53 SUSE / openSUSE 1 05-22-2006 09:24 AM
S1 Mp3 player (Help Create a New Distro for an MP3 player!)) Ian_Hawdon Linux - General 3 12-05-2005 01:14 PM
Suse 9.2 automounting USB mp3 player badbunny Linux - Newbie 7 08-17-2005 01:06 AM
iRiver iHP-120 20GB MP3 Player, a player for the rest of us ? dukeinlondon General 1 04-04-2004 04:44 AM
MP3 CD player can't read MP3 CD's burned in linux food188 Linux - Software 2 01-11-2004 04:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration