3

I was trying to install Matlab, and used the following commands:

# mkdir -p /mnt/disk
# mount -o loop R2014a_UNIX.iso /mnt/disk
# cd /mnt/disk
# ls -l
# ./install

However, I don't want it in a directory called disk, I want it in a directory called Matlab using

  mkdir /mnt/matlab
  mount -o ro,loop ./R2014a_UNIX.iso /mnt/matlab
  /mnt/matlab/install
  umount /mnt/matlab

(out of interest is this the best place to install it?)

However, I am unable to uninstall or remove /mnt or /mnt/disk as they have read only privileges. My searching and attempts with chown, rmdir and rm -r have not helped yet.

Please could you help me out.

4

The best place to install additional software packages in linux is /opt/. So create a directory for MatLab there and install it.

# mkdir /opt/matlab
# mount -o ro,loop ./R2014a_UNIX.iso /media/cdrom
# /media/cdrom/install
# umount /media/cdrom

As your installer is in the form of an ISO image, mount it in /media/cdrom.

I hope the installer /media/cdrom/install will ask you the location of installation and specify it as /opt/matlab. Once things are done set the PATH environment variable appropriately so that the matlab binaries are accessible without their "absolute path".

Why do u want to remove /mnt/ directory ?. This directory is important and they are part of Filesystem Hierarchy Standards. But incase if you still want to delete it, login as a root user and enter rm -rf /mnt it should get deleted.

  • When I logged in again thismorning, disk was empty. I must have just not reloaded after unmounting. I was not however able to remove disk as described above... Matlab was instaled to ust/local/matlab, which seems OK reading this: unix.stackexchange.com/questions/11544/… Thank you for your clear explanation making me (and others) feel welcome to the world of Linux. – Jack Oct 24 '14 at 8:46
2

This line

# mount -o ro,loop ./R2014a_UNIX.iso /mnt/matlab

mounts the filesystem contained in the CD / DVD image R2014a_UNIX.iso at '/mnt/matlab', using the loop device. It doesn't actually copy the data from the .iso image file into the '/mnt/matlab' directory. When a process attempts to access the files that appear to be inside the '/mnt/matlab' directory the loop device translates these requests so that they refer to the data that's really inside the .iso image file. The ro specifies that the filesystem is read only, so you can't accidentally damage the contents of the .iso. You certainly don't want to install stuff into '/mnt/matlab'!

Once you've done the installation and umount '/mnt/matlab', have a look at the contents of '/mnt/matlab' and you'll see that it's empty. And if you want, you can then safely delete '/mnt/matlab'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.