Linux prompts when you use Mkdir can not create directory ‘test’?

  

Recently, some Linux users have used MKDIR to find the system prompt: can not create directory `test‘: Read-only file system (prompt is not able to create this directory, the directory is a system read-only file). How to solve this problem? Here's how to solve it, let's take a look.

Description: The monitoring group of people take feedback, when a host fooled opt to create a directory, suggesting file system is read-only Read-only, not allowed to write or delete, such problems based on past experience There are three possibilities:

1. The w permission is not given when mounting;

2. The partition has a problem and needs fsck for repair processing;

3. The hard disk is faulty. Use the original server tool to verify if there is a problem with the hard disk and replace the hard disk to avoid losing data.

Note: Some people may also think that using chattr to set permissions can not be written and configured through disk quotas, but the error settings of these two settings are different from this error.

Solution:

1. View the current parameters through mount:

# mount

/dev/sda2 on /type ext3 (rw, acl, User_xattr)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

debugfs on /sys/kernel/debug type debugfs (rw )

udev on /dev type tmpfs (rw)

devpts on /dev/pts type devpts (rw,mode=0620,gid=5)

/dev/Sda5 on /boot type ext3 (rw,acl,user_xattr)

/dev/sda9 on /home type ext3 (rw,acl,user_xattr)

/dev/sda10 on /opt type ext3 (rw, acl, user_xattr)

/dev/sda8 on /tmp type ext3 (rw,acl,user_xattr)

/dev/sda6 on /usr type ext3 (rw,acl,user_xattr )

/dev/sda7 on /var type ext3 (rw,acl,user_xattr)

By checking, you can find that the currently mounted permission is rw.

2, fsck fix

[[email protected] ~]# umount /opt/

umount: /opt: device is busy

umount : /opt: device is busy

[[email protected] ~]# fuser -m /dev/sda10

/dev/sda10: 11334

[root@ 361way.com ~]# ps auxww| Grep 11334

apache 11334 0.0 0.3 14288 6404 ? S 09:47 0:00 /usr/sbin/httpd -k start -DSSL

root 12184 0.0 0.0 4128 684 pts/0 R+ 09:50 0:00 grep 11334

[root @361way.com ~]# service httpd stop

Stopping httpd: [ OK ]

[[email protected] ~]# umount /opt/

[root@ 361way.com ~]# fsck -V -a /dev/sda10

fsck 1.39 (29-May-2006)

[/sbin/fsck.ext3 (1) -- /opt ] fsck.ext3 -a /dev/sda10

/opt: recovering journal

/opt: clean, 1890281/20971520 files, 6941812/20970849 blocks

3, hard drive Detection

This can be based on the tools provided by the OEM for the relevant system, such as HP's hpacucli, DELL's delldset, and ATAE's disk_info_test.

If you have any problems with this problem, please use the solution provided by Xiaobian to solve it. I believe this method will help you.

Copyright © Windows knowledge All Rights Reserved