You are not logged in.

#1 2013-10-06 14:09:46

hamsolo474
Member
Registered: 2013-10-05
Posts: 1

Dualboot single music library

I have a 200gb music collection and a 1tb hard drive in my laptop I'm dual booting Arch alongside Windows 7 (which I only use for games) and my goal was simple I just wanted to be able to listen to my music in both Arch and Windows without redundancy eating almost half my hard drive.

AFAIK Windows has no support for reading ext, much less btrfs so I put all my music on to my ntfs partition. As you all likely know there is no way to take ownership of an ntfs mount so for this you will need to run mpd as the root user either with sudo or by setting it to run as a system service, I cover the latter in this guide.

At the end of this guide you should have mpd run as a the root user on boot reading its music from the automatically mounted ntfs partition while remaining controllable by a non root user.

1. Auto-mount ntfs partition
2. Get mpd to run as root and output over the network
3. Tell pulseaudio to expect music over the network
4. Get mpd to start automatically on boot as root

1. Auto-mount ntfs partition
    Make sure all your music is on your ntfs partition/drive.
    Make a mountpoint for the ntfs drive I made mine at /windows/c
    sudo mkdir -p /windows/c

    Use lsblk to view your currently connected block devices and find your ntfs part/drive the part i wanted was sda2

    sudo mnt -r /dev/sda2 /windows/c
    once you have mounted the ntfs part cd into the mountpoint and look around, verify this is the partition you want

    I added this line to my /etc/fstab, if this doesnt work for you but manually mounting it does work then you may want to use findmnt to get the options that work for you
    /dev/sda2               /windows/c    ntfs        ro,relatime,uid=0,gid=0,fmask=0177,dmask=077,nls=utf8,errors=continue,mft_zone_multiplier=1

2. Get mpd to run as root and output over the network
    make sure your /etc/mpd.conf (more so than your ~/.mpdconf if you are going to start mpd as a service) looks like this
    music_directory     "/windows/c/Users/Public/Music"
    user                "root"
    port                "6600"
    bind_to_address     "0.0.0.0"
    audio_output {
        type            "pulse"
        name            "mpd pa output"
        server          "127.0.0.1"
    }

3. Tell pulseaudio to expect music over the network
    then go into your /etc/pulse/default.pa (or ~/.config/pulse/default.pa if it exists) and look for this line, you may need to add the end of it
    load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1

4. Get mpd to start automatically on boot as root
    run mpd as a service
    sudo ln -s /usr/lib/systemd/system/mpd.service /etc/systemd/system/multi-user.target.wants/mpd.service
    sudo systemctl enable mpd
    sudo systemctl start mpd
    reboot

Offline

#2 2013-10-06 14:19:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Dualboot single music library

hamsolo474 wrote:

As you all likely know there is no way to take ownership of an ntfs mount

I didn't know that, because it is not true.  I read/write ntfs partitions just fine as a regular user.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2013-10-06 14:24:29

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Dualboot single music library

If I get it right, it's similar to https://bbs.archlinux.org/viewtopic.php?id=170847

man mount wrote:

Mount options for ntfs

<snip>

       uid=value, gid=value and umask=value
              Set  the  file permission on the filesystem.  The umask value is given in octal.  By default, the files are owned by root and not readable by
              somebody else.

Offline

#4 2013-10-06 14:35:15

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Dualboot single music library

Welcome to Arch, hamsolo474.  It's cool to see that you're willing to jump right in and contribute something to the community, but there are a few things to point out; please don't take this as discouragement.  First, the information in your post is the sort of thing wikis were made for; the "Community Contributions" subforum is more for outside  projects members feel would benefit the community, i.e. new software witten by Archers or Arch-specific guides and websites.

Next, to add to what Trilby pointed out:
- What's this "mkdir /windows/c" business? If one created an NTFS partition dedicated to music, one could simply mount it in fstab at boot, binding it to a user directory, and be done with it.
- The specific settings used by MPD shouldn't be affected by the type of filesystem the music is stored on; that is, the information on how to set up MPD is superfluous, as it can already be found in the MPD page of the Arch Wiki.
- Your guide assumes the user is running PulseAudio; many of us are not.

Offline

Board footer

Powered by FluxBB