Thanks all, it's a stupid post but I hope it can help someone out there. Of course, if you have this problem you need to change "my_directory" to the name of your current directory. Now I can keep practising with my Perl codes. So I changed the permissions in the directory in order to create my precious text files: $ sudo chmod 777 my_directory So what I did next is to search for this code, I typed ":h E212" inside VIM and the solution came in front of my eyes, the directory I was in didn't have writing permissions. Then I test my ability to create files with VIM as a normal user, VIM didn't allow me to create the file, it said in the VIM environment >
However, the program wouldn't create the file, I didn't know why. I came across this problem a few days ago, I'm learning Perl language and I wanted my Perl Program to create a simple text file, without being logged as root but as a normal user. Mailing list: Fedora Testers (for Fedora Beta releases).Discord: discord.gg/fedora (Voice & Text chat).Post content regarding Fedora Project or Linux in general.This subreddit is not affiliated with or endorsed by the Fedora Project. Also, we have discussed how our Support Engineers fix fstab can’t open file for writing error for our customers.A community for users, developers and people interested in the Fedora Project and news and information about it. Thus, it resolved the error and we can edit the fstab file. You might want to edit the file as a superuser as sudo vim FILE. The reason could be that you do not have permission to write in the directory or the file name is not valid. When editing the file we log in as root user and edit the file. For some reason the file you are writing to cannot be created or overwritten. /etc/apt/sources.list' E212: Cant open file for writing Solution For some reason the file you are writing to cannot be created or overwritten. One of the simplest reason for this error to occur is because the root permission is required to edit the fstab. Thus, we edit the file without any errors. Then we add the immutable attribute back using the command, chattr +i /etc/fstab Once we have edited the file we save the file. Thus, we remove the immutable attribute of the file using the command, chattr -i /etc/fstabĪfter removing the attribute we edit the file. I assume this is because I do not have the correct privileges to create files outside of my home directory My user account is in the sudoers file with (ALL(ALL) ALL), and I have administrator access. We check the immutable permission of the file using the command. E138: Cant write viminfo file /home/hadoop/.viminfo Press ENTER or type command to. We found that the immutable attribute was set for the file. On analyzing the file, write permission was available for the file. Recently one of the customer contacted us saying we are unable to edit the fstab file.
On executing the command we will be able to edit the file without any error. Thus, we give write permission for the file using the command. In this case we need to we check the permission of the file using the command. One of the common reason for the error is that the fstab is a read-only file. Let’s discuss how our Support Engineers resolved the error for our customers. Recently one of our customers contacted us with the same error. How we fix fstab can’t open file for writing Let’s discuss how our Support Engineers fix the error when trying to make changes in fstab file. Thus, if fstab does not have the required permission or if an immutable attribute is set this error occurs. We need to modify the fstab file. By default, to read-only is provided for ordinary users as a security measure.
If we add a new hard disk or to partition the existing one. The configuration file /etc/fstab contains the necessary information to automate the process of mounting partitions. Today let’s discuss how our Support Engineers resolve fstab can’t open file for writing error for our customers.Ĭauses for fstab can’t open file for writing Read only permission for fstab is set for normal users.Īt Bobcares, we often get requests regarding fstab as a part of our Server Management Services. Are you stuck with fstab can’t open file for writing error? We can help you fix it.