(NOTES) NOTES (2021)

Destroy linux software Raid

Some my servers has hardware Raid, for example Server issue. Lost HD boot order., but another server has software Raid. Biggest issues with software Raid is destroy Raid (if it need no more) or rebuild Raid (if it destroyed after disk errors).

If you set up software Raid once, and than not full destroy it with clear superblock, server will be switch to maintenance mode and can not be respond to SSH.



For example, after Ubuntu installation by default software Raid is working, and if in that disk earlier was be placed Raid, and you not clear Raid-superblock, only simple rebuild volume, you will receive after reboot dead server without SSH, because maintenance mode is activated.



So, main point to receive access to server is destroy software Raid. And than reload current disk structure to RAM. Only after that server reboot is possible.


Destroying Raid is possible by many ways. Main point is list Raids and stop it.


# cat /proc/mdstat
# mdadm --stop /dev/md1
# mdadm --remove /dev/md1
# mdadm --zero-superblock /dev/sdb
# cat /proc/mdstat


Than best way in start fdisk and firstly delete all partition. Than test disk performance and write zero to whole disk. Than make new filesystems and check your new disk structure.

# fdisk /dev/sdb
# dd if=/dev/zero of=/dev/sdb status=progress
# mkfs.ext4 /dev/sdb
# fdisk -l
# lsblk


Next step before reboot server is reload new partition structure to RAM and check it. There are at least three way to reload partition table to RAM.


# echo 1 > /sys/block/sdb/device/rescan
# hdparm -z /dev/sdb
# apt-get install parted
# partprobe

And only after that procedures you can reboot server to avoid maintenance mode.

And enjoy using splitted harddrives as separate devices!





Comments ( )
<00>  <01>  <02>  <03>  <04>  <05>  <06>  <07>  <08>  <09>  <10>  <11>  <12>  <13>  <14>  <15>  <16>  <17>  <18>  <19
Link to this page: http://www.vb-net.com/SoftwareRaid/Index.htm
<SITEMAP>  <MVC>  <ASP>  <NET>  <DATA>  <KIOSK>  <FLEX>  <SQL>  <NOTES>  <LINUX>  <MONO>  <FREEWARE>  <DOCS>  <ENG>  <MAIL ME>  <ABOUT ME>  < THANKS ME>