0
0

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 3 years have passed since last update.

AzureVMに複数アタッチしたディスクの見分け方(Linux編)

Posted at

AzureVMにデータディスクを複数アタッチした際にディスクを見分ける方法をご紹介します。

まずVMを作成します。
image.png

そこに3つデータディスクをアタッチします。
image.png

OSから見てみます。

[root@vm4testdd ~]# fdisk -l
・・・(中略)・・・

Disk /dev/sdc: 32 GiB, 34359738368 bytes, 67108864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sdd: 32 GiB, 34359738368 bytes, 67108864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sde: 32 GiB, 34359738368 bytes, 67108864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

・・・(中略)・・・

うーん、サイズが同じなので見分けがつかない・・・。
そういう時は/dev/disk/azure/scsi1/を見てみます。

[root@vm4testdd ~]# ll /dev/disk/by-path
total 0
lrwxrwxrwx. 1 root root 12 Oct  6 02:19 lun0 -> ../../../sdc
lrwxrwxrwx. 1 root root 12 Oct  6 02:12 lun1 -> ../../../sdd
lrwxrwxrwx. 1 root root 12 Oct  6 02:12 lun2 -> ../../../sde

ポータルのディスク一覧のLUNとデバイス名の対応がわかりますね。
image.png

一応/dev/disk/by-pathでもわかりますが、OSディスクなどの情報も出てくるため、
/dev/disk/azure/scsi1の方が一目瞭然ですね。

/dev/disk/by-path:
lrwxrwxrwx. 1 root root  9 Oct  6 02:12 acpi-VMBUS:01-vmbus-00000000000088990000000000000000-lun-0 -> ../../sdb
lrwxrwxrwx. 1 root root 10 Oct  6 02:12 acpi-VMBUS:01-vmbus-00000000000088990000000000000000-lun-0-part1 -> ../../sdb1
lrwxrwxrwx. 1 root root 11 Oct  6 02:12 acpi-VMBUS:01-vmbus-00000000000088990000000000000000-lun-0-part14 -> ../../sdb14
lrwxrwxrwx. 1 root root 11 Oct  6 02:12 acpi-VMBUS:01-vmbus-00000000000088990000000000000000-lun-0-part15 -> ../../sdb15
lrwxrwxrwx. 1 root root 10 Oct  6 02:12 acpi-VMBUS:01-vmbus-00000000000088990000000000000000-lun-0-part2 -> ../../sdb2
lrwxrwxrwx. 1 root root  9 Oct  6 02:12 acpi-VMBUS:01-vmbus-00000000000188990000000000000000-lun-0 -> ../../sda
lrwxrwxrwx. 1 root root 10 Oct  6 02:12 acpi-VMBUS:01-vmbus-00000000000188990000000000000000-lun-0-part1 -> ../../sda1
lrwxrwxrwx. 1 root root  9 Oct  6 02:19 acpi-VMBUS:01-vmbus-f8b3781b1e824818a1c363d806ec15bb-lun-0 -> ../../sdc
lrwxrwxrwx. 1 root root  9 Oct  6 02:12 acpi-VMBUS:01-vmbus-f8b3781b1e824818a1c363d806ec15bb-lun-1 -> ../../sdd
lrwxrwxrwx. 1 root root  9 Oct  6 02:12 acpi-VMBUS:01-vmbus-f8b3781b1e824818a1c363d806ec15bb-lun-2 -> ../../sde
lrwxrwxrwx. 1 root root  9 Oct  6 02:12 pci-0000:00:07.1-ata-2 -> ../../sr0

デバイス名のマッピングはOS再起動により変わる可能性もあるので、
ファイルシステムにマウントする際はUUIDを指定するようにしましょう。

/dev/disk/by-uuid:
lrwxrwxrwx. 1 root root 10 Oct  6 02:19 9ac10116-694f-464a-932e-9b4383b28ac3 -> ../../sdc1
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?