Error when saving MLX file

조회 수: 89 (최근 30일)
Agustín . 2022년 10월 10일
댓글: Charles Ragan . 2023년 8월 8일
I am using MATLAB R2022a in Ubuntu 20.04.5 LTS (Kernel 5.15), and whenever I try so save a .m script file I have no issues, however when I try to save a Live Editor file (.mlx), I get the next error:
Unable to save file myFile.mlx
java.lang.RuntimeException: Internal Exception in writing MLX file : Could not commit changes: copy failed: fl:filesystem:SystemError: /tmp/.bdae-ce03-39f3-5965.tmp invalid cross-device link
I have tried with R2022b, but the problem persists. I have another Ubuntu station (Kernel 5.4) and it does write the file. I have read about similar errors depending on the Kernel version. Is there any solution that does not include downgrading the Kernel?

채택된 답변

Sailesh Kalyanapu
Sailesh Kalyanapu 2022년 10월 14일
I understand that you are getting an error when saving 'MLX' files in MATLAB R2022a and R2022b.
This is a known issue with MATLAB R2022 releases. Currently, these are the following workarounds other than downgrading the Linux kernel:
1) Change the temp directory of MATLAB to a new folder
The default temp directory of MATLAB on Linux is '/tmp/', to resolve the issue, you can create a new folder in a different file directory and set it as the new temp directory.
Please refer to the following example to change the temp directory of MATLAB in the MATLAB Command Window:
>> clear all
>> tempdir % ans = '/tmp/'
>> clear all
You should be able to save all MLAPP files/ Simulink models/ Live Scripts as usual after changing to the new temp directory.
If the above workaround does not resolve the issue, try to
2) Use MATLAB Online:
MATLAB Online provides access to the latest version of MATLAB from a standard web browser using MathWorks-hosted computing resources and storage, which allows you to continue working with your previous files and related datasets.
Please refer to the following link to upload the files to MATLAB Online and download files from it:
If you would like to know more about what is MATLAB Online, please refer to the link below:
  댓글 수: 7
Charles Ragan
Charles Ragan 2023년 8월 8일
I was having this issue with not being able to save mlx files in R2022b in MOS on OpenShift. The solution above worked for me.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Charles 2022년 10월 24일
I am having this problem, too, but the above work-around does not work.
Without the work-around, I get this error dialog:
This mentions the "cross-device link".
Then I change the temp directory to one under my home dir: '/home/cwright/.matlab_tmp/'. I open a new model in Simulink, add one block and try to save. I get this error dialog:
Clearly, the new temp dir isn't good enough. So I close the file without saving, then attempt to exit Matlab. The GUI disappears, but the process never quits, in fact it starts taking 100% of the CPU (single core) and requires manually killing. This happens with or without the temp dir change.
This is pretty frustrating, as I'm on a trial Simulink license. Simulink works perfectly on my machine at work, but not my home machine. Both are running Linux Mint 20.3 with identical kernels:
Linux 5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:17:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
They are two different processors and mainboard. I guess the next step is to downgrade the kernel, but I'd appreciate other suggestions.


Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by