Linux下清除磁盘分区及残留raid信息

Linux下清除磁盘分区及残留raid信息
适用场景:
1、 查看硬盘编号
2、 删除磁盘分区
3、 删除磁盘内残留raid信息

*本文适用于430-8i等只有低速格式化或没有格式化功能的HBA卡使用,若raid卡有格式化功能,建议使用raid卡格式化解决问题。

一、查看硬盘编号
适用lsblk命令可以查看当先系统下的磁盘相关信息及磁盘大小
Linux下清除磁盘分区及残留raid信息

sda为硬盘为系统内的第一个硬盘
sda1为该硬盘下的第一个分区以此类推

二、删除磁盘分区
1) 查看现有磁盘及分区
Linux下清除磁盘分区及残留raid信息
2) 删除对应磁盘下的分区
以删除sda 的sda1 sda2分区为例
进入:#parted /dev/sda
查看:(parted)p
删除:(parted)rm 1
(parted)rm 2
3) 适用lsblk查看是否删除成功

三、删除磁盘内残留raid信息
如果磁盘在其他raid卡中做过raid,在430-8i这类没有格式化功能的HBA卡中使用时,使用parted等相关命令无法将raid残留信息删除导致无法分区正常安装系统。
现象如下:
Linux下清除磁盘分区及残留raid信息

Raid卡残留信息的type为dmraid分区名称以`-ddf_开头

删除方法如下:
整体思路是通过dd命令将残留信息所在扇区置零
通常raid卡的信息会放在最后一个柱面即最后63个扇区

以sda为例:
1) 使用dd命令打印最后63个扇区到aaa中
dd if=/dev/sda of=aaa bs=512 skip=$(( $(blockdev –getsz /dev/sda) – 63 )) count=63
2) 使用hexedit查看aaa
Linux下清除磁盘分区及残留raid信息
发现有dpIBM等信息,为残留的raid信息

3) 将这63个扇区置零
dd if=/dev/zero of=/dev/sda bs=512 seek=$(( $(blockdev –getsz /dev/sda) – 63 )) count=63
Linux下清除磁盘分区及残留raid信息
再打印发现已经置零,清除成功。

重启节点重新加载linux中才会生效

原文链接:,转发请注明来源!

发表评论

  • 23 Responses to “Linux下清除磁盘分区及残留raid信息”
    • FsfAniny

      buying essays online <a href="https://essayhelpbgs.com/#">math help online</a> do my excel homework

      回复
    • Kwgdboop

      writing a strong essay <a href="https://researchpaperssfk.com/#">visit homepage</a> presentation online

      回复
    • FnrdAniny

      to buy viagra <a href="https://llviabest.com/#">viagra, canada</a> canadian viagra buy via paypal

      回复
    • Dvscprest

      college personal essays <a href="https://dissertationhelpvfh.com/#">custom paper writing</a> custom paper

      回复
    • FnrhAniny

      buy viagra on line <a href="https://genqpviag.com/#">viagra levitra how works</a> pfizer viagra

      回复
    • Fgsprest

      format for writing a history research paper <a href="https://writemypaperbuyhrd.com/#">essay writing my friend</a> essays practice

      回复
    • FnsbAniny

      proposal for a research paper <a href="https://customessaywriterbyz.com/#">concluding a research paper</a> boston college supplement essays

      回复
    • FmsgAniny

      viagra after tia <a href="https://siviagmen.com/#">viagra bei herzkrankheiten</a> lortab viagra

      回复
    • Jsweblafe

      viagra pfizer <a href="https://mygoviagar.com/#">generic viagra for sale cheap</a> buy cheap viagra online canadian pharmacy

      回复
    • Kbrgboop

      viagra 100mg online in canada <a href="https://miraclevigra.com/#">viagra india online purchase</a> sildenafil 50mg prices

      回复
    • Dbsfprest

      buy cheap sildenafil citrate <a href="https://lightvigra.com/#">2 viagra pills</a> over the counter viagra united states

      回复
    • FbsbAniny

      kosten viagra auf rezept <a href="https://genericrxxx.com/#">viagra prolong ejaculation</a> diovan hct viagra

      回复
    • Fdbvprest

      buy viagra pills online <a href="https://hopeviagrin.com/#">sildenafil 50 mg online uk</a> sildenafil 100mg uk paypal

      回复
    • FevbAniny

      viagra trial sample <a href="https://wowviaprice.com/#">lowest priced generic viagra master card</a> alternatives to viagra men

      回复
    • FbsgAniny

      how long does it take for a viagra pill to start working <a href="https://buybuyviamen.com/#">viagra tongue strips</a> pillenpharm viagra generika

      回复
    • Jivhblafe

      online consultation for viagra <a href="https://purevigra.com/#">le viagra est il efficace pour les femmes</a> venlafaxin und viagra

      回复
    • Kmrfboop

      viagra catalana <a href="https://purevigra.com/#">purevigra.com</a> women taking viagra stories

      回复
    • Devkprest

      viagra for sale without prescription <a href="https://paradiseviagira.com/#">can you buy viagra online in canada</a> watch a viagra erection

      回复
    • FhsbAniny

      quel site pour acheter du viagra <a href="https://buybuyviamen.com/#">buybuyviamen.com</a> can you take viagra with afib

      回复
    • Frbhprest

      substitute for viagra <a href="https://paradiseviagira.com/#">paradiseviagira.com</a> buy viagra with paypal

      回复
    • KmrfAniny

      when generic viagra http://usggrxmed.com/ <a href="http://usggrxmed.com/#">buying viagra online legal</a> generic viagra pills

      回复
    • JildcAniny

      when does viagra go generic http://fmedrx.com/ <a href="http://fmedrx.com/#">best place to buy generic viagra online</a> generic viagra canada

      回复
    • Stephenpeaky

      100mg viagra <a href=" http://sild100fast.com/# ">buy cheap viagra</a> best place to buy generic viagra online

      回复