LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-06-2024, 12:31 AM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 569

Rep: Reputation: 10
Post A question about file and directory permission


Hello,
I created a directory and two files under the /var/log directory. I want V2Ray to be able to write something inside these two files. So, I changed the file permission as below:
Code:
# chmod -R 777 /var/log/v2ray/
# ls -l /var/log/v2ray/
total 0
-rwxrwxrwx 1 root root 0 Feb  6 01:20 access.log
-rwxrwxrwx 1 root root 0 Feb  6 01:20 error.log
But I get the following error:
Code:
v2ray[665]: 2024/02/06 01:21:11 [Info] v2ray.com/core/main/jsonem: Reading config: /etc/v2ray/config.json
v2ray[665]: main: failed to create server > v2ray.com/core/app/log: failed to initialize access logger > open /var/log/v2ray/access.log: read-only file system
How to solve it?

Thank you.
 
Old 02-06-2024, 12:46 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,071

Rep: Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364
that is a read-only filesystem. You need to check why and fix that (if there was any error).
 
Old 02-06-2024, 04:10 AM   #3
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,836

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
Yes, the error message is "read-only file system" not "permission denied".

Determine the file system with
Code:
df -hT /var/log/v2ray/access.log
For example, a type ext3 and ext4 file system is known to permanently fall to read-only if there was an error; the usual fix is a system reboot.
 
Old 02-06-2024, 04:29 AM   #4
Jason.nix
Member
 
Registered: Feb 2023
Posts: 569

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by pan64 View Post
that is a read-only filesystem. You need to check why and fix that (if there was any error).
Hello,
Thank you so much for your reply.
Why did this happen? I solved this problem via mount -o remount / command.
 
Old 02-06-2024, 04:57 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,071

Rep: Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364
you need to check the logs of the last boot.
 
Old 02-07-2024, 05:07 AM   #6
Jason.nix
Member
 
Registered: Feb 2023
Posts: 569

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by pan64 View Post
you need to check the logs of the last boot.
Hello,
Thanks again.
Do you mean dmesg?
 
Old 02-07-2024, 06:11 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,071

Rep: Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364Reputation: 7364
either dmesg or journalctl or /var/log.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
16.04 - Permission denied though I'm sudo and have permission to file insomniacno1 Ubuntu 5 10-22-2020 03:30 AM
[SOLVED] Permission issue for directory access in user's home directory BhushanPathak Linux - Newbie 9 07-11-2017 06:04 AM
File & Folder Permission and Ownership permission error in Cloud storage. rhcekumaran Linux - Newbie 3 06-14-2013 04:41 AM
Linux file/directory permission question cpthk General 11 09-04-2009 01:32 AM
file/directory access permission question correro Linux - General 4 05-22-2003 07:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration