Wednesday 19 November 2014

Eyepiece - Part 3 - Where , oh where has my remote drive gone?

After two days of struggling to get the Raspberry Pi to log in automagically, to set up user accounts, to set up remote desktop access, disabling the screen saver and to try to get the camera working (even though is seems to be dead), it was time to get the computer to mount some network shared directories into the local file system.

I can do this in Windows in my sleep.

Seemingly, others can do this in Linux, in their sleep.

I ended up cheating.

After a day of fiddling with the settings inside the operating system (which requires hunting for all manner of different text files to edit), I could manually mount those directories wherever I wanted, just not automatically at boot-up.

Now, in Linux, when you attach a network share to your system, it gets linked into an empty directory (folder) that exists in the file system.

The command is:
mount.cifs {where from} {where to} -o {options}
Which worked fine. You can also tell the operating system to attach some remote directory to the file system - but if it can't do it, the entries are deleted, although you can tell it to mount them 'later', when mounting them becomes this command:
mount -a
Much easier, and again it works, but not automatically.


After trying all of the dozen or so methods of getting those remote shares to mount without human intervention, I gave up and cheated.


I wrote a script (a DOS Batch file) that starts a remote console (text only) session, logs in and does the job, it then closes the session and terminates itself. I also did the same thing to restart and shut down the Pi.


Happily, this isn't an issue, since the machine will always be run from another computer, I will set it up so that the main computer performs those tasks routinely itself.


eyepiece.bat
"C:\Program Files (x86)\PuTTY\putty.exe" -load M55 -l root -pw passwd -m mount.sh

"C:\Program Files (x86)\Xming\Xming.exe" :1 -terminate -clipboard  -query 192.168.1.72
 And the mount.sh script
#!/bin/bash
mount -a
exit 0
Now, all I need to do is do the whole thing over again with a clean install of the latest version of Raspbian from the Raspberry Pi site.

For more information on the Raspberry Pi ...
http://www.raspberrypi.org/

Next: Building from a clean install.

No comments:

Post a Comment

Comments and suggestions are warmly welcomed.