Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-01-01
7
Medium Priority
?
3,099 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:David
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:
David earned 2000 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:David
ID: 38736884
yes.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…
Suggested Courses
Course of the Month5 days, 23 hours left to enroll

772 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