Mount CIFS Share on Vera Edge?

Sorry missed that

Assuming you can ping the IP from your vera?

And you’ve tried mount -t cifs -o username=,password=, vers=2.0 //[IP]/VeraLogs /VeraLogs
?
With the same result?

Have you got smbclient installed? That may give some more troubleshooting options.
Also (daft idea) has the Windows box been rebooted recently?

C

Thanks for helping me troubleshoot:

[code]root@MiOS_VERA:~# mount -t cifs -o username=,password=, vers=2.0 //[IP]/VeraLogs /VeraLogs
BusyBox v1.19.4 (2016-11-29 21:02:24 EET) multi-call binary.

Usage: mount [OPTIONS] [-o OPTS] DEVICE NODE

Mount a filesystem. Filesystem autodetection requires /proc.

    -a              Mount all filesystems in fstab
    -i              Don't run mount helper
    -r              Read-only mount
    -w              Read-write mount (default)
    -t FSTYPE       Filesystem type
    -O OPT          Mount only filesystems with option OPT (-a only)

-o OPT:
loop Ignored (loop devices are autodetected)
[a]sync Writes are [a]synchronous
[no]atime Disable/enable updates to inode access times
[no]diratime Disable/enable atime updates to directories
[no]relatime Disable/enable atime updates relative to modification time
[no]dev (Dis)allow use of special device files
[no]exec (Dis)allow use of executable files
[no]suid (Dis)allow set-user-id-root programs
[r]shared Convert [recursively] to a shared subtree
[r]slave Convert [recursively] to a slave subtree
[r]private Convert [recursively] to a private subtree
[un]bindable Make mount point [un]able to be bind mounted
[r]bind Bind a file or directory [recursively] to another location
move Relocate an existing mount point
remount Remount a mounted filesystem, changing flags
ro/rw Same as -r/-w

There are filesystem-specific -o flags.

root@MiOS_VERA:~#
[/code]

I assume its showing me options to say i wrote something wrong?

Haven’t rebooted manually for a year at least, but windows update roams free on that computer, so it probably did…

Rebooted now, didn’t help. :\

[quote=“Forzaalfa, post:42, topic:185496”]Thanks for helping me troubleshoot:

[code]root@MiOS_VERA:~# mount -t cifs -o username=,password=, vers=2.0 //[IP]/VeraLogs /VeraLogs
BusyBox v1.19.4 (2016-11-29 21:02:24 EET) multi-call binary.

Usage: mount [OPTIONS] [-o OPTS] DEVICE NODE

Mount a filesystem. Filesystem autodetection requires /proc.

    -a              Mount all filesystems in fstab
    -i              Don't run mount helper
    -r              Read-only mount
    -w              Read-write mount (default)
    -t FSTYPE       Filesystem type
    -O OPT          Mount only filesystems with option OPT (-a only)

-o OPT:
loop Ignored (loop devices are autodetected)
[a]sync Writes are [a]synchronous
[no]atime Disable/enable updates to inode access times
[no]diratime Disable/enable atime updates to directories
[no]relatime Disable/enable atime updates relative to modification time
[no]dev (Dis)allow use of special device files
[no]exec (Dis)allow use of executable files
[no]suid (Dis)allow set-user-id-root programs
[r]shared Convert [recursively] to a shared subtree
[r]slave Convert [recursively] to a slave subtree
[r]private Convert [recursively] to a private subtree
[un]bindable Make mount point [un]able to be bind mounted
[r]bind Bind a file or directory [recursively] to another location
move Relocate an existing mount point
remount Remount a mounted filesystem, changing flags
ro/rw Same as -r/-w

There are filesystem-specific -o flags.

root@MiOS_VERA:~#
[/code]

I assume its showing me options to say i wrote something wrong?

Haven’t rebooted manually for a year at least, but windows update roams free on that computer, so it probably did…

Rebooted now, didn’t help. :[/quote]

Lose the space before ‘vers’

mount -t cifs -o username=,password=,vers=2.0 //[IP]/VeraLogs /VeraLogs

No promises…

Also try vers=1.0 and 3.0

C

vers=1.0 was the only one i didnt get “invalid argument” on, and it still reports “host is down”… Mabye windows needs a newer version thats not supported by the mios package?

Windows 10 does not support SMB 1.0 by default. So yes, looks like you have the option to enable / install 1.0 on the Windows 10 box, or find another mount :frowning:

C

So theres no way to get the vera up to 2.0 at least?

I have no idea, chap but I suspect that Mios is running a rather old version of OpenWRT so it’s maybe not likely?

But, have a look here…

C

So, to sum this up, theres no way to mount a windows disk without opening for SMB 1.0, which has some security issues.
Is this by any chance improved in 7.29?

Is there a way to do this without risking a too open network? I don’t know much about this, i must admit…

You’re just trying to get to your logs folder? Right?

So two other approaches spring to mind:

  1. Share it from Vera and mount it on the windows box
  2. Simply sftp your logs to your windows box. You’ll need to run some kind of SFTP server but the editing of the files on the Vera is quite simple

Wither of those appeal?

C

Currently i’m just moving them over with WinSCP, ideally i want this to happen automatically, so i can have something automatically parse it on the other end for display or analysis…

So if you can use SCP you can use SFTP (I’d have thought)

Bit of a drag but you need to edit two files and then make sure you unit is set to archive your old logs to Mios
/etc/cmh/servers.conf

The section you’re looking for is

Log

Server_Log=$yourIPaddress

#Server_Log_Alt=oem-log4.mios.com

Use_Server_Log_Alt=0

Server_Log_User=$yourscpusername

Server_Log_Pass=$yourscppassword

Then

go into /usr/bin

mv Rotatelogs.sh Rotatelogs.orig
cp /mios/usr/bin/Rotate_Logs.sh /usr/bin

Then edit /usr/sbin/Rotatelogs.sh

These two lines:
log “Sending file with CMD: curl -s -S -f --connect-timeout 60 --max-time 300 -u "$ftpUser:$ftpPass" -T "${logFile}.gz" "ftp://$ftpServer/**$yourpath**/${pkap}/${pkap}_$(echo $logFile | awk -F ‘/’ ‘{print $NF}’).gz"”

curl -s -S -f --connect-timeout 60 --max-time 300 -u “$ftpUser:$ftpPass” -T “${logFile}.gz” “ftp://$ftpServer/**$yourpath**/${pkap}/${pkap}_$(echo $logFile | awk -F ‘/’ ‘{print $NF}’).gz” 1>>$log_file 2>&1

That should autorotate your logs to the SCP server and there you are

C

1 Like

Very interesting!

SFTP, same as SSH, right? I’ve used putty plenty of times, but the unix world is still a foreign place for me (raised on microsoft machines)…

I’ll have to look into this, thanks for the input so far!

Not quite the same under the hood (SFTP uses an SSH tunnel to transfer data as opposed to un-encrypted), but the commands and syntax are very similar indeed.

(Always a good idea to copy the original files. I tend to copy them to $filename.xxx.orig So I can go back a know good state)

Best of luck

C

After giving up on this a while back. I just wanted to add a post here to say that it is still possible to mount an external share to your Vera (although keep in mind anything done via ssh etc is done at your own risk).

I can’t confirm exactly the steps I took, as I’ve just picked this back up again, but if it helps I can confirm, after doing an opkg update, if I run this command.

opkg install kmod-fs-cifs kmod-nls-base kmod-nls-utf8 kmod-crypto-hmac kmod-crypto-md5 kmod-crypto-misc cifsmount

It responds back with the following information.

Package kmod-fs-cifs (3.10.14-1) installed in root is up to date.
Package kmod-nls-base (3.10.14-1) installed in root is up to date.
Package kmod-nls-utf8 (3.10.14-1) installed in root is up to date.
Package kmod-crypto-hmac (3.10.14-1) installed in root is up to date.
Package kmod-crypto-md5 (3.10.14-1) installed in root is up to date.
Unknown package 'kmod-crypto-misc'.
Unknown package 'cifsmount'.
Collected errors:
 * opkg_install_cmd: Cannot install package kmod-crypto-misc.
 * opkg_install_cmd: Cannot install package cifsmount.

I then ran the following just to see what’s there already …

df-h

Next I created the directory Where I want the mount to be, I called mine NAS as that’s what I’m connecting to.

mkdir /mnt/nas

and finally after that, I ran the mount command

mount -t cifs //192.168.1.227/Public /mnt/nas -o user=admin,password=password123

running df-h again I can see the share mounted and can navigate to it.

Filesystem                Size      Used Available Use% Mounted on
rootfs                   10.6M      1.0M      9.6M  10% /
/dev/root                 8.0M      8.0M         0 100% /rom
tmpfs                   124.3M      4.8M    119.5M   4% /tmp
/dev/mtdblock6           10.6M      1.0M      9.6M  10% /overlay
overlayfs:/overlay       10.6M      1.0M      9.6M  10% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock10          50.0M     12.0M     38.0M  24% /storage
/dev/mtdblock10          50.0M     12.0M     38.0M  24% /etc/cmh-firmware
/dev/mtdblock10          50.0M     12.0M     38.0M  24% /etc/cmh-backup
/dev/mtdblock9            9.8M      9.8M         0 100% /mios
/dev/mtdblock10          50.0M     12.0M     38.0M  24% /etc/cmh-ludl
/dev/mtdblock11          19.3M      1.0M     18.2M   5% /ezmi
/dev/mtdblock11          19.3M      1.0M     18.2M   5% /etc/cmh
//192.168.1.227/Public
                          2.7T      2.2T    501.2G  82% /mnt/nas

Hope this is of interest…

1 Like