Solved

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

Posted on 2013-01-01
7
2,467 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Suggested Solutions

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

759 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