mounting an .iso file into a directory and replacing all of its content - linux

I was trying to install matlab on my linux (mint) computer, using some of the .iso files. I was trying to mount one of them using the command
mount R2017a_glnxa64_dvd1.iso /home/.../Documents/
which seems to have mounted the .iso file into my Documents directory and replaced everything there. When I try and open up the Documents directory, it just contains the contents of the .iso file and none of the files which I know were in there previously.
If I go to, say libre office, and click 'open recent file', any of my recent files which were in my documents now don't exist. This is quite worrying as I have a lot of work in there which isn't backed up.
I don't really know anything about what mount does. Will it have permanently deleted all the files from my Documents directory? I can 'unmount' the Documents directory now, but am worried it might be a bad idea and permanently delete the stuff that used to be there. Can anyone help me try and recover my Documents directory?
thanks

Related

Perforce messes up symlinks

When I download source code from perforce, the symlinks gets downloaded as files and the project, of course, doesn't build. This happens on certain computers and virtual machines but the same symlinks download fine on other computers.
The download file is often a short file which just contains path of the linked file instead of being zero byte symlink file.
This actually had to do with user permissions on windows, not so much with perforce. The problem is that the user doesn't have permission to create symlinks so perforce ends up creating a file (In my opinion, it should generate an error message instead of converting the symlink to file).
The simple solution in most cases should be to start P4V as administrator and then download the source code. You may have to force it to download everything since it will not re-download wrong symlinks because those objects already exist on disk.
You can check if you have permissions with the following command. More here.
mklink <linkFile> <ExistingFile>
Note: you may well be able to create symlinks (=shortcuts) using File Explorer but it's the command line (above) that will determine if you have the privileges or not.

How can I make a file "permanent" in a Linux live version?

I am working with a live Linux version. If I create a user and that user creates a file, how can I make that file visible for that user after I have restarted the system? (Normally it would be erased)
You can save the file in the device's hard drive, if you are using a CD/DVD.
In case you are using a flash drive, you can save the file in the root / folder.
Note: Be careful with name given in root folder, try to avoid things like boot or other names found in that folder. They are used to start the live system and boot manager usually recognize them based only in file names

How to freeze a folder in linux?

I wanna to freeze a folder in red hat so nobody (even root) can not add file into the folder or change files that exist in the folder already, i tried to make folder read only but this does not work and root user can add files normally as before, please somebody help me to solving this problem.
Create a filesystem in a file (eg: an iso file) containing the files you want in the directory then use a loopback mount to mount it read only onto the directory.
Anybody who tries to modify the filesystem normally (including root) will get a "read-only filesystem" error.
No. By design, in Linux, root ignores existing permissions on all entities. However, what you can do is encrypt files so that they can't be read and can't be modified by those who don't know the key. You can't prevent new files from being added, but with both encryption and decryption keys private, you can easily verify if any file is valid.
This also means you can't have either key on your computer!

linux - can not view directory contents in text editor (coda), but can view in terminal

I am using a linux machine hosted via Amazon's EC2. Today, I moved all of the contents over to a larger hard drive. I use Coda as my text editor.
Problem: I can not view the contents of many of the directories inside my new data drive via Coda. I can view all of the contents in these directories via Terminal.
Things I have tried:
- Checked to make sure permissions were set for said directories, sub-directories, and their contents. These are all set to 775
- I moved the files to another directory via terminal and then moved them back to their original folder. This allowed me to view the files and directories that I moved, but none of their sub-directories or files within these sub-directories.
- Refreshed all folders, quit out of Coda, deleted the site connection, and re-created it. This did not change anything.
Any ideas of what is going on?
Weird.... I had changed all permission to 775 at once, but some of the directories were still set to 755, so I had to change these manually.

Linux SVN recover files

A recent update over unversioned directories removed a bunch of files. Is there a way I can manually recover these lost files?
P.S. I cannot recover them from subversion, as the files I am looking for were never committed to SVN control. I have looked in the linux trash folder, which only contains files which have been manually deleted.
edit: Actually, the files were lost through an accidental svn rm operation. Unfortunately I cannot use revert as the files I am trying to recover were newly created and not under version control yet. Any ideas?
If files were lost during a svn update operation, there's not a lot you can do. I would suggest looking for hidden backup files that your editor may have created (in the directory where the file originally was or in the editor's temporary directory).
If you remember the name of one of the files, you can try using find to see if there's a backup copy of it somewhere on the disk.

Resources