Saturday, January 26, 2013

[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 wasn't working on my computer (Linux Mint). Apart from installing in a Windows partition, everything was exactly the same as the last one and I didn't 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 didn't 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 it's 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 doesn't. 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

You'll 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 won't be any errors.

No comments:

Post a Comment

Post your comment here. If you want to say something about programming problems, scripts, software etc, please try to be as descriptive as possible.

Connect Rapoo MT750S with Linux (Tested on Manjaro)

 I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...