Sunday, October 30, 2016

Linux Ubuntu Fix MATLAB on an NTFS Partition

Linux Ubuntu Fix MATLAB on an NTFS Partition


To start with, I was in a huge mess yesterday because today was my Image Processing exam and all of a sudden, MATLAB wasnt working on my computer (Linux Mint). Apart from installing in a Windows partition, everything was exactly the same as the last one and I didnt have a Windows version to go to. It started throwing all sorts of errors related with Java and JVM. 4 hours from the exam I still didnt have any luck, when all of a sudden searching with the Error strings, I hit an Ubuntu forums page describing the same scenario as mine. MATLAB on an NTFS Partition. This was also the first time I used the fstab file in Linux.
Source: [ http://ubuntuforums.org/showthread.php?p=10157469#post10157469 ]
First, Linux cannot change permisssions on a Windows filesystem outside of a mount or through fstab. This is the way its always been. Second, the default permissions set on mounting NTFS partitions through File Manager has changed since Gutsy which is why it used to work and now it doesnt. You will need to automount your partition by adding a line to fstab so that you can force the permissions you want. The general steps to automount are as follows:
[1] Go back to File Manager and unmount the drive (Or use a command, your choice. Generally I use
sudo umount /media/<partition-name>

[2] Create a permanent mount point for the partition
sudo mkdir /media/NTFS1

[3] Find out how you system sees your partition
sudo blkid -c /dev/null

Youll get something that looks like this:
/dev/sda2: LABEL="WinXP2" UUID="DA9056C19056A3B3" TYPE="ntfs"

[4] Using the info above as an example you would add a line in fstab that looks like this:
/dev/sda2 /media/NTFS1 ntfs defaults 0 0

This might be a bit different for your system. Just open the fstab file using nano, using
sudo nano /etc/fstab

and see how your system lists them. If your system uses UUID, replace the first part with the UUID
UUID=DA9056C19056A3B3 /media/NTFS1 ntfs defaults 0 0

[5] Running the following command will check for errors and mount the partition:
sudo mount -a
That, should do it. Now try running MATLAB. Hopefully there wont be any errors.

Go to link download