I would like scripting the creation with no humain intervention.
When i rescan, i see the new disk.
But when i use vmkfstools :
vmkfstools -C vmfs23 -S lun0 /vmfs/devices/disk/vmhba1:0:5:0
the error is operation not permitted
I don't want to use fdisk because that's a interactive programs.
Thanks
Hallo,
you need first create the Partion and then the VMFS3.
See Page 33: http://www.rtfm-ed.eu/docs/vmwdocs/esx3.x-vc2.x-serviceconsole-guide.pdf
Regards,
Marco
Yes, but i try to make a script to create the partition.
I don't want to use fdisk because it's an interactive program and i would like create this partition in script.
Regards,
Hello,
You can use fdisk in your script. you can provide inputs to fdisk using bash script.
for eg/-
fdisk /dev/sda << **
n
p
1
startsize
endsize
w
\**
this program creates a partition 1 in /dev/sda with start size and end size provided in MBs.
in your case after creating partition, you need to change the device type since by default the created partition will take 83 as its type ( linux ) so u need to add the following lines to it.
fdisk /dev/sda << **
t
1
fb
w
**
here fb is the type of vmfs3 partition. and the script converts ur linux partition to a vmfs partition
hope this helps
I will try to do that, and i will put my script nin this topics.
thanks a lot
Regards
Hello,
The other option when scripting a fdisk is to use the 'sfdisk' command. Use 'man sfdisk' for information. Use of fdisk and sfdisk is very dangerous. So use both carefully.
Best regards,
Edward
I give you my script and thanks a lot t o all the people who help me.
Regards
The first one is :
\----
#!/bin/sh
fdisk /dev/sdi < /root/script-fdisk.sh
vmkfstools -C vmfs3 -S Lun9-fdisk5 /vmfs/devices/disks/vmhba1\:0\:6\:1
esxcfg-rescan
\----
and the second (answer to fdisk)
\----
n
p
1
t
fb
w
\----
Hey,
I am using the script as you mentioned,Its working fine,but while taking the partition id ,it is not taking vmfs ,it is taking linux (default one).I have checked the id list ,it is not showing 'fb' there.Is there any way to give partition as type as 'fb'?
Thanks for your response.