LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to mount or access WD My Book via network? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-mount-or-access-wd-my-book-via-network-573141/)

chakatz 07-29-2007 08:07 AM

How to mount or access WD My Book via network?
 
Hi,

I have a Western Digital My Book World Edition external storage drive. The version I have has a GB Ethernet network connection. I would like to access it from Linux but so far have had only limited success. I have been able to use SMB to access the Public directory but not any of the Private directories that I have created from the Windows Client. Also, I would like to be able to mount the drive with a faster transfer rate protocol, perhaps NFS. Any ideas, experience or links regarding MyBook Ethernet access?

Thanks

Chakatz

camorri 07-29-2007 08:23 AM

NFS is a client - server arrangement. Is the device a NFS server? If yes, you can install the client on liuux, export the shares, and mount them in a directory of choice.

It sounds like this device supports windoze file sharing. Samba client should be able to see anything a windoze machine can see.

For the private shares, I would assume this has a user and password to protect it? Does it send a request to the linux client for a user/password? Are you able to at least see the private share?

I had a look at Western Digitals site. It is running Vista.

One other thing I was wondering, WD doesn't mention the ehthernet connection. I saw USB and firewire400 and firewire800 connections. Are we talking about the same thing, or is this drive external to your windoze machine and connected through USB or firewire?

chakatz 07-30-2007 08:48 AM

Hi,

Thanks for the response. I have found out a bit more information about this device since I posted. I was able to hack into the device via ssh with the instructions from: http://martin.hinner.info/mybook/

Quote:

Originally Posted by camorri
NFS is a client - server arrangement. Is the device a NFS server? If yes, you can install the client on liuux, export the shares, and mount them in a directory of choice.

It has the /etc/exports file and the exportfs program. But it doesn't have a script for starting nfsd. I am going to have to wrestle with it for a while. I'd be glad to get some pointers on this.

Quote:

Originally Posted by camorri
It sounds like this device supports windoze file sharing. Samba client should be able to see anything a windoze machine can see.

For the private shares, I would assume this has a user and password to protect it? Does it send a request to the linux client for a user/password? Are you able to at least see the private share?

I was able to get the smb mount to work but I am not happy with the default user rights. It uses a default www-data (33) user and I want to be able to save as root or whatever. I want to do a large rsync -az to the device and the user rights are not changeable, yet. (working on that angle too)

Quote:

Originally Posted by camorri
I had a look at Western Digitals site. It is running Vista.

Not this device; it's running Linux for sure:
Quote:

uname -a
Linux MyBook 2.6.17.14 #1 PREEMPT Mon Mar 26 12:36:33 BST 2007 armv5tejl GNU/Linux
Quote:

Originally Posted by camorri
One other thing I was wondering, WD doesn't mention the ehthernet connection. I saw USB and firewire400 and firewire800 connections. Are we talking about the same thing, or is this drive external to your windoze machine and connected through USB or firewire?

It has GB Ethernet and USB built in.
Here is the product URL:
http://www.westerndigital.com/en/pro...78&language=en

This device is capable of being turned into a web server which is great because aside from serving as a backup and storage device, I have long been looking for a cheap, cool, quiet, web server device for maintaining a home based web site. I was looking for an old laptop but this is better.

Any Advice on the nfs or cifs (smb) issues I mentioned above?

Thanks again,
Chakatz

chakatz 07-30-2007 10:53 AM

BTW, In keeping with the GPL, Western Digital has made the source code of the My Book World Edition available for download on their web site.

Go here: http://support.wdc.com/download/?cxml=n&pid=30&swid=64

Chakatz

Matir 07-30-2007 11:50 AM

Very nice... I'd love to get ahold of one of those on the cheap.

camorri 07-31-2007 08:10 AM

I stand corrected on the this WD product. It seems they make different models, and this on is linux based.

I saw a forum on WD's site. Have you looked there for help with NFS? Or how to install NFSfs etc.

I hope some one else can chime in with some help. This looks like a very good product to me, if there is some way through a package manager or compiling to add necessary code customizing use.

chakatz 08-01-2007 10:28 AM

I'll take a look at the WD forums but they probably only speak MS there.

I haven't found a way to compile or add new packages... yet, but Martin Hinner has: http://martin.hinner.info/mybook/packages.php. I'll have to write and ask him how.

I was however able to get NFS working with a simple script that runs the needed dependencies in the proper order:

Quote:

modprobe nfsd
portmap
rpc.mountd
rpc.nfsd
rpc.statd
rpc.lockd
So now I have three ways to upload files to the device from Linux: scp, smb and nfs. But I still can't do rsync -az properly because it barfs about not having the authorization to do chown on the files. Is there a (cifs/smb mount or nfs mount) setting, or dir permission on the MyBook side, that will allow this? I have tried chmod 777 on the MyBook target dir and it still wouldn't allow chown. For now I just used tar to backup, no permissions issues this way.

spikesnet 08-13-2007 03:49 PM

Question, has anyone seen the source code for Martin Hinner's ssh hack? I know it's a php file you load when attempting to do a firmware upgrade and I emailed him asking for the source but got no rely.

I'm wondering if its possible he putting a backdoor in place or something like that.

Has anyone seen the source or attempted to see what the script is doing while it's running (other then creating ssh keys and enabling sshd)?

I'll have my mybook world in a few days but I'm not sure about this method of enabling sshd. It might be safer to mount one of the drives in another system and just enable sshd that way.

spikesnet 08-17-2007 08:03 AM

Quote:

Originally Posted by spikesnet (Post 2857757)
Question, has anyone seen the source code for Martin Hinner's ssh hack? I know it's a php file you load when attempting to do a firmware upgrade and I emailed him asking for the source but got no rely.

I'm wondering if its possible he putting a backdoor in place or something like that.

Has anyone seen the source or attempted to see what the script is doing while it's running (other then creating ssh keys and enabling sshd)?

I'll have my mybook world in a few days but I'm not sure about this method of enabling sshd. It might be safer to mount one of the drives in another system and just enable sshd that way.


Ok, how about this, have any of you that have used his php script hack checked your systems over to make sure everything is ok?

c123 08-23-2007 12:14 PM

Hello there,

1. has anyone looked at Martin's script or been able to get in contact with him?
2. any progress of using/install rsync? (is the my book world running a rsync daemon?)

I'm considering getting one of these things specifically to be able to use rsync to do backups (currently have a LaCie Ethernet Disk Mini V2 that works very well, but it has no rsync and is not easily hacked).

Cheers

spikesnet 08-24-2007 08:08 AM

Quote:

Originally Posted by c123 (Post 2868197)
Hello there,

1. has anyone looked at Martin's script or been able to get in contact with him?
2. any progress of using/install rsync? (is the my book world running a rsync daemon?)

I'm considering getting one of these things specifically to be able to use rsync to do backups (currently have a LaCie Ethernet Disk Mini V2 that works very well, but it has no rsync and is not easily hacked).

Cheers

I've sent 2 emails to him asking for the source but got no reply.

osgpcq 08-26-2007 08:12 PM

Quote:

Originally Posted by spikesnet (Post 2869066)
I've sent 2 emails to him asking for the source but got no reply.

Hi,
I play with tcpdump to have a look on the Martin's script, and all is ok. So i use it to modify My Book.

c123 08-27-2007 03:16 AM

@spikesnet - thanks for the reply. guy *looks* legit, but zero replies to e-mails... and I can't quite understand why he does not want to publish the source for his hack...

@osgpcq - can you give us any more details as to what happens behind the scenes? I have still not decided whether a My Book is a good idea for me, and in any case I've never played around with tcpdump or ethereal etc (and am unlikely to find the time; even if I did not sure I'd understand anything).

Thanks guys.

spikesnet 08-27-2007 07:46 AM

I ran the hack on one of my mybooks and it looks like it created a directory called /var/upgrade which has the following files:

[root@MyBookWorld upgrade]# ls -la
total 28
drwxrwxrwx 2 root root 4096 Aug 22 23:24 .
drwxr-xr-x 18 root root 4096 Aug 25 23:29 ..
-rw-rw-rw- 1 root root 0 Aug 22 23:24 fwdownloaded
-rw-rw-rw- 1 root root 0 Aug 22 23:24 fwinstalled
-rw-rw-rw- 1 root root 73 Aug 22 23:23 fwv.tmp
-rwxrwxrwx 1 root root 1225 Aug 22 23:24 latestfw.sh
-rwxr-xr-x 1 root root 10 Aug 22 23:24 upgrade1.sh
-rw-rw-rw- 1 root root 51 Aug 22 23:24 xx

[root@MyBookWorld upgrade]# cat fwdownloaded

[root@MyBookWorld upgrade]# cat fwinstalled

[root@MyBookWorld upgrade]# cat fwv.tmp
<a href="http://martin.hinner.info/mybook/files/latestfw.sh">firmware</a>[root@MyBookWorld upgrade]

[root@MyBookWorld upgrade]# cat latestfw.sh
#!/bin/sh

echo '#!/bin/sh' >/var/upgrade/upgrade1.sh
chmod 755 /var/upgrade/upgrade1.sh
chmod 4755 /bin/busybox

KEYGEN=/usr/bin/ssh-keygen
SSHD=/usr/sbin/sshd
RSA1_KEY=/etc/ssh_host_key
RSA_KEY=/etc/ssh_host_rsa_key
DSA_KEY=/etc/ssh_host_dsa_key

do_rsa1_keygen() {
if [ ! -s $RSA1_KEY ]; then
echo -n $"Generating SSH1 RSA host key: "
if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then
chmod 600 $RSA1_KEY
chmod 644 $RSA1_KEY.pub
echo
else
echo
exit 1
fi
fi
}

do_rsa_keygen() {
if [ ! -s $RSA_KEY ]; then
echo -n $"Generating SSH2 RSA host key: "
if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then
chmod 600 $RSA_KEY
chmod 644 $RSA_KEY.pub
echo
else
echo
exit 1
fi
fi
}

do_rsa1_keygen
do_rsa_keygen


/usr/bin/passwd -d root

/usr/sbin/sshd &

rm -f /tmp/active_upgrade

exit 0

[root@MyBookWorld upgrade]# cat upgrade1.sh
#!/bin/sh



It's possible its doing other things I didn't see too.

bigcmos 08-28-2007 11:41 AM

Some Care Needed
 
This is a nice script which gets you up and running. The only issue I have is that it leaves your root password empty.

This is fine to let you get into your box, but I would recommend changing the root password when you get a chance to avoid letting anyone take over your box.


Quote:

/usr/bin/passwd -d root
Run this command as root to create a new password.
> /usr/bin/passwd


All times are GMT -5. The time now is 11:38 AM.