Linux / Unix‎ > ‎

VMware Guest

VMWARE TOOLS

ln -s /sbin/killall5 /sbin/killall
sudo apt-get install build-essential linux-headers-$(uname -r)

UDEV

    sudo rm /etc/udev/rules.d/70-persistent-net.rules

Add hard disk without rebooting guest

find scsi_host value

ls /sys/class/scsi_host

Rescan the SCSI Bus to Add a SCSI Device Without rebooting the VM

echo "- - -" > /sys/class/scsi_host/host#/scan
fdisk -l
tail -f /var/log/message

Delete a Single Device (ie : sdc)

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

Add a Single Device

echo "scsi add-single-device <H> <B> <T> <L>" > /proc/scsi/scsi
Where,: Host * : Bus (Channel) * : Target (Id) * : LUN numbers
For e.g. 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
# fdisk -l
# cat /proc/scsi/scsi

Extend a linux partition without rebooting (not / )

extend disk from VMware interface,in virtual machine, suppose it is /dev/sdb disk with only one partition /dev/sdc1 : 

umount /dev/sdc1
echo 1 > /sys/block/sdc/device/delete
echo "- - -" > /sys/class/scsi_host/host#/scan
Delete paritition en recreate it to the new size:
fdisk /dev/sdc ...
Resize partition
e2fsck -f /dev/sdc1
resize2fs /dev/sdc1

Comments