VMWARE Linux Guest - Adicionar um novo disco rígido no linux sem reiniciar o Guest

Fontes:

https://www.cyberciti.biz/tips/vmware-add-a-new-hard-disk-without-rebooting-guest.html

http://www.unixarena.com/2013/06/how-to-scan-new-fc-luns-and-scsi-disks.html

Ambiente testado

- Vmware ESXi 6.0.0

- Red Hat Enterprise Linux Server release 6.4 (Santiago)

Listar discos

# fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-'

Deletar discos

* echo 1 > /sys/block/devName/device/delete

Exemplo:

# e2fsck -f -p /dev/sdc

# echo 1 > /sys/block/sdc/device/delete

Escanear novos discos

Opção 1

# yum install sg3_utils

# rescan-scsi-bus.sh

# tail -f /var/log/message

Opção 2

# ls /sys/class/scsi_host

host0 host1 host2

# echo "- - -" > /sys/class/scsi_host/host0/scan

# echo "- - -" > /sys/class/scsi_host/host1/scan

# echo "- - -" > /sys/class/scsi_host/host2/scan

# tail -f /var/log/message

Opção 3 (Não testei)

* echo "scsi add-single-device <H> <B> <T> <L>" > /proc/scsi/scsi

Onde:

<H> : Host

<B> : Bus (Channel)

<T> : Target (Id)

<L> : LUN numbers

Exemplo:

* Add /dev/sdc with host # 0, bus # 0, target # 2, and LUN # 0, enter:

# echo "scsi add-single-device 0 0 2 0">/proc/scsi/scsi