Results 1 to 5 of 5

Thread: How do I delete a RAID volume that was created with mdadm?

  1. #1

    Default How do I delete a RAID volume that was created with mdadm?

    I created a RAID volume with mdadm on a debian system with this command:
    Code:
    mdadm --create --verbose /dev/md0 --level-raid6 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde
    I am trying to delete the volume and remove the RAID data from the drives and .config file.

    I've tried several things already:
    Code:
    mdadm --stop /dev/md0
    This stopped the array, removed /dev/md0 but left the 4 drives with data so I can't use them to create another RAID volume.
    Other things I've tried:
    Code:
    # mdadm --query /dev/sdb
    /dev/sdb: is not an md array
    /dev/sdb: device 0 in 4 device unknown raid6 array.  Use mdadm --examine for more detail.
    
    # mdadm --examine /dev/sdb
    /dev/sdb:
              Magic : a92b4efc
            Version : 1.2
        Feature Map : 0x0
         Array UUID : a40ee4c0:55d10aca:4e3bd4e0:2787cded
               Name : sp:0  (local to host sp)
      Creation Time : Mon Dec 30 08:06:16 2019
         Raid Level : raid6
       Raid Devices : 4
     Avail Dev Size : 287275936 (136.98 GiB 147.09 GB)
         Array Size : 574550016 (273.97 GiB 294.17 GB)
      Used Dev Size : 287275008 (136.98 GiB 147.08 GB)
        Data Offset : 2048 sectors
       Super Offset : 8 sectors
              State : clean
        Device UUID : eb2493a3:5cffe1fd:a8cf01d8:0065d7ba
        Update Time : Mon Dec 30 09:50:38 2019
           Checksum : 459a5384 - correct
             Events : 19
             Layout : left-symmetric
         Chunk Size : 512K
       Device Role : Active device 0
       Array State : AAAA ('A' == active, '.' == missing)
    
    # mdadm --zero-superblock /dev/sdb
    mdadm: Couldn't open /dev/sdb for write - not zeroing
    
    # mdadm -w /dev/sdb
    mdadm: /dev/sdb does not appear to be an md device
    
    # mdadm --assemble --run md0:
    mdadm: md0: not identified in config file.
    
    # mdadm --assemble --scan
    mdadm: No arrays found in config file or automatically
    
    # ./r6_12d_b-m.sh (BASH file that creates a RAID 6 volume with 12 drives)
    mdadm: layout defaults to left-symmetric
    mdadm: chunk size defaults to 512K
    mdadm: layout defaults to left-symmetric
    mdadm: layout defaults to left-symmetric
    mdadm: super1.x cannot open /dev/sdb: Device or resource busy
    mdadm: failed container membership check
    mdadm: device /dev/sdb not suitable for any style of array
    I just can't seem to get there from here.



    Help is truly appreciated!

  2. #2

    Default Re: How do I delete a RAID volume that was created with mdadm?

    Are you running these from an live cd / dvd running or from openSUSE or another running OS?

    Usually you would have to:

    0. find the md and it's components (sda, sdb, etc.)

    Code:
    fdisk -l
    mdadm --detail /dev/md0 or md1 or mdX
    after this you should have a list of the 4 drives that are in the array (maybe sdb is not in the array and you have in it sda sdc sdd and sde?)

    1. unmount the md (might be good to use the -l flag for lazy unmount

    Code:
    umount -l /dev/md0
    2. stop the array

    Code:
    mdadm --stop /dev/md0
    3. zero the superblock of each device from the md array
    Code:
    mdadm --zero-superblock /dev/sda
    mdadm --zero-superblock /dev/sdX ... etc.
    I do not understand why sdb was busy... did you check if the device was maybe mounted at that time?

    Cheers.

  3. #3
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,536
    Blog Entries
    15

    Default Re: How do I delete a RAID volume that was created with mdadm?

    On Thu 22 Aug 2013 07:16:02 PM CDT, JibsMan wrote:


    I created a RAID volume with mdadm on a debian system with this command:

    Code:
    mdadm --create --verbose /dev/md0 --level-raid6 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde
    I just can't seem to get there from here.



    Help is truly appreciated!
    Hi
    So if you run;
    Code:
    fdisk -l /dev/sdb
    Does it show as type RAID?

    I would imagine you should just offline the raid device (sdb) first,
    then remove from the array, not just kill off md0.....

    Do you need the data on the array? If not fdisk, delete the partitions
    and re-create type should be enough to turn them back into normal drives....

    --
    Cheers Malcolm °¿° (Linux Counter #276890)
    openSUSE 12.3 (x86_64) Kernel 3.7.10-1.16-desktop
    up 19:09, 3 users, load average: 0.34, 0.23, 0.20
    CPU AMD E2-1800@1.70GHz | GPU Radeon HD 7340


  4. #4

    Default Re: How do I delete a RAID volume that was created with mdadm?

    Thanks for the replies. I had to remove the drives and install them in a Windows system and used the RAID card in that system to clean the drives. Returned the drives to the Linux system and I could use them again. The Linux system did not have a HW RAID card.

  5. #5
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,443

    Default Re: How do I delete a RAID volume that was created with mdadm?

    Quote Originally Posted by JibsMan View Post
    The Linux system did not have a HW RAID card.
    That is because it has mdadm.

    To remove a RAID device:

    Code:
    mdadm /dev/md? --fail detached --remove detached
    (Copied from the man page.)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •