Home  >  Article  >  System Tutorial  >  How to modify the Linux fstab file to cancel the read-only attribute

How to modify the Linux fstab file to cancel the read-only attribute

WBOY
WBOYforward
2024-01-15 17:57:061245browse

Experimented with disabling the execution of set bit programs and binary programs through mount options

[root@localhost~]#vi /etc/fstab/

#join in

/dev/sdc1 /var ext3 defaults,noexec 1 2

[root@localhost~]#mount -o remount /var

After the system restarted, it was found that /dev/sdc1 could not be entered and could only enter the character interface.

I want to delete that line, but when saving the file, it prompts read-only attribute

Read-only file system

Experimented

(1)chmod w /etc/fstab

(2):w!

The file is still read-only and cannot be modified

method

#mount -n -o remount,rw /

Then you can save it

Restart the computer system and it will return to normal. The above problem occurs because of my own partition format setting.

Supplementary knowledge

/etc/fstab contains information about how your disk partitions and storage devices are mounted, and where they are mounted

The first column contains the device name,

The second column is its mount point,

The third column is its file system format,

The fourth is the mounting parameters,

The fifth column [a number] is the dump option

The sixth column [another number] is the file system check option.

The last two items in this file

1. default This writable value (rw ro suid [a security mechanism] user [nouser] whether ordinary users can mount exec and whether they can execute binary files sync [async] sync is written to the hard disk in real time, async is not For real-time writing, you can write to the memory first, which will be used in FTP)

2. 0 0 The first one is 0 indicating whether to back up, 1 is backup, and the latter one is indicating whether to check for partition errors.

The above is the detailed content of How to modify the Linux fstab file to cancel the read-only attribute. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete