5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

DISKのメタデータ (zfs, GPT)を削除

Last updated at Posted at 2017-03-26

現象

  • debian8 で zfs を昔使っていた。

  • その後zfsを使わずext4で使っていた。

  • debian9 をクリーンインストールした後、blkidでUUIDが表示されないことに気がついた。

  • dd if=/dev/zero of=/dev/sda bs=1M count=1000 とかしても消えなかったので調査したところ、wipefsコマンドで消せることにたどり着いた。

  • HDD mount problem (bad FSTYPE) / System Administration / Arch Linux Forums

確認

# wipefs /dev/sda1
offset               type
----------------------------------------------------------------
0x7470abfc00         zfs_member   [filesystem]
                     LABEL: tank500
                     UUID:  7915798765570182767

0x438                ext4   [filesystem]
                     UUID:  d307f4b7-0862-4a5a-bcd3-fbdc3b842c12

消去

# wipefs -a /dev/sda1
/dev/sda1: 2 bytes were erased at offset 0x00000438 (ext4): 53 ef
/dev/sda1: 8 bytes were erased at offset 0x7470abfc00 (zfs_member): 0c b1 ba 00 00 00 00 00
/dev/sda1: 8 bytes were erased at offset 0x7470abf800 (zfs_member): 0c b1 ba 00 00 00 00 00
/dev/sda1: 8 bytes were erased at offset 0x7470abf400 (zfs_member): 0c b1 ba 00 00 00 00 00
/dev/sda1: 8 bytes were erased at offset 0x7470abf000 (zfs_member): 0c b1 ba 00 00 00 00 00
/dev/sda1: 8 bytes were erased at offset 0x7470abec00 (zfs_member): 0c b1 ba 00 00 00 00 00
/dev/sda1: 8 bytes were erased at offset 0x7470abe800 (zfs_member): 0c b1 ba 00 00 00 00 00
/dev/sda1: 8 bytes were erased at offset 0x7470abe400 (zfs_member): 0c b1 ba 00 00 00 00 00
/dev/sda1: 8 bytes were erased at offset 0x7470abe000 (zfs_member): 0c b1 ba 00 00 00 00 00
/dev/sda1: 8 bytes were erased at offset 0x7470abdc00 (zfs_member): 0c b1 ba 00 00 00 00 00
/dev/sda1: 8 bytes were erased at offset 0x7470abd800 (zfs_member): 0c b1 ba 00 00 00 00 00
/dev/sda1: 8 bytes were erased at offset 0x7470abd400 (zfs_member): 0c b1 ba 00 00 00 00 00
/dev/sda1: 8 bytes were erased at offset 0x7470abd000 (zfs_member): 0c b1 ba 00 00 00 00 00
...

確認、再フォーマット

wipefs /dev/sda1
mkfs.ext4 /dev/sda1
blkid

blkid で UUID 値が表示されることを確認。

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?