Often users who dual-boot want to be able to access information across partitions. For example, documents stored in a Windows partition while working in Ubuntu. This is a simple task for things like documents, but for files that are organized into a library, it is a more difficult task. Music libraries are one example of this. This tutorial explains how to set up Rhythmbox to successfully use your existing music library on another partition in order to avoid file duplication and unnecessary maintenance.
First you'll need a constant location for your non-active partition so that Rhythmbox can rely on an unchanging filepath for its music. In this example, we'll use /mnt/sda1 (assuming the non-active partition is sda1 - modify as needed):
sudo mkdir /mnt/sda1
Next, we'll make a file that will be executed on startup. Put the following two commands as the first two lines in the file (save it wherever you want for the time being) so that we don't have to manually mount the partition every time we log in:
sudo umount /dev/sda1 sudo mount /dev/sda1 /mnt/sda1/
After this command executes on startup, the entire file tree of your non-active partition will be available in /mnt/sda1/ as if it were part of your normal filesystem.
By default, Rhythmbox stores your music library in ~/Music/. There's no need to mess with this. However, we do need a folder inside of ~/Music/ to hold the library of the non-active partition (if this sounds confusing, don't worry - it will make sense shortly). We'll use "OtherOS" for this purpose:
Now comes the key step. In order for Rhythmbox to be able to maintain its own music library and still see the library on the non-active partition all in the same directory, we'll need to do a bind. Binding creates a portal of sorts that mounts a folder somewhere else in the filetree so that its contents are accessible from multiple locations. We want to bind the non-active partition's music folder to the folder ~/Music/OtherOS so that Rhythmbox sees both its own music and the music of the non-active partition all in the same place (this should be the third line of the file):
sudo mount --bind /mnt/sda1/.../MusicFolder/ ~/Music/OtherOS/
Now we have to do a little bit of system stuff. First we need to copy the file into /etc/init.d/ (you'll need root permissions for this). After this is done, execute the following commands to allow the file to be executed and to place it in the startup sequence:
sudo chmod +x /etc/init.d/FILENAME sudo update-rc.d FILENAME defaults
Now if you navigate to ~/Music/OtherOS/, you'll find the music files from your non-active partition. The last step is simply to make sure that Rhythmbox is set to keep its library in ~/Music/, and you're good to go! In fact, as soon as it's set up and everything's mounted (you may have to restart), you'll see Rhythmbox start to import all of your music automatically.