Monday, 8 November 2010

Revisiting Rhythm

Following my post about repairing my Rhythmbox library, a friend of mine over at Delliberate suggested that a better way of achieving my goal was to mount my network drive as a permanent Windows share on my Ubuntu box.

I've struggled with this for over a week, trying to get Ubuntu and Samba to play nice with Netbios names (clearly, using the IP address to establish the mount defeats the object!) but eventually had to acknowledge that the problem was better than I! Nautilus connects to my network drive using the ip address without any difficulty, all that is required is to type the ip address of the drive followed by the share name into the location dialog box in Nautilus using:

smb://###.###.###.###/share_name

Where ###.###.###.### is the ip address for the drive and share_name is the name of the directory (or folder) that you want to reach. Instructions for creating a permanent mount point can be found at the Ubuntu Wiki (here) and, if you can't get Ubuntu to resolve Netbios names, you can substitute the ip address for the server name.

However, today I found a workaround that, whilst it doesn't completely solve the problem of Netbios resolution, does provide a partial solution. You can add the Netbios name to the /etc/hosts file and Nautilus will use this to resolve the ip address to the device name. Open the /etc/hosts/ file:

sudo gedit /etc/hosts

and input your password when prompted. Add the ip address and the Netbios name as follows:

###.###.###.### Netbios_Name

My file output looks like this:

127.0.0.1 localhost
127.0.1.1 jogga-desktop
192.168.1.10 MYBOOKWORLD
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


Line 3 is the one of interest! If I've understood how this works properly, Nautilus uses the etc/samba/smb.conf file to resolve Netbios names (in a specific order): the smb.conf file specifically lists the host as a reference source. Now I can use the Netbios name rather than the ip address which is more intuitive when searching and browsing in Nautilus. In my case, I type:

smb://MYBOOKWORLD/Share_Name

I also had to change the /etc/fstab file in order to make the permanent mount resolve the MYBOOKWORLD name as per the instructions at the Ubuntu Wiki (linked above).

Of course, if the ip address changes, the workaround stops working! However, it's a simple matter to amend the /etc/hosts file to reflect the new ip address and all bookmarks that use the Netbios name should be restored to rude health!

There are some tangible benefits of mounting a network share at boot, not least, pictures and video render in Nautilus (as opposed to icons), making file identification much easier, so it's been worth the pain.

No comments:

Post a Comment