Jump to content

Sync local music directory to sshfs remote mount Android?


Hedon James

Recommended Posts

Still tinkering with the new Galaxy Note4 and tweaking things the way I like 'em. I'm starting to really dig this phone, for reasons I never expected and contemplated. But it's also frustrating, as I'm stretching into new territories of knowledge and I feel like a schoolboy fumbling with his first bra removal, as opposed to the one-handed removal of a seasoned veteran. B)

 

I previously posted about Bluetooth connection issues with Android KitKat devices, and got that resolved. But I've also learned that more recent versions of Android have removed UMS mass storage protocols in favor of MTP and PTP. With all the extra storage on my permanently mounted external SD card, I thought I would start syncing my 40GB music collection to my Android SdCard, using the built-in sync function of Banshee, via usb connection with UMS. I had done this on an older Android device, although selected music instead of the whole library (device wouldn't hold it all), and it worked FANTASTIC!

 

But with MTP and PTP being the new Android protocols, Banshee sync is buggy with my Note4 and often crashes. Further investigation revealed a fancy workaround with go-MTPs (a google implementation of MTP for linux), mounting devices to mount points, etc... This seems like a cumbersome PITA for a usb cable sync. I figure if I'm going to jump through such hoops, I'd like to sync music WIRELESSLY, via wifi or bluetooth. Some folks on here pointed me to AirDroid and Droid Wifi and I like both of these solutions for file management, although each has their unique advantages/weaknesses. It got me to thinking, can I wirelessly "rsync" my music to my Galaxy Note4 android? With that goal, I think I'm about 95% of the way there, but I just can't figure out the last step. I'm starting to wonder if it's impossible, or just impossible for me? Here's what I've got so far:

 

- based on google searches of wireless sync solutions with Android, ssh protocols seems to be the way to go. I've installed sshfs on my desktop; I've added myself to the group Fuse; and I've created a mount point in my HOME directory, simply called Note4.

- i've installed SSHDroid on my Note4; very much like AirDroid & Droid Wifi, SSHDroid makes my Note4 act as a server, accessible from desktop terminal at address of root@10.131.x.x:2222

- accessing the Note4 via Nautilus "connect to server" with appropriate location, user, password credentials does indeed mount the device using sftp protocols!

- alternatively, I can mount the Note4 in my home directory with terminal command of:

sshfs root@10.131.x.x:/storage -p 2222 ~/Note4

I am asked for the remote device password (again, provided by SSHDroid), which is entered, and tada...my Note4 is mounted to the Note4 folder in my home directory; I am able to navigate the entire directory structure of the Android device with ease! In fact, this is even better than AirDroid or Droid Wifi! But this is where the success ends...

 

While I can navigate the remote directory as if it were local, and I can copy files from the remote Android to my local desktop, I CANNOT TRANSFER files to the mounted device in the Note4 directory of MY HOME directory. Further investigation of directory & file permissions reveals that, although username jim is the Owner and the Group of the Note4 directory, once the Note4 is mounted to the local mount point, the owner is changed to "root" and the group is changed to "1028"(?). While "root" has full rwx access, the group 1028 does not, and neither do "other users". Consequently, rsync does not work either. I have attempted to chown the directory after the mount, but it stays "root". I have attempted to chmod permission, but without success. And I have attempted to mount the sshfs with optional argument of "umask=0000" to allow everyone full rwx privileges. While the owner remains "root" and the group remains "1028"(?), the permissions do indeed change to read, create, access files...but I still cannot write to the mounted Note4 directory!!!!

 

Unless I'm missing something, I'm fairly certain my inability to write to the mounted directory is because of the ownership permissions. While mounting a FUSE directory with "sudo sshfs" would certainly make "root" the owner, a local user is supposed to be able to execute sshfs as themself in order to retain ownership of the mounted remote directory. What am i missing? Or doing wrong"

 

Once again, I have googled myself in a circle and pureed my brain for the day... How can I mount the remote filesystem as a local directory (succeeded already!), while retaining ownership and the ability to create new/modify existing files in the remote directory (failing miserably!). If I can solve this seemingly minor (but so far insurmountable!) obstacle, I should be able to rsync my music directory as planned! Either with LuckyBackup, or with "synchronize folder" extension in my Banshee music player. Anyone with any thoughts?

Link to comment
Share on other sites

securitybreach

Since this is more of an android issue instead of a Linux issue, this should be posted in Mobility and if you do not care; I will move the post.

Link to comment
Share on other sites

I assumed it's a Linux issue, as it seems like sshfs and linux permissions are what's giving me fits, and those are unique to linux. It just seems that sshfs is doing the exact opposite of what it's supposed to be doing. I assumed I'm missing a small, stupid, but important linux configuration detail somewhere.

 

But I'm cool with where ever anyone has a thought. And beggars can't be choosers, but I imagine the majority of Android users would likely supply windows solutions. then again...maybe it's unique to Android Kit Kat and/or Samsung devices. I'm stumped...

 

Is there a way to link this thread so that it has exposure in both forums? I'll defer to your expertise as to where I'm most likely to receive advice from. Thanks SB!

Edited by Hedon James
Link to comment
Share on other sites

securitybreach
I imagine the majority of Android users would likely supply windows solutions.

Well the majority of Android users here are also Linux users so it should be seen...

Link to comment
Share on other sites

securitybreach

Well as Fran mentioned, JuiceSSH works beautifully from android to linux as long as you have a ssh server running on your host machine. You can download file from your computer or upload files from your phone to your computer using the application

Link to comment
Share on other sites

Have you tried JuiceSSH or JuiceSSH Pro from the Google Play store for this or something else?

 

Send files from Linux to Android via ssh - Stack Exchange

 

Is that what you are trying to do?

 

YES! I've got everything working except copy to the Android, which precludes rsync, the ultimate goal. I've tried SSHelper and SSHDroid so far (and 2 others I forgot the name of), and SSHDroid has gotten me this far. Haven't tried JuiceSSH, but I'm willing. Have you had success with this setup? Can you copy to your mounted Android?

 

Well the majority of Android users here are also Linux users so it should be seen...

 

I wasn't aware of a Mobility forum, as I exclusively peruse the BATL forums for the intellectual and entertaining chatter there! I assumed a Mobility forum would also have members from a "majority" operating system. My bad! I'm cool with wherever you think I might received suggestions for solutions. Again, thanks for looking out for me SB!

 

Well as Fran mentioned, JuiceSSH works beautifully from android to linux as long as you have a ssh server running on your host machine. You can download file from your computer or upload files from your phone to your computer using the application

 

I believe I'll give JuiceSSH a whirl and see if that solves my issue. At worst, if it does not solve my issue, we can rule out the Android and Android software as potential culprits and focus on my sshfs config. If it works, then SB was right and it's an Android issue, not a linux issue. Either way, it's progress right?! Thanks for the tip on JuiceSSH...I'll let y'all know what I find.

Link to comment
Share on other sites

I've got JuiceSSH installed, but it looks like I need to use Android as the client and my desktop as the server. I'd prefer the other way around; mount my Android to my desktop directory ~/Note4. I've been tinkering with JuiceSSH but can't seem to figure it out. Is there a way to make the Android the server?

Link to comment
Share on other sites

I'm back on the SSHDroid method described above, and found this on the ArchWiki, which seemed to be helpful:

 

https://wiki.archlinux.org/index.php/sshfs

following the Secure User Access, section, I have mounted using the -o idmap=user Option, thinking this will give my local user (jim) access to the remote mounted Android directory. But the end result is the same; the directory is owned by root and the group is 1028. Here's a terminal output summarizing what I think the issue might be:

 

jim@Asus:~$ sshfs -o idmap=user root@10.131.96.110:/storage -p 2222 ~/Note4
root@10.131.96.110's password:
jim@Asus:~$ cd Note4
jim@Asus:~/Note4$ ls la
ls: cannot access la: No such file or directory
jim@Asus:~/Note4$ ls -la
total 48
drwxr-x--x  1 root 1028	 0 Jan 22  2014 .
drwxrwxrwx 66 jim  jim   4096 Nov 25 20:42 ..
drwxr-x--x  1 root 1028    80 Nov 26 03:09 emulated
drwxrwx--x  1 root 1028 32768 Nov 26 03:09 extSdCard
lrwxrwxrwx  1 root root    24 Jan 22  2014 knox-emulated -> /mnt/shell/knox-emulated
d---------  1 jim  jim	  0 Jan 22  2014 Private
lrwxrwxrwx  1 root root    24 Jan 22  2014 sdcard0 -> /storage/emulated/legacy
drwx------  1 root root	 0 Jan 22  2014 UsbDriveA
drwx------  1 root root	 0 Jan 22  2014 UsbDriveB
drwx------  1 root root	 0 Jan 22  2014 UsbDriveC
drwx------  1 root root	 0 Jan 22  2014 UsbDriveD
drwx------  1 root root	 0 Jan 22  2014 UsbDriveE
drwx------  1 root root	 0 Jan 22  2014 UsbDriveF
jim@Asus:~/Note4$ 

 

Cruising the directory structure of my Android, I note that "emulated" and "extSdCard" are indeed the 2 directories where my field notes, sketches, and pictures are stored. How can I mount as owner jim and/or group jim? What am I missing?

Link to comment
Share on other sites

SyncMe Wireless looked promising until I read the issues with Galaxy Note4, KitKat 4.4.2+, and external SD cards. I'll look at AndFTP, but if I can't get this working fairly easily, I'll be taking a break from it, step back, and re-think my approach. My Note4 appears to be an issue, as it has only been available for a little over a month; Android KitKat is an issue due to removed UMS function; and the Note4 is supposed to be one of the first devices to receive Android 5.0 Lollipop upgrades. I'm squarely in the sweet spot of dysfunction and even if I get it resolved, there's no telling whether 5.0 Lollipop will change the game again.

 

I do appreciate the tech tips, but I'm starting to wonder if I've got the wrong hardware, the wrong solution, or if it's just the right solution with the wrong implementation. Calm down and breathe deep...

Link to comment
Share on other sites

securitybreach
Note4 is supposed to be one of the first devices to receive Android 5.0 Lollipop upgrades

You mean besides all of the Nexus devices (4, 7, 9, 10) Moto X, Moto G, etc. which have already gotten the upgrade to Lollipop.

 

 

I will find out another application then.

Link to comment
Share on other sites

securitybreach

Description

 

* Access your Android device over wifi as a Windows shared folder.

* Samba Filesharing server for Android [ Recently updated for JellyBean probs ].

* Your Android device becomes visible to other Windows (& SMB compatible) computers on your network.

* The 'external' storage in your Android device is accessible as a network shared folder.

* Copy files and folders to and from your Android device using drag and drop.

* Customisable username, password, Windows workgroup name, and device network (NETBIOS) name.

 

Requirements:

* Your Android device must already be rooted and a SuperUser app installed.

 

https://play.google....e=search_result

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...