INSTALL ENTWARE ON WD MY CLOUD HOME (SSH ACCESS, NFS SERVER, OPKG install packages)

Yes, sure.

Create your samba users in /opt/etc/passwd (NOT in /etc/passwd) using adduser, then add them to the samba password file /opt/etc/samba/smbpasswd using the /opt/sbin/smbpasswd command.

Good practice is to have a group for your samba users defined in /opt/etc/group

root:x:0:root
nobody:x:99:
smbusers:x:2000:

then something like:

adduser -HD -u 2021 -G smbusers -g "Audio book player client userid for SMB" -s /dev/null audiobooks smbusers
smbpasswd -a audiobooks

Here is my /opt/etc/samba/smb.conf

[global]
	netbios name = mynas
	server string = WD NAS
	workgroup = WORKGROUP
	browseable = yes
	deadtime = 30
	domain master = no
	encrypt passwords = true
	enable core files = no
   	log level = 1
	local master = yes
	load printers = no
	map to guest = Bad User
	max protocol = SMB2
	min receivefile size = 16384
	passdb backend = smbpasswd
	printable = no
	security = user
	smb passwd file = /opt/etc/samba/smbpasswd
	socket options = TCP_NODELAY IPTOS_LOWDELAY
	syslog = 2
	use sendfile = yes
	writeable = yes
	ntlm auth = yes

[Music]
path = /data/wd/diskVolume0/fileshares/Music
writable = yes
browseable = yes
create mask = 0640
directory mask = 0750

[Videos]
path = /data/wd/diskVolume0/fileshares/Videos
writable = yes
read list = player
browseable = yes
create mask = 640
directory mask = 0750

[Audio]
path = /data/wd/diskVolume0/fileshares/Audio
writable = yes
read list = player
browseable = yes
create mask = 640
directory mask = 0750

[Photos]
path = /data/wd/diskVolume0/fileshares/Photos
writable = yes
read list = player
browseable = yes
create mask = 640
directory mask = 0750

[Documents]
path = /data/wd/diskVolume0/fileshares/Documents
writable = yes
browseable = yes
create mask = 640
directory mask = 0750

I just got the same error with dropbear keys as @Antonin_Fischer on setting up my second MCH. The two key files had zero length. I’m still trying to work out why and this didn’t happen on my first MCH - strange!. Anyway, I was able to generate them as follows:

/system/bin/mount -o rw,remount /
/system/bin/mount -o rw,remount /system
rm /opt/etc/dropbear/dropbear_rsa_host_key
rm /opt/etc/dropbear/dropbear_ecdsa_host_key
/opt/bin/dropbearkey -t rsa -f /opt/etc/dropbear/dropbear_rsa_host_key
/opt/bin/dropbearkey -t ecdsa -f /opt/etc/dropbear/dropbear_ecsda_host_key

and then

/opt/etc/init.d/S51dropbear start

worked as it should

Many thanks Kryten! According to your samba configuration and users, the samba works very good and transmission is 25 MB/s. It is not best but it is useful now.
I already opened possibility to use symlinks to the internal storage of Plex folder. So, samba can access and write to the internal part of plex.

[global]
...your configuration...
unix extensions = no

[Plex]
path = /data/wd/diskVolume0/fileshares/Plex
writable = yes
browseable = yes
follow symlinks = yes
wide links = yes
create mask = 640
directory mask = 0750

where the /data/wd/diskVolume0/fileshares/Plex is symlink to Plex → /data/wd/diskVolume0/data/com.plexapp.mediaserver.smb/auth0XYZ/Plex

In addition, the correct rights have to be applied to symlink only. It means to use parameter -h:

chown -h videos:smbusers /data/wd/diskVolume0/fileshares/Plex

Samba works correctly for all OS now :wink:

1 Like

I found some problem.
If I check mounted points by df -h, I have there many lines and grows up, after some time the system is restarted. Very bad.

/dev/block/sataa22 1.9G 364.7M 1.5G 19% /opt
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /data/entware.arm
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /opt
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /data/entware.arm
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /opt
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /data/entware.arm
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /opt
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /data/entware.arm
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /opt
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /data/entware.arm
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /opt
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /data/entware.arm
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /opt
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /data/entware.arm
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /opt
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /data/entware.arm
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /opt
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /data/entware.arm
/dev/block/sataa22 1.9G 364.7M 1.5G 19% /opt

Do you have some idea how to check which part can add these mappings?

Hi Kryten,
I found the problem in your samba start script. It seems that this script is started in some planned tasks of OS. Because this script is call in regular intervals: /system/bin/start_samba.sh

I add this part to the script. And the mounting cycling problem disappear. Maybe we have to check how the start script is handled by system. The system is without random restarts now.

#! /system/bin/sh

if mount | grep /data/entware.arm > /dev/null; then
  echo "entware already mounted."
else
  unset LD_PRELOAD
  unset LD_LIBRARY_PATH
  sleep 3
  /system/bin/mount -o rw,remount /
  sleep 1
  /system/bin/mkdir /opt
  /system/bin/mount -o ro,remount /
  sleep 3
  /system/bin/mount -o bind /data/entware.arm /opt
  sleep 2
  /opt/etc/init.d/rc.unslung start
  sleep 2
fi

function start_samba()
{

    #Start smbd with fail-retry once
    count="0"
    while [ $count -le 1 ]
    do
        smbd_pid=`ps | grep smbd | busybox awk '{print $2}'`
        if [ -z "$smbd_pid" ]; then
            echo "starting smbd daemon"
            rm -f /data/wd/samba/var/run/samba/smbd.pid
            /opt/sbin/smbd -D
        else
            echo "smbd_pid is $smbd_pid"
            break
        fi
       count=$((count+1))
    done

}

PLATFORM=`getprop ro.hardware`
if [ "$PLATFORM" != "yoda" ]
then
        start_samba
fi

Hi Antonin,

That script is not one of mine. My method is to use a one-time only hack on startup as described here.

I think that the reason you are getting multiple mounts is because you are using the WD samba script (/system/bin/start_samba.sh) and not the entware one (/opt/etc/init.d/S08samba start). You are right that it gets run regularly. This is because android has something called the services manager which runs continuously to check the status of all services including its own samba, which it restarts using the app manager.

This is not a good state of affairs for us hackers because we lose control of an OS we’ve bent to our needs instead of accepting the packaged product. My solution is to stop the services manager, the app manager and lots of other things from running as soon as the system starts and assume control via the entware startup script. This means a little extra work but it also means no surprises! For example, if we don’t stop the otaclient (also started and monitored by the services manager) our NAS will try to do updates and quite possibly obliterate our hard work.

1 Like

So when I connected the drive to ubuntu I was seeing two system partitions, flagged as system and system1. I’ve made the changes to build.prop on system1, deleted disable_adb and created enable_root files. Adb works ok, I can adb the ip address and adb root, but getting error: device ‘(null)’ not found. What could be the problem?

Okay, I got this sorted. I had to start an adb session, connect to [ip address] and root.Trying to start a shell at this point gets the “device not found” error. Root permissions stay active when a session is killed so I start a new adb session connect to ip address and then shell works.

Ok, I’ve got root access and shell access. I’ve gotten as far as installing nano, but when I enter nano /opt/etc/services I get an error" /system/bin/sh: nano: not found". When I run the install nano command again I get “Package nano (4.2-1) installed in root is up to date”.

I’m guessing that I’m currently in the wrong directory for the nano command, but as nano is a text editor shouldn’t it be available as a command from the root directory?

Well it seems nano hasn’t been installed in the root directory, judging by this directory list.

Hello, i don’t get this part " Once the disk out of the box, connect it in sata on the pc ubuntu ."

do i just attach it to my computer via sata and install like ubuntu om the MCH disc or how do i do it ?

would this enable FTP access for My Cloud Home. My application requires only FTP and not SFTP. Any kind soul able to guide me on enabling FTP access. ie packages to install? thanks.

This directory lists the packages available in the entware distribution discussed above

http://bin.entware.net/aarch64-k3.10/

Searching the list for “ftpd” will show you a number of ftp servers that you can install.

You need to boot ubuntu on your PC (easiest is from a USB stick image - see ubuntu docs on how to do this). Attach the MCH disk to SATA and you will be able to mount and modify it as described above.

Do NOT try to install ubuntu onto the MCH disk itself!

@Kryten I am able to install proftpd. However I am not sure how to configure and create users and passwords for access. Could you kindly guide me in this.

Thank you.

Hi @larryboylow. I’ve not installed any ftpd servers in my MCHs, but I can make suggestions based on my use of other packages. The crucial thing to remember is that if your users are listed in the filesystem (rather than an SQL database or via RADIUS or other) use password files in /opt/etc and not in /etc because entware puts everything under /opt.

From this doc it looks like you have a big choice of authentication sources for ProFTPD

http://www.proftpd.org/docs/howto/Authentication.html

but I’m guessing you will probably go for the AuthUserFiles option described here:

http://www.proftpd.org/docs/howto/AuthFiles.html

I followed instructions and got till part where I need to connect wtih putty… I just get “connection refused” when trying to connect… what should I do? I did install busybox, entware and dropbear…

edit: solved this also, with post from Kryten from August 4, post 82 I think

how do I do that?

edit: nvm I figured it out :stuck_out_tongue: “/opt/sbin/adduser” instead of just “adduser”

new problem, samba is up and running, I can connect from windows and android, browse and read/play works just fine but if I copy file from windows to nas it will show that data is being written like usual but all files will have size 0 bytes… and when copying from android to nas it works just fine… using same login credentials… can anyone help?

HI,

when i put the hdd under linux, i can see the sdb with 24 partitions

but even with the mdadm command, i catn mount the system partition (sdb19)

Does one have found a solution to mount that partition ?

are you sure you are looking at right partition? system partition in my case was one of about 800MB size and 500MB used