Solved

How to fsck a mounted raid device /dev/md2 ?

Posted on 2013-01-01
7
2,378 Views
Last Modified: 2016-12-08
Hi,

I would like to request an assistant.

It seems that my /var/log/messages having the following error message :

Jan  1 11:24:26 srv9 kernel: raid1: sdb: unrecoverable I/O read error for block 286895360

My cat /proc/mdstat shows as follows :

root@srv9 [~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[1] sda1[0]
      104320 blocks [2/2] [UU]

md1 : active raid1 sdb2[1] sda2[0]
      2096384 blocks [2/2] [UU]

md2 : active raid1 sda3[2](S) sdb3[1]
      310367680 blocks [2/1] [_U]


My mdadm --detail /dev/md2 shows as follows :

root@srv9 [/]# mdadm --detail /dev/md2
/dev/md2:
        Version : 0.90
  Creation Time : Fri May 30 17:11:49 2008
     Raid Level : raid1
     Array Size : 310367680 (295.99 GiB 317.82 GB)
  Used Dev Size : 310367680 (295.99 GiB 317.82 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 2
    Persistence : Superblock is persistent

    Update Time : Tue Jan  1 23:24:58 2013
          State : clean, degraded
 Active Devices : 1
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 1

           UUID : 273f6c1b:0e438923:11f1305b:25e0df37
         Events : 0.9388326

    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       8       19        1      active sync   /dev/sdb3

       2       8        3        -      spare   /dev/sda3



SUMMARY
=========


1. /var/log/messages shows sdb which having the error.
2. /proc/mdstat shows sda3[2](S) device which is degraded and becoming spare.
3. /dev/sdb3 is my actual /dev/md2 current active mounted partition .

I believe my /dev/sdb3 is having filesystem error that need to be fixed but it is actually current active raid partition.

May i know the simplest way to fsck the drive ? If possible without boot it using linux rescue disk ?

I found the following article :

http://wiki.sabayon.org/index.php?title=HOWTO:_Repair_filesystem_using_fsck_on_a_raid_setup

But in the article does not mentioned that i need to unmounted the /dev/md2 device first , afaik the fsck must be run on unmounted device to avoid data corruption.

FYI, the /dev/sdb3 is still active mounted as /dev/md2 .

Should i fsck /dev/sda3 or /dev/sdb3 ? and how ?


Appreciates anybody assistant on this.

Thank you.
0
Comment
Question by:smksa
7 Comments
 
LVL 47

Expert Comment

by:dlethe
ID: 38734569
You DON'T fsck a mounted device, at least not if you want to prevent data corruption.
  Boot the system to a USB stick with linux on it, then fsck.
0
 
LVL 2

Author Comment

by:smksa
ID: 38734574
Hi,

Do you mean the following articles is wrong ?

http://wiki.sabayon.org/index.php?title=HOWTO:_Repair_filesystem_using_fsck_on_a_raid_setup

It does not unmounted the /dev/md2 before fsck right ?
0
 
LVL 47

Accepted Solution

by:
dlethe earned 500 total points
ID: 38734602
Yes it is wrong.   Read this, it is derived from the kernel.org and the authors of the mdraid code itself ..

http://www.tldp.org/HOWTO/Software-RAID-0.4x-HOWTO-4.html
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 13

Expert Comment

by:Sandy
ID: 38735773
not recommended at all to run fsck with mounted partition.
0
 
LVL 19

Expert Comment

by:jools
ID: 38735927
What is it mounted as?

If it's prt of the operating system then you'll need to boot from other medi, if not then try unmounting it
0
 
LVL 2

Author Comment

by:smksa
ID: 38736831
Hi,

It is mounted as "/" .

So i guest eventhough it is a raid array, i still need to boot using other media and fsck it.
0
 
LVL 47

Expert Comment

by:dlethe
ID: 38736884
yes.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question