On 23/07/17 20:02, Jan Ritzerfeld wrote:
Am Sonntag, 23. Juli 2017, 18:08:07 CEST schrieb gumb:
Is there a system-level configuration for logging in anonymously to a samba share at start-up? And one that would fail silently if I have the drive unplugged or I add the same configuration to my laptop?
Maybe, see below.
As for adding the external drive to my fstab via smb://192.168.0.254, aside from being not quite sure how to configure that line,
Never did this but, if AV Linux uses systemd, I assume something like that (in one line): //192.168.0.254/media /{existing path where to mount} guest,noauto,x- systemd.automount,x-systemd.idle-timeout=60,nofail 0 0
I added the "guest" option to mount it without asking for a password (man mount.cifs). The other options are explained in "man systemd.mount".
I'm not sure I want it. My main machine is a laptop with docking station. When I take the laptop elsewhere it would necessitate having the fstab line set to noauto, but then that seems to invalidate any worth of having it in the fstab.
Exactly, but systemd can mount your share only when needed and will automatically unmount it if you don't use it anymore by the following fstab options: noauto,x-systemd.automount,x-systemd.idle-timeout=60,nofail
However, if AV Linux does not use systemd or you don't want to edit your fstab, use the old autofs/automount. Install autofs and add at the end of /etc/auto.master: /{existing base path for all mounts} /etc/auto.cifs --timeout 60
Then, create /etc/auto.cifs with the following content: media -fstype=cifs,guest ://192.168.0.254/media
"/etc/init.d/autofs reload" and you should be able to browse to /{existing base path for all mounts}/media
I had to put all this aside for a while, but have run up against other issues since my last posts. Having never attached any storage to a network previously, I'd never even given a moment's thought to how it would work regarding file ownership and permissions. I believe I last copied the music collection onto the drive via FTP. I hit a snag when I tried to save a playlist in Clementine by overwriting one already existing in the Playlists folder on the network drive. Though there was no error message, I could see in the file manager that the file wasn't being modified. After playing around a bit I found I could save it in the root directory of the attached drive but not in the music collection folder. Initial examinations weren't aided by Thunar merely showing all ownership as being 'root', which when examined later on my openSUSE box proved to be incorrect. The files and directories created by the router have user and group ownership of 'freebox', and UID/GID of 4242. However, the music collection that I copied over with FTP has ownership by my regular username and UID of 1001 (common on both connected PCs). I feel like I'm opening up a whole new can of worms with this. I've tried reading wiki pages on CIFS and I still haven't the froggiest what's what with that and Samba, etc. It's all new to me. I tried adding the drive to the fstab using a modified version of the line advised above, in this case: //192.168.0.254/media /home/media ext4 noatime,guest,user,noauto,x-systemd.automount,x-systemd.idle-timeout=60,nofail 0 0 I don't know if any of those options are contradictory or extraneous. In any case, a new device appears in the Dolphin Places panel: media on 192.168.0.254 but when I click on it, nothing happens. The drive doesn't seek or respond. No error message, nothing. I added a different line on the other machine as I'm not sure about its systemd status: //192.168.0.254/media /home/media ext4 noatime,guest,user,noauto,nofail,_netdev 0 0 Again, I couldn't access it. I had to use the smb/ftp entries I'd previously created in Thunar. Amongst my web searches I stumbled upon this random page: https://wiki.ubuntu.com/MountWindowsSharesPermanently I see there it shows an fstab line where 'ext4' is replaced by 'cifs'. Is this what is considered the 'old' (pre-systemd) way of doing things, related to the autofs method mentioned above? I'm rather reluctant to do anything by an 'old' method even if it still works, just for sake of not having to relearn in future as I continually upgrade and replace machines and those old methods become redundant. That page also mentions other things like the addition of uid=1001 to the fstab line, but I don't know if that's what I should be trying to do. Should I be attempting to leave the 'freebox' ownership and permissions of all files as they are and always log in anonymously as a guest, or should I be trying to set it up so that everything has my ownership and ID? I'd have thought the latter, bearing in mind I will sometimes unplug the drive to take it with the laptop elsewhere, and so perhaps I should forget anonymous login and set my regular PC login username and password here? http://paste.opensuse.org/6604f82a However, the freebox will likely insist upon its own ownership for folders relating to other integrated functions like the TV recording and downloads. Perhaps the two methods can coexist. Just to throw a spanner in the works, it looks like I've got to zap the partition and start all over again. All my fault. Last weekend whilst exploring all the freebox's options, I configured a folder for recording TV programmes and thought I'd set a test recording of something on later in the week. Thursday night I came in from work, tired, saw the hard drive light flashing continuously, the drive spinning round and feeling a bit hot, and panicked, completely forgetting I'd set that programme to record. I couldn't find any way to unmount or disengage the drive from the FreeboxOS or the router's front panel, it said some process was using the drive and I couldn't trace what. After twenty minutes of worrying my drive was soon going to be worn out I pulled the plug. Five seconds later, I remembered about the TV programme :( Result: the router now complains about the drive being unavailable. All verifications of the partition fail. I've looked at it plugged in directly to the PC, checked all hidden files, erased the two relating to the half-recorded programme, confirmed there's absolutely nothing else on there. But still it doesn't want to know any more. I've restarted the router in safe mode, done everything I can. Something's irreversibly corrupted, even though all the files are intact. Will have to reformat the partition, for the fourth time. But before I copy everything over again, I should figure out the implications of file ownership. gumb -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org