So you need to add an additional hard disk to your VM running the SUSE family of operating system, but its in production and you can not reboot it.
So how do you go about it?
Well, it is rather easy!
First, open the "edit settings" window, within the vm, either from the console menu, or by right clicking in the vm through the virtual infrastructure client. Add a hard disk and configure it with the size you require. Finally accept the changes and close the window. After a few seconds, the virtual infrastructure client will shown the reconfiguration being complete.
Now logon to the operating system of the vm, as the root user - or use sudo.
You will see that the vm does not see the new disk, ie running the command:
fdisk -l
Shows only the existing disks, there is no sign of the new one.
What we need to do is, re-scan the SCSI bus, without rebooting the vm. To do this run the following command:
echo "- - -" >/sys/class/scsi_host/host#/scan
Where the # is replaced with the SCSI host value, usually 0
Now we re-run the command:
fdisk -l
We can now see our additional disk and can carry on configuring it using the usual tools, I.e. fdisk and mkfs or partitioner through yast, etc
Thank you very much, I have been looking for something like that for ages !
ReplyDeleteWorks perfectly (do not forget the spaces between the dashes people!).
Nice! Worked for me. Reiterating that the dashes within quotes have a space between two dashes.
ReplyDeleteWorked for me too. Thanks!
ReplyDeleteFantastic time saver. Thanks!
ReplyDeleteWorked great.
ReplyDeleteDoes NOT work for me. Tried multiple times with multiple hosts (0,1,2)
ReplyDeletein the suse 12 this command not work...
ReplyDeleteto solve my issue i run the command above:
rescan-scsi-bus.sh --forcerescan
that didnt work
DeleteThanks and that i have a neat present: What Home Renovation Expenses Are Tax Deductible remodeling construction companies
ReplyDelete