Linux filesystem read-only read-only file system

Source: Internet
Author: User


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4B/47/wKioL1QpCXmgNcaaAAJDcDQGPKI756.jpg "alt=" Wkiol1qpcxmgncaaaajdcdqgpki756.jpg "/>

Problem Description:

1, the system is unable to read and write the disk (TOUCH,CP,CHMOD) and so on

2. The server cannot start (also because the file cannot be created)

3, only related to the system disk write operation, will be error "Read-only file system"

Cause of the problem:

1, the system does not shut down properly, resulting in a file system error on the virtual disk;

2, the machine hard disk failure causes the hard disk read-only


The general situation is caused by the system's discovery of disk hardware (Riad card, hard disk) failure, or the protection mechanism taken after the file system is damaged. To protect the data from the content that is already in the partition, Linux mounts the file system with only read-only read-only loading.


Problem solving:

1, backup the system important files to the remote host

Scp-r dirname/filename [Email protected]_hostip:/backupdir

Scp-r can avoid write operation to the system

2, then restart the system, switch single-user mode.

Init 1

3, use fsck Manual repair, the specific operation is as follows:

Fsck.ext4-y/dev/vda1 (the disk partition corresponding to the root partition, which can be obtained through the df-h command)

Friendly tip: Depending on the file system to try different fsck version, if it is ext3 file system, you should use FSCK.EXT3 to repair the file system. The repair process may take a long time, please wait patiently, do not easily restart the server manually. After the repair is complete, you can restart the server by command "Shutdown-r now" reboot

4, in the course of the experiment, but also common sense use the following command to repair

Mount-o remount RW/




Extended knowledge: About FSCK
Fsck can not only scan the file system, but also fix some problems with the file system. Note that fsck must scan the file system in single-user mode, repair mode, or after umount the device. It is recommended to run in single-user mode. If you scan a system that is running correctly, it can cause system file corruption.
File system scanning tools are fsck, FSCK.EXT2, Fsck.ext3, FSCK.EXT4, Fsck.msdos, Fsck.cramfs, Fsck.ext4dev, Fsck.vfat. It is best to invoke different scanning tools based on different file systems, such as the Ext3 file system using the Fsck.ext3,ext4 file system FSCK.EXT4. /dev/vda3 is the ext3 file system, which describes the FSCK.EXT3 parameters

Fsck.ext3

Syntax
fsck.ext3[necessary parameters [selection parameters] [device code]

function
FSCK.EXT3 command: Detect and Repair against the ext3 file system

[Execute permissions] Root

Parameters

Necessary parameters
-A non-interactive mode, automatic repair-

C Check to see if there are any damaged chunks.
The-C FSCK.EXT3 command will give the entire execution process to the reverse narrative, easy to monitor the program

-d verbose display of command execution procedures

-F Force Check
-F before checking the file system, clean up the data in the Save Device block area first

-L Add tags to the corrupted chunks listed in the file

-L Clear all damage flags, re-mark
-N non-interactive mode, set the file system to be checked read-only

-P Set How much inode size the FSCK.EXT2 command can handle

-R Interactive Mode

-R Ignore Directory

-S sequential check
The-s effect is similar to specifying the "-S" parameter

-T displays timing information for the FSCK.EXT2 command.

-V Show verbose process-y close interactive mode select parameter
-b Specifies the starting address of the first magnetic region of the partition/super Block

-B Sets the size of each chunk of the partition
-I sets the number of chunks to check for the file system whose Inode buffer

-V Display version information


This article from "Fool too much, cheats not enough" blog, please be sure to keep this source http://dadonggg.blog.51cto.com/12672150/1947687

Linux filesystem read-only read-only file system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.