LoginSignup
0
0

More than 3 years have passed since last update.

MBR削除とその確認方法

Posted at

SRE的に実行したコマンドは必ず結果を確認したいやーつ

# 現在のMBRを表示
dd if=/dev/sda bs=512 count=1 | hexdump -C

# Erase MBR
dd if=/dev/zero of=/dev/sda bs=512 count=1

# 削除後のMBRを表示
dd if=/dev/sda bs=512 count=1 | hexdump -C

e.g.

# show MBR
[root@hostname:~]#  dd if=/dev/sda bs=512 count=1 | hexdump -C
1+0 records in
1+0 records out
512 bytes (512 B) copied, 8.1932e-05 s, 6.2 MB/s
00000000  eb 63 90 00 00 00 00 00  00 00 00 00 00 00 00 00  |.c..............|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
省略
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200

# erase MBR 
[root@hostname:~]# dd if=/dev/zero of=/dev/sda bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 7.9788e-05 s, 6.4 MB/s

# show MBR
[root@hostname:~]#  dd if=/dev/sda bs=512 count=1 | hexdump -C
1+0 records in
1+0 records out
512 bytes (512 B) copied, 6.5033e-05 s, 7.9 MB/s
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000200
0
0
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
0
0