Linux Symbolic link to Mapped Drive - linux

I was wonder how I would be able to create a Symbolic link to a directory on a mapped drive?
I have a Mac OS laptop and have a mapped drive pointing to a folder on a remote server which contains a folder called 'content'.
I am able to access the mapped drive via Terminal and also it the directories without however when I try to create a symbolic link on my laptop ROOT directory pointing to the 'content' folder on the mapped drive then I get an error.
Here is the command I issue:
ln -s ./site_content /Volumes/***ip-address***/content
I then get the following error:
ln: /Volumes/***ip-address***/content/site_content: Input/output error
Any ideas?
Thanks!

Your command is backwards. The first path is the target of the link, and the second is where the link is created. If you did not specify where the link is created, it would default to the current directory and the name of the target (e.g. ./content).
ln -s /Volumes/***ip-address***/content ./site_content
You get an error with the previous command because however your drive is mapped, it does not support creating symbolic links on the remote filesystem. What you really wanted was a symbolic link on the local filesystem that references a remote filesystem, which should work fine.

Related

mac how to get the symlink original path

I have symlinked a file in hard drive A in linux with nodejs symlink. When I plug the hard drive to macbook, the symlink breaks because the mounted root direcotry in macOS is different to linux. Is there a way in macOS to get the file's original path string with node, so I can use it by replacing the mounted directory in order to read the original file in the hard drive?
For example,
in linux link: /media/A/src/abc.jpg -> /media/A/dst/1.jpg
in mac, read /Volumes/A/dst/1.jpg's link /media/A/src/abc.jpg, then manual change to /Volums/A/src/abc.jpg to read the file
Use relative paths instead of absolute paths in the symlinks. E.g.
/media/A/src/abc.jpg -> ../dest/1.jpg
Then the links will work the same no matter where the drive is mounted.

How to extract/decompress this multi-part zip file in Linux?

I have a zip file thats titled like so file1.zip,file2.zip,file3.zip,etc...
How do I go about extracting these files together correctly? They should produce one output file.
Thanks for the help!
First, rename them to "file.zip", "file.z01", "file.z02", etc. as Info-ZIP expects them to be named, and then unzip the first file. Info-ZIP will iterate through the split files as expected.
I found a way. I had to mount the remote machines user home folder on my Ubuntu desktop pc and use File Roller Archive Manager, which is just listed as Archive Manger in Ubuntu 18.
Mount remote home folder on local machine...
Install sshfs
sudo apt install sshfs
Make a directory for the mount. Replace remote with whatever folder name you want
mkdir remote
Mount the remote file system locally replacing linuxusername with the user account you want to use to login and xxx.* with its IP address or hostname.
sudo sshfs -o allow_other linuxusername#xxx.xxx.xxx.xxx:/ remote
Now in the mounted "remote" folder you can see the contents of the whole linux filesystem and navigate them in a File Manager just like your local file system, limited by user privileges of course where you can only write to the home folder of the remote user account.
Using Archive Manager I openened up the .zip file of the spanned set (not the .z01, .z02 etc files) and extracted inside the "remote" folder. I saw no indication of extraction progress, the bar stayed at 0% until it was complete. Other X Windows based archive applications might work.
This is slow, about 3-5 megabytes per second on my LAN. I noticed Archive Manager use 7z to extract but do not know how as 7z is not supposed to support spanned sets.
Also if your ssh server is dropbear instead of openssl's sshd it will be unbearably slow for large files. I had to extract a 160gb archive and the source filesystem was fat32 so was not able to combine the spanned set into one zip file as it has a 4gb file size limit.

Blank SSHFS mount folder

I am attempting to mount a remote directory located on my web server to a directory in my xUbuntu installedation hosted in a VirtualBox.
I'm using the following command syntax:
sshfs root#*.*.*.*:/var/www Desktop/RemoteMount
Using the file manager, I navigate to the Desktop/RemoteMount directory but find it entirely blank. The SSHFS command above executed with no indication of an error.
Completely by chance, I use the terminal to long list the contents of the Desktop/RemoteMount directory and it shows all the data I was expecting to see in the file manager.
Can anyone tell me why the file manager does not show my remotely mounted data and how I might fix it?
Thanks.
you are missing local mountpoint.
sshfs -o idmap=user mika#192.168.1.2:/home/mika/remotepoint /home/mika/localmountpoint.
And You need to have localmount folder exist.
thanks Mika

phpstorm write issues in ./idea directory

When I try to save a file to disc within a project directory, I get this error:
java.io.IOException: W:\\[projectname]\\.idea not found
Some research tells me, the (network) location is not writable.
I'm trying to write this file from phpstorm in windows 8.
The drive (W:) is a network drive to a linux machine.
The directory I try to write to is chowned to the same user and group as I connect with in windows.
This is a result of ls -alh:
drwxrwxrwx 2 correct-user correct-user
On Linux and other Unix-like operating systems files starting with a . are considered 'hidden files' by default. As such, when the Windows-based program creates it, it suddenly doesn't see it anymore right after since it's hidden, even though the creation was successful. You can fix this in your Samba config by adding the following line to the share configuration:
hide dot files = no
In my samba settings I added a veto files parameter. Removing this parameter allows me to write dot files again.
Samba describes this setting as follows:
This is a list of files and directories that are neither visible nor accessible

create directory as an ssh link

I'd like to create a directory that links to external site via ssh.
So that when I cd to /var/remote/dev01 it will actually cd to a folder on a remote site.
So I'm staying on my current terminal and can copy files from any other dir to this /var/remote/dev01 dir and it will copy the files over to the remote host.
Is this even doable?
Yes, this is possible. Take a look at SSHFS. It lets you mount a remote filesystem over ssh, and treat it as a local mountpoint, for standard filesystem operations.
Here's a nice walkthrough to get you started.

Resources