
我看到了有關如何刪除軟體 raid 的說明,其中一些包含兩個說明:wipefs -af <device>
和mdadm --zero-superblock --force <device>
。
有必要兩者都使用嗎?它們的結果有何不同?
這裡我有 /dev/sda3 和 /dev/sdb3 組成的 raid。我做了一個小測試,看起來結果是一樣的。
machine1:~# wipefs /dev/sda3 # <-- see the signature on sda3
offset type
----------------------------------------------------------------
0x1000 linux_raid_member [raid]
LABEL: machine1:md_system
UUID: 54f255a8-c32d-2a67-f728-151f89a7471b
machine1:~# wipefs -af /dev/sda3 # <-- wipe signature using wipefs
/dev/sda3: 4 bytes were erased at offset 0x00001000 (linux_raid_member): fc 4e 2b a9
machine1:~# wipefs /dev/sda3 # <-- as you can see, signature was erased
machine1:~#
machine1:~# wipefs /dev/sdb3 # <-- see signature on sdb3
offset type
----------------------------------------------------------------
0x1000 linux_raid_member [raid]
LABEL: machine1:md_system
UUID: 54f255a8-c32d-2a67-f728-151f89a7471b
machine1:~# mdadm --misc --zero-superblock --force /dev/sdb3 # <-- wipe signature using mdadm
machine1:~# wipefs /dev/sdb3 # <-- as you can see, signature was also erased
machine1:~#
答案1
兩條指令都會導致歸零這超級塊,這意味著刪除簽名這裡的檔案系統的元數據有關襲擊。