You are not logged in.

#1 2010-01-09 21:02:45

samyazza
Member
From: Cracow, Poland
Registered: 2010-01-09
Posts: 27

[SOLVED] Mounting a USB drive at startup, but before MPD

Hi everyone. This is my first post here. First of all I'd like to say that I'm absolutely in love with Arch. It's definitely the best distro I've tried. I love how I'm learning stuff all the time.

Now to the point: I have an external usb drive which contains all my music. It's plugged into my laptop practically all the time. Currently HAL notices it nicely, but it starts unmounted. I have to go into Thunar and double click it's icon to mount it. I want it to behave this way: when arch boots and it's plugged in, it should be mounted before the Music Player Daemon starts (I've got it at last place in rc), so that MPD can update the music collection database at it's own bootup. I want that behavior for all storage devices and I want them to act properly (the external disk to be mounted to the right directory) wherever they're plugged, in whatever order they're mounted and whatever filesystem they have. How can I achieve that?

Last edited by samyazza (2010-01-12 13:08:46)

Offline

#2 2010-01-09 21:14:56

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mounting a USB drive at startup, but before MPD

Use the 'auto' option in fstab: http://wiki.archlinux.org/index.php/Fstab


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2010-01-12 02:44:36

samyazza
Member
From: Cracow, Poland
Registered: 2010-01-09
Posts: 27

Re: [SOLVED] Mounting a USB drive at startup, but before MPD

I've added a line to fstab:

LABEL=Elements /media/Elements  ntfs-3g   user,auto,unhide   0      0

ntfs-3g tells me that it couldn't find drive "LABEL=Elements" though. Perhaps the drive isn't noticed when the mounting occurs? If so, what can I do?

Offline

#4 2010-01-12 03:51:05

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mounting a USB drive at startup, but before MPD

You could try including rw:

LABEL=Elements /media/Elements  ntfs-3g   rw,user,auto,unhide   0      0

See if that helps...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2010-01-12 04:13:39

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: [SOLVED] Mounting a USB drive at startup, but before MPD

So "Elements" is definitely the device's label? After you mount it manually, open a terminal and type:

ls -l /dev/disk/by-label

Does it show up?

Anyway, I tried doing the same thing, even using the /dev/disk/by-uuid/XXXX.. and it said it couldn't find it, but when I got to the console and signed in, I typed: mount /media/drive and it mounted immediately. So, I think it hasn't had enough time to register the device yet, although I could be wrong.

Offline

#6 2010-01-12 04:16:34

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] Mounting a USB drive at startup, but before MPD

Read this, figure out how to do it with blkid, scratch your itch, update the wiki and be glad you've contributed to your beloved distro.

Offline

#7 2010-01-12 04:17:23

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] Mounting a USB drive at startup, but before MPD

What I do is not include my drive in fstab and I use this udev rule to automount my external drive:

http://wiki.archlinux.org/index.php/Ude … _it_exists

MPD finds my music and all works just fine.

Offline

#8 2010-01-12 13:08:20

samyazza
Member
From: Cracow, Poland
Registered: 2010-01-09
Posts: 27

Re: [SOLVED] Mounting a USB drive at startup, but before MPD

This rule works indeed, without any changes. Despite whatever the wiki says, vol_id is present in the directory /lib/initcpio/udev and it seems to be pefectly usable. Thank you!

Last edited by samyazza (2010-01-12 13:09:08)

Offline

#9 2010-01-13 15:02:45

empthollow
Member
Registered: 2009-09-26
Posts: 168

Re: [SOLVED] Mounting a USB drive at startup, but before MPD

I used the udev rule in the wiki as well.  Everything mounts but now I can't unmount without being root.  Does anyone know how to change the policykit to allow unmounts?


--empthollow
Check out my Arch based live distro http://fluxcapacity.99k.org

Offline

#10 2010-01-22 17:26:31

samyazza
Member
From: Cracow, Poland
Registered: 2010-01-09
Posts: 27

Re: [SOLVED] Mounting a USB drive at startup, but before MPD

I second the above question. I had the same problem with the drive, but I've only noticed just now that I can't graphically unmount other usb storage devices either sad

Offline

#11 2010-01-23 16:47:00

empthollow
Member
Registered: 2009-09-26
Posts: 168

Re: [SOLVED] Mounting a USB drive at startup, but before MPD

for the time being I put

mount -a

in my rc.local and added the entry to my fstab.
apparently hal discovers usb later than the kernel's initial mount -a command in called.


--empthollow
Check out my Arch based live distro http://fluxcapacity.99k.org

Offline

Board footer

Powered by FluxBB