APP: MDADM (Linux Raid)

Home Forums Operating Systems Linux APP: MDADM (Linux Raid)

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #914
    Voodoo
    Keymaster

    Preparing Hard Disk for MDADM “Linux Raid Auto”, make sure the drive has an MS-DOS Partition Table. You will need to do this for each drive. In this example we are looking at drive “sdX”. All # commands are in

    sudo su

    #

    fdisk /dev/sdX

    Press ‘n‘ for creating new partition.
    Then choose ‘P‘ for Primary partition.
    Next select the partition number as 1.
    Give the default value by just pressing two times Enter key.
    Next press ‘P‘ to print the defined partition.

    Type ‘t‘to choose the partitions.
    Press ‘L‘ to list all available types.
    Choose ‘fd‘ for Linux raid auto and press Enter to apply.
    Then again use ‘P‘ to print the changes what we have made.
    Use ‘w‘ to write the changes.

    ————Creating the Raid
    #

    mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[b-c]1

    —Which means…—
    # mdadm –create /dev/md0 –level=stripe –raid-devices=2 /dev/sd[b-c]1

    Check the Raid
    #

    cat /proc/mdstat

    Or Check the Raid Details
    #

    mdadm --detail /dev/md0

    ————Assign a Filesystem (xfs in this case) to the RAID
    #

    mkfs.xfs /dev/md0

    #

    mkdir /home/%USER&/raid0

    <-Location where you want to mount
    #

    mount /dev/md0 /home/%USER%/raid0/

    ————Verify the Mount
    #

    df -h

    ————Add Mount at Boot
    #

    gedit /etc/fstab
    /dev/md0                /home/%USER&/raid0              xfs    defaults,x-gvfs-show         0 0

    ——OR——-

    UUID=XXXXXXX                /home/%USER&/raid0              xfs    defaults,x-gvfs-show         0 0

    ————Ensure you have control of Raid
    #

    chown -R %USER%:%USER% /home/%USER%/raid0/

    ======================================================
    To Remove an mdadm raid,
    1) Stop the mdadm raid device:

    sudo mdadm --stop /dev/md0

    2) Remove the mdadm raid device (should give you an mdadm: error opening md0: No such file or directory)

    sudo mdadm --remove /dev/md0

    3) Remove the superblocks (only on the drives used)

    sudo mdadm --zero-superblock /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sdd1

    4) Verify raid was removed:

    sudo cat /proc/mdstat

    5) Now I used GParted > Manage Flags to remove the “raid” flag
    6) Followed by GParted > Device > Create New Partition Table > msdos to get the drive to a standard blank drive

    • This topic was modified 2 weeks, 3 days ago by Voodoo.
    • This topic was modified 2 weeks, 1 day ago by Voodoo.
    • This topic was modified 2 weeks, 1 day ago by Voodoo.
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar