Tuesday, October 29, 2013

partedUtil and vmkfstools in 5.1

The following examples show how to use partedUtil and vmkfstools to perform vmfs related operations in 5x.  I started with two disks (each 8gbs) and followed the lab shown in the Install Configure Manage class that Vmware offers. The goal was never to use the vsphere client nor the web client.

Step 1: One disk did not have a file system, the other did. Hence, I needed to delete the partition in one of those drives to start from scratch.

cd /dev/disks ; ls
partedUtil delete ./naa.6000eb3a2b3b330e00000000000000cb 1

Step 2: To verify if a disk had a partition table or not, I used the following command.

# partedUtil getptbl naa.6000eb3a2b3b330e00000000000000cf
gpt
1044 255 63 16777216

Step 3: In that class, they take a 8 gb disk and they first create a 4gb partition. Then I created a vmfs filesystem. I named it after the person that helped me out do it.

 # partedUtil setptbl ./naa.6000eb3a2b3b330e00000000000000cf gpt "1 2048 83
88608 AA31E02A400F11DB9590000C2911D1B8 0"

 # vmkfstools -C vmfs5 -S davidvmfs -b 1M ./naa.6000eb3a2b3b330e00000000
000000cf:1

Step 4: In that class, the goal is to resize that filesystem to use 100% of that disk. Hence, the partition has to be grown and so is the file system.

 partedUtil resize ./naa.6000eb3a2b3b330e00000000000000cf 1 2048 16777128

# vmkfstools -G naa.6000eb3a2b3b330e00000000000000cf:1 naa.6000eb3a2b3b330
e00000000000000cf:1

Step 5: Lastly, the idea is to add a second disk to the first disk to grow the file system to
be around 16gbs of space. Make sure you add the new drive to the one with data.

# partedUtil setptbl naa.6000eb3a2b3b330e00000000000000d1 gpt "1 2048
16771128 AA31E02A400F11DB9590000C2911D1B8 0"
gpt
0 0 0 0
1 2048 16771128 AA31E02A400F11DB9590000C2911D1B8 0

# vmkfstools -Z /dev/disks/naa.6000eb3a2b3b330e00000000000000d1:1 /dev/disks/na
a.6000eb3a2b3b330e00000000000000cf:1

VMware ESX Question:
All data on /dev/disks/naa.6000eb3a2b3b330e00000000000000d1:1 will be lost. Continue and format?

0) _Yes
1) _No

Select a number from 0-1: 0