Skip to content

            Lost ?  |  Need an account:
 
Home >> Knowledge Base >> Operating Systems >> Linux >> Starting and Stopping RAID Arrays
Starting and Stopping RAID Arrays PDF Print E-mail
(6 votes, average 4.50 out of 5)
Written by Tom Hirt   
Monday, 15 June 2009 19:20

 

How-to Start and Stop Linux Software RAID Devices


If you have followed along in our Linux RAID How-to, your RAID array should start and stop automatically as your system boots and shuts down.  However, should you want to reconfigure the array or remove it all together, you will need to know how to start and stop the array manually.  In this KB we will show how to start and stop the array, you can refer to the Linux RAID How-to for configuration references and links to other RAID KB articles.  Let's get started!


Starting the RAID Array


Assuming you have added the DEVICE and ARRAY entries to the /etc/mdadm.conf as specified in the Linux RAID How-to, starting the array can be accomplished with a single command:
  1. Use mdadm to start the RAID device

    [root@Linux01 /]# mdadm --assemble --scan
    mdadm: /dev/md0 has been started with 3 drives.
    [root@Linux01 /]#

For those who have not added the array configuration information to the /etc/mdadm.conf file there is still hope yet.  Starting the array without a /etc/mdadm.conf file is a two step process.  You must first find the UUID of the array you wish to start, and then start the array with the UUID qualifier.

  1. Assuming we know one of the devices that make up the array, we can examine the device and extract the UUID with the mdadm tool

    [root@Linux01 ~]# mdadm --query /dev/sdb1
    /dev/sdb1:

    Magic : a92b4efc
    Version
    : 00.90.00
    UUID
    : 25ab199d:9cf31f9d:5fefdf2f:865b1a2e
    Creation Time
    : Tue Jun 16 13:24:49 2009
    Raid Level
    : raid5
    Used Dev Size
    : 4192832 (4.00 GiB 4.29 GB)
    Array Size
    : 8385664 (8.00 GiB 8.59 GB)
    Raid Devices : 3
    Total Devices
    : 3
    Preferred Minor : 0
    :
    Update Time
    : Tue Jun 16 13:32:17 2009
    State
    : clean
    Active Devices
    : 3
    Working Devices
    : 3
    Failed Devices
    : 0
    Spare Devices
    : 0
    Checksum
    : e6c5297b - correct
    Events
    : 0.2
    :
    Layout
    : left-symmetric
    Chunk Size
    : 64K
    :
    Number Major
    Minor
    RaidDevice
    State
    this
    0
    8
    17 0
    active sync   /dev/sdb1
    .
    0
    0
    8
    17 0
    active sync   /dev/sdb1
    1
    1
    8 33 1 active sync   /dev/sdc1
    2
    2
    8 49 2 active sync   /dev/sdd1

  2. Use the UUID from step #1 to start the array

    [root@Linux01 /]# mdadm /dev/md0 --assemble -u 25ab199d:9cf31f9d:5fefdf2f:865b1a2e
    mdadm: /dev/md0 has been started with 3 drives.
    [root@Linux01 /]#

  3. Add the array configuration information to /etc/mdadm.conf so you do not have to reference this KB again ;-)

    [root@Linux01 /]# mdadm --detail --scan >> /etc/mdadm.conf
    [root@Linux01 /]#

 

Stopping the RAID array


Stopping the RAID array is fairly straight forward, unmount the array and then issue the mdadm stop command.

  1. Check to see if the RAID device is mounted

    [root@Linux01 TCPDumpLV]# df -kh
    Filesystem
    Size
    Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol04
    3.9G 2.2G 1.6G 59% /
    /dev/sda1 99M
    12M
    82M
    13% /boot
    tmpfs 1006M
    0
    1006M
    0% /dev/shm
    /dev/mapper/VolGroup00-LogVol00 992M
    41M
    901M
    5%
    /home
    /dev/mapper/VolGroup00-LogVol02 992M
    69M
    872M
    8%
    /tmp
    /dev/mapper/VolGroup00-LogVol03 2.0G
    152M
    1.7G
    9%
    /var
    /dev/md0 7.9G
    147M
    7.4G
    2%
    /RAID5
    Note: You can see /dev/md0 is mounted on /RAID5

  2. Unmount the RAID device

    [root@Linux01 ~]# umount /dev/md0
    [root@Linux01 ~]#

  3. Stop the RAID device

    [root@Linux01 /]# mdadm -S /dev/md0
    mdadm: stopped /dev/md0
    [root@Linux01 /]#
Nice work, you now know how to start and stop a Linux RAID Array.  Good luck!

Add this page to your favorite website
AddThis Social Bookmark Button
Comments
Add New Search
Ashwin |15/02/2011 11:20:13
Excellent tutorial. Good job.
Anonymous |31/03/2011 04:10:36
which is the command for start raid

Alpha01  - Ruby Ninja |26/04/2011 12:22:14
This article totally saved my behind.

Thanks!

-Tony
Martin Klier  - How to identify the UUID |27/06/2011 07:25:16
If you are looking for a md-device's UUID (for example for the fstab), just
ll /dev/disk/by-uuid on newer
linuxes.

Regards
Martin
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:D:):(:0:shock::confused:8):lol::x:P:oops::cry::evil::twisted::roll::wink::!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated on Thursday, 18 June 2009 12:42
 

Forum Activity

Author:
Author: kenny22
Jan.24.12
Author: AaronRiley
Jan.15.12

Online Stats

Guests Online: 67
Members Online: 0