Posted on

mdadm软RAID的删除方法和注意事项

删除整个RAID:


mdadm/dev/md0–fail/dev/sdb–remove/dev/sdb
mdadm/dev/md0–fail/dev/sdc–remove/dev/sdc
mdadm/dev/md0–fail/dev/sdc–remove/dev/sdd
mdadm/dev/md0–fail/dev/sde–remove/dev/sde
mdadm/dev/md0–fail/dev/sdf–remove/dev/sdf


mdadm–stop/dev/md0
mdadm–remove/dev/md0


mdadm–misc–zero-superblock/dev/sdb
mdadm–misc–zero-superblock/dev/sdc
mdadm–misc–zero-superblock/dev/sdd
mdadm–misc–zero-superblock/dev/sde
mdadm–misc–zero-superblock/dev/sdf


即:先删除RAID中的所有设备,然后停止该RAID即可

为了防止系统启动时候启动raid
rm-f/etc/mdadm.conf
rm-f/etc/raidtab

检查系统启动文件中是否还有其他mdad启动方式
vi/etc/rc.sysinit+/raid\c

 

 
Posted on

How to remove GPT partition table in Linux

I have an USB stick device which has an HFS volume with GPT partition table. I want to write an iso image to the stick with:

$ sudo dd if=debian-8.2.0-amd64-CD-1.iso of=/dev/sdb bs=8M

Command completed successfully but when I re-insert usb stick, it still tries to use information from GPT partition table.

So, I used gdisk utilitiy’s zap (destroy) GPT data structures option to remove GPT partition like below:

sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): x

Expert command (? for help): z
About to wipe out GPT on /dev/sdb. Proceed? (Y/N): Y
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
Blank out MBR? (Y/N): Y

After that I created a new DOS partition through fdisk and write iso image with dd. However, when I try to reinsert USB stick, it still identified with old information (as an hfsplus volume) in kernel:

GPT:Alternate GPT header not at the end of the disk.
GPT:1390003 != 15654847
GPT: Use GNU Parted to correct GPT errors.
sdb: sdb1 sdb2 sdb3
sd 13:0:0:0: [sdb] Attached SCSI removable disk
ISOFS: Unable to identify CD-ROM format.
hfsplus: invalid secondary volume header
hfsplus: unable to find HFS+ superblock