# fsck on software mirror with one drive no root password?

## carpman

Hello, i have to fix a server that was running software mirror raid, one drive has failed with mechanical problems, the other requires an fsck as will not boot until this is done.

Problem is i do not have the root password so cannot enter maintenance mode for manual fsck. I tried booting into single user, but it still requires a manual fsck.

I have booted a livecd and can see partions:

fdisk -l

Code:

device     id    system

/dev/sda1  fd    linux raid autodetect

/dev/sda2  fd    linux raid autodetect

/dev/sda3  fd    linux raid autodetect

How can do an fsck on this drive?

many thanks

----------

## NeddySeagoon

carpman,

On no account do anything to /dev/sda* driectly.

You must start the raid sets that actually hold the filesystem. With one drive missing, they will start in degraded mode, but raid is supped to work like that.

Now you can fsck the filesystems on your /dev/mdX nodes.

fsck is a dangerous tool, it often makes things worse, not better. If you have the space, make a drive image before you run fsck.

----------

## carpman

 *NeddySeagoon wrote:*   

> carpman,
> 
> On no account do anything to /dev/sda* driectly.
> 
> You must start the raid sets that actually hold the filesystem. With one drive missing, they will start in degraded mode, but raid is supped to work like that.
> ...

 

Thanks for reply.

How do get raid set started?

Would i sue the mdadm -assemble command?

some details when booted with livecd

```
mdadm --examine /dev/sda1

/dev/sda1:

          Magic : a92b4efc

        Version : 0.90.00

           UUID : 288399c7:1a978357:3bbfdc24:612dec35

  Creation Time : Sat Oct  2 13:34:27 2010

     Raid Level : raid1

  Used Dev Size : 48128 (47.01 MiB 49.28 MB)

     Array Size : 48128 (47.01 MiB 49.28 MB)

   Raid Devices : 2

  Total Devices : 1

Preferred Minor : 1

    Update Time : Mon Mar 12 04:22:02 2012

          State : clean

 Active Devices : 1

Working Devices : 1

 Failed Devices : 1

  Spare Devices : 0

       Checksum : 2539a21a - correct

         Events : 294

      Number   Major   Minor   RaidDevice State

this     0       8        1        0      active sync   /dev/sda1

   0     0       8        1        0      active sync   /dev/sda1

   1     1       0        0        1      faulty removed
```

```

fdisk -l

Device Boot      Start         End      Blocks   Id  System

/dev/sda1               1       96389       48194+  fd  Linux raid autodetect

/dev/sda2           96390     2152709     1028160   fd  Linux raid autodetect

/dev/sda3   *     2152710    44098424    20972857+  fd  Linux raid autodetect

/dev/sda4        44098425   145211534    50556555   fd  Linux raid autodetect

```

cheers

----------

## NeddySeagoon

carpman,

mdadm --assemble will do nicely.

You may need to pass it the missng tag in place of the second device.

Do that 4 times - once for each raid set.

```
man mdadm
```

will tell you how to assemble a raid set in degraded mode.

As the raid superblock version is 

```
Version : 0.90.00
```

 the raid sets may auto assemble anyway. That depends on the kernel options.

Look for some /dev/md* devices before you try mdadm.  If they are there, thats what you need to run fsck on, preferrably adter you have made images with dd, or an image of the entire drive.

If you don't have any /dev/md* entries, go ahead with assembling them.

----------

