[SOLVED] Location of network shares in dir structure [SOLVED]

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
shabuboy
Level 1
Level 1
Posts: 2
Joined: Wed Feb 05, 2020 10:18 pm

[SOLVED] Location of network shares in dir structure [SOLVED]

Post by shabuboy »

Hello,

I am running Linux Mint 19.1 Cinnamon 64bit.

Via the app "Files / Network" I can find network shares and mount them, see and copy files by dragging. It also adds shortcuts to Desktop and also the bar address is something like "afs://user@server.local/share".

The question is: Where are they located in the command line directory structure?
I cannot find them at "/" or "/mnt", my home folder, etc.
I wanna be able to see the directory structure and files via the terminal/command line

Any idea?

Thanks!
Last edited by shabuboy on Thu Feb 06, 2020 1:52 am, edited 2 times in total.
User avatar
WharfRat
Level 21
Level 21
Posts: 13909
Joined: Thu Apr 07, 2011 8:15 pm

Re: Location of network shares in dir structure

Post by WharfRat »

Hello shabuboy Image

Welcome to Linux Mint and the Linux Mint forum :)

They would probably show somewhere in /run/user/1000

When I connect my phone I get

Code: Select all

[bill@XPS-sylvia] ~ ->$ ls -lh /run/user/1000/gvfs/
total 0
dr-x------ 1 bill bill 0 1969-12-31 19:00:00 mtp:host=%5Busb%3A001%2C067%5D/
[bill@XPS-sylvia] ~ ->$ 
ImageImage
shabuboy
Level 1
Level 1
Posts: 2
Joined: Wed Feb 05, 2020 10:18 pm

Re: Location of network shares in dir structure

Post by shabuboy »

Look at that, there they are!!!

Thanks @WharfRat!
Second Round
Level 1
Level 1
Posts: 21
Joined: Sun Feb 02, 2020 7:29 am
Location: TN, USA

Re: [SOLVED] Location of network shares in dir structure [SOLVED]

Post by Second Round »

I have a related question; hope it's OK to add to a "solved" thread.

I was thinking of writing a script that would invoke rsync to update the contents of podcast directories on devices that get connected to my desktop computer (where I have used gpodder to retrieve new podcast episodes and delete old ones).

Early in the process of thinking through it, I found that the devices (1. android smartphone; 2. a kindle fire 2nd gen) get mounted to

run/users/1000/gvfs/'mtp:host= %5Busb%3A001%2C009%5D"

I subsequently learned that 001 is the bus number, 009 is the device number, and the device number increases by 1 every time you plug in the device. [By contrast, I noted that external flash drives and hard drives are mounted under /media/user/DRIVENAME]

So the first hurdle I see for my script is that the devices (phone, kindle) aren't mounted in the same location every time, such that a script could reliably find them. Is there way around this, and if so, how? Thank you!
User avatar
WharfRat
Level 21
Level 21
Posts: 13909
Joined: Thu Apr 07, 2011 8:15 pm

Re: [SOLVED] Location of network shares in dir structure [SOLVED]

Post by WharfRat »

If you plug in one device at a time, try

Code: Select all

rsync -aviuh "/run/user/1000/gvfs/$(ls /run/user/1000/gvfs)/SD card/" /path/to/backup
The above would sync the phone's SD card.
ImageImage
Second Round
Level 1
Level 1
Posts: 21
Joined: Sun Feb 02, 2020 7:29 am
Location: TN, USA

Re: [SOLVED] Location of network shares in dir structure [SOLVED]

Post by Second Round »

Thank you!

Although it's not quite working for me, your suggestion does move me closer to a solution, and that is cool how running

Code: Select all

ls
captures the every-changing name of the device that is being connected.

So here's where I am. First thing I did was reverse the source and destination, since I'm trying to copy to the connected device from the desktop computer, rather than vice-versa. And the folders don't quite have the same names - this has resulted in some curious behavior - but is not the only error.

So I changed the command to:

Code: Select all

rsync -aviuh gPodder/Downloads "/run/user/1000/gvfs/$(ls /run/user/1000/gvfs)/Internal storage/Music/"
[This is for a Kindle Fire 2nd gen; unlike my phone, there is no dedicated podcasts directory - but you can dump mp3 files of podcasts in the music folder and it'll play them].

I have almost 20 podcasts and each has their own folder in gPodder/Downloads, as well as in Internal storage/Music on the Kindle. When I run the command, it creates a new folder, Internal storage/Music/Downloads, where all podcasts folders appear, but none of the files associated with them. What's more, that new Downloads folder under Internal storage/Music doesn't appear on the Kindle.

Back in the terminal window I'm getting errors on every podcast, such as

Code: Select all

rsync: failed to set times on "/run/user/1000/gvfs/mtp:host=%5Busb%3A001%2C005%5D/Internal storage/Music/Downloads/Astronomy Cast": Operation not supported (95)
and then, after all podcasts are run through, these errors appear:

Code: Select all

rsync: mkstemp "/run/user/1000/gvfs/mtp:host=%5Busb%3A001%2C005%5D/Internal storage/Music/Downloads/Astronomy Cast/.AstroCast-200406.mp3.cQpqKW" failed: Operation not supported (95)
rsync: mkstemp "/run/user/1000/gvfs/mtp:host=%5Busb%3A001%2C005%5D/Internal storage/Music/Downloads/Astronomy Cast/.folder.jpg.tibLLq" failed: Operation not supported (95)
[the full output is incredibly long - I'm just snipping some stuff out that I hope is relevant for troubleshooting].

Anyway I'm doing a bit of trial and error, thought I might try adding -r to the list of options just in case that's why I'm getting the folders without the files. Once I solve that, I'd like to have them land in the Music folder directly rather than another level down, i.e.,

Internal storage/Music/Astronomy Cast

instead of

Internal storage/Music/Downloads/Astronomy Cast

and so forth. Again, many thanks!!
Second Round
Level 1
Level 1
Posts: 21
Joined: Sun Feb 02, 2020 7:29 am
Location: TN, USA

Re: [SOLVED] Location of network shares in dir structure [SOLVED]

Post by Second Round »

Update:

The following appears to work imperfectly; error messages such as those in the second group from my post above (mkstemp ... failed: operation not supported (95))

Code: Select all

rsync -aviruh -O --no-perms --delete gPodder/Downloads/ "/run/user/1000/gvfs/$(ls /run/user/1000/gvfs)/Internal storage/Music" 
Probably could stand more refining, but thanks again WharfRat for helping me get this far!
User avatar
WharfRat
Level 21
Level 21
Posts: 13909
Joined: Thu Apr 07, 2011 8:15 pm

Re: [SOLVED] Location of network shares in dir structure [SOLVED]

Post by WharfRat »

Google "rsync Operation not supported (95)" and the first result alludes to
If you try to sync some files to an ftp mount you might get the Operation not supported (95) error. ... The ftp system does not allow creation of temp files
It's probably the same for mtp mounts :wink:
ImageImage
Post Reply

Return to “Newbie Questions”