====== How to add samba to voyage 5.2 ====== Well, this might seem very easy, but there are some things you have to consider...or find out once you installed and things are not nice as they were before. The first step is very easy. Login as root and type apt-get install samba Samba is installed, init scripts are added. Go edit the config file (/etc/samba/smb.conf) and you are done! Maybe!! More likely you're far from done. There are a number of problems to solve (although everything might look and work fine until you reboot) - given the nature of voyage, you probably are sharing something on an attached usb drive - the init scripts are not perfectly ordered... - some files need to be accessible from smbd: their default locations are /var/lib/samba and /var/cache/samba/printing - samba logs stuff. Make sure that's fine also. Let's see these points in detail: ==== 1. USB share + 2. init scripts ==== So what's the problem here? The problem is that an usb drive will not mount at the same time as other "local" drives. It's slow. In other words even a perfect insertion in /etc/fstab will not work, the drive will not mount at boot time, so samba will share something not really there. **Solution:** make sure the init scripts (look in /etc/rc1.d and /etc/rc2.d) show the file S**XX**samba with a high XX number (around 90 is good). Moreover, copy the mountall.sh in /etc/init.d/ to /etc/init.d/mountusb.sh. Then change the line inside with the "mount -a -t ..." so that it says "mount -a" and stop. Save. (If you don't like that, give it the exact parameters to just mount your usb drive(s).) When done, link to this script from /etc/rc2.d with something like ln -s /etc/init.d/mountusb.sh S98pleasemountnowcomeon Then reboot and see if it automounted. It should... ==== 3. smbd complains about file access + 4. logs ==== Being a readonly filesystem, those files which are frequently accessed (for writing also) need to be on a partition other than the readonly one. Voyage does that by using /ro and /rw. The content of /ro is mounted as /rw at boot time. So e.g. all log files are already there. Moving other files to this partition is easy. You do: remountrw (allows to make changes to the root file system in first place) cd /ro mkdir -p var/cache/samba mkdir var/lib/samba (this created the new homes for the files. Now copy them over) cp -r /var/cache/samba/printing /ro/var/cache/samba/ cp -r /var/lib/samba/* /ro/var/lib/samba/ (now let's go to the originals and replace them with links) cd /var/cache/samba rm -rf printing ln -s /rw/var/cache/samba/printing printing cd /var/lib/ rm -rf samba ln -s /rw/var/lib/samba samba (please note that the links go to /rw/.. although there's nothing there yet. Stuff will be copied on next reboot) Note that if you don't care about printing, you may remove those steps from above, but you'd also have to remove the printing shares from smb.conf. Also note that the directory /var/lib/samba (which contains secrets.tdb among others) could be moved by adding a line like private dir=/path/of/writable/drive to smb.conf. But then again, you could have troubles with drives not being ready at the right time. You avoid such issues with the method shown above. You should be fine now...and your samba also. Last note: another consequence of a not-well-configured samba installation is that your cf card/partition may have stopped mounting readonly. The cause is connected with the ones above. Once you solve those, voyage will nicely mount ro again. Also "/ is busy" when switching back should be solved now - or, at least - not depend on samba any more! (r)ickx