Solved

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

Posted on 2013-01-01
7
2,138 Views
Last Modified: 2013-01-16
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now