Advertisement
Guest User

OVA resizing

a guest
Aug 22nd, 2013
3,549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.75 KB | None | 0 0
  1. This is a non official procedure (which is working) which allows users to extend their VMware disk in order to be able to add more Volumes.
  2.  
  3. 1. OVA installation does not allow us to change disk size from default 100GB.
  4.  
  5. 2. Using CLI, we can also check the disk size:
  6. [root@apple:INOPERATIVE:Standalone] config # vgdisplay
  7. --- Volume group ---
  8. VG Name vg-db-sda
  9. System ID (none)1338361604
  10. Format lvm1
  11. VG Access read/write
  12. VG Status resizable
  13. MAX LV 255
  14. Cur LV 17
  15. Open LV 8
  16. Max PV 255
  17. Cur PV 1
  18. Act PV 1
  19. VG Size 98.77 GB
  20. PE Size 4.00 MB
  21. Total PE 25284
  22. Alloc PE / Size 19828 / 77.45 GB
  23. Free PE / Size 5456 / 21.31 GB
  24. VG UUID G45wy5-orj4-z0Wq-XQ4g-vKqK-C3Qo-NIeYh0
  25.  
  26. [root@edge:INOPERATIVE:] config # fdisk /dev/sda
  27.  
  28. The number of cylinders for this disk is set to 13054.
  29. There is nothing wrong with that, but this is larger than 1024,
  30. and could in certain setups cause problems with:
  31. 1) software that runs at boot time (e.g., old versions of LILO)
  32. 2) booting and partitioning software from other OSs
  33. (e.g., DOS FDISK, OS/2 FDISK)
  34.  
  35. Command (m for help): p
  36.  
  37. Disk /dev/sda: 107.3 GB, 107374182400 bytes
  38. 255 heads, 63 sectors/track, 13054 cylinders
  39. Units = cylinders of 16065 * 512 = 8225280 bytes
  40.  
  41. Device Boot Start End Blocks Id System
  42. /dev/sda1 * 1 28 224909+ b W95 FAT32
  43. /dev/sda2 29 158 1044225 82 Linux swap / Solaris
  44. /dev/sda3 159 13052 103571055 8e Linux LVM
  45.  
  46. 3. Increase the hard disk size of the virtual machine. and then reboot the virtual machine. (in this example, we used 300GB)
  47.  
  48. 4. Once it is rebooted, run fdisk command to add a new partition: primary, partition 4. Then accept the default values. (Last cylinder size is differed how much size you assigned to the virtual machine)
  49. [root@apple:INOPERATIVE:Standalone] config # fdisk /dev/sda
  50.  
  51. The number of cylinders for this disk is set to 39162.
  52. There is nothing wrong with that, but this is larger than 1024,
  53. and could in certain setups cause problems with:
  54. 1) software that runs at boot time (e.g., old versions of LILO)
  55. 2) booting and partitioning software from other OSs
  56. (e.g., DOS FDISK, OS/2 FDISK)
  57.  
  58. Command (m for help): m
  59. Command action
  60. a toggle a bootable flag
  61. b edit bsd disklabel
  62. c toggle the dos compatibility flag
  63. d delete a partition
  64. l list known partition types
  65. m print this menu
  66. n add a new partition
  67. o create a new empty DOS partition table
  68. p print the partition table
  69. q quit without saving changes
  70. s create a new empty Sun disklabel
  71. t change a partition's system id
  72. u change display/entry units
  73. v verify the partition table
  74. w write table to disk and exit
  75. x extra functionality (experts only)
  76.  
  77. Command (m for help): n
  78. Command action
  79. e extended
  80. p primary partition (1-4)
  81. p
  82. Selected partition 4
  83. First cylinder (13053-39162, default 13053):
  84. Using default value 13053
  85. Last cylinder or +size or +sizeM or +sizeK (13053-39162, default 39162):
  86. Using default value 39162
  87.  
  88. 5. Now, using p command to show the new partition table. Make sure the added partition type, and change it to "Linux LVM"
  89. Command (m for help): p
  90.  
  91. Disk /dev/sda: 322.1 GB, 322122547200 bytes
  92. 255 heads, 63 sectors/track, 39162 cylinders
  93. Units = cylinders of 16065 * 512 = 8225280 bytes
  94.  
  95. Device Boot Start End Blocks Id System
  96. /dev/sda1 * 1 28 224909+ b W95 FAT32
  97. /dev/sda2 29 158 1044225 82 Linux swap / Solaris
  98. /dev/sda3 159 13052 103571055 8e Linux LVM
  99. /dev/sda4 13053 39162 209728575 83 Linux
  100.  
  101. Command (m for help): t
  102. Partition number (1-4): 4
  103. Hex code (type L to list codes): L
  104.  
  105. 0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris
  106. 1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT-
  107. 2 XENIX root 39 Plan 9 82 Linux swap / So c4 DRDOS/sec (FAT-
  108. 3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT-
  109. 4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c7 Syrinx
  110. 5 Extended 41 PPC PReP Boot 85 Linux extended da Non-FS data
  111. 6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / .
  112. 7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility
  113. 8 AIX 4e QNX4.x 2nd part 88 Linux plaintext df BootIt
  114. 9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access
  115. a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e3 DOS R/O
  116. b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor
  117. c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs
  118. e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee EFI GPT
  119. f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/
  120. 10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b
  121. 11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor
  122. 12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor
  123. 14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS secondary
  124. 16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot fb VMware VMFS
  125. 17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
  126. 18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
  127. 1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
  128. 1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
  129. Hex code (type L to list codes): 8e
  130. Changed system type of partition 4 to 8e (Linux LVM)
  131.  
  132. 6. Then make sure added partition type is changed to Linux LVM with p command.
  133. Command (m for help): p
  134.  
  135. Disk /dev/sda: 322.1 GB, 322122547200 bytes
  136. 255 heads, 63 sectors/track, 39162 cylinders
  137. Units = cylinders of 16065 * 512 = 8225280 bytes
  138.  
  139. Device Boot Start End Blocks Id System
  140. /dev/sda1 * 1 28 224909+ b W95 FAT32
  141. /dev/sda2 29 158 1044225 82 Linux swap / Solaris
  142. /dev/sda3 159 13052 103571055 8e Linux LVM
  143. /dev/sda4 13053 39162 209728575 8e Linux LVM
  144.  
  145. 7. Now, run w command to save the new partition table. Then reboot the box for the changes to take place.
  146. Command (m for help): w
  147. The partition table has been altered!
  148.  
  149. Calling ioctl() to re-read partition table.
  150.  
  151. WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
  152. The kernel still uses the old table.
  153. The new table will be used at the next reboot.
  154. Syncing disks.
  155. [root@apple:Active:Standalone] config # reboot
  156.  
  157. 8. Once unit is rebooted, create a new physical volume using pvcreate command with key "-M1" extension, since fdisk create -M2 by default and need to have the same metadatatype.
  158. [root@apple:Active:Standalone] config # pvcreate /dev/sda4 -M1
  159. Physical volume "/dev/sda4" successfully created
  160.  
  161. 9. Makes sure the VG name and then add the new pv to volume group so that we can increase the disk size by vgextend.
  162. [root@apple:Active:Standalone] config # vgdisplay
  163. --- Volume group ---
  164. VG Name vg-db-sda
  165. System ID (none)1338361604
  166. Format lvm1
  167. VG Access read/write
  168. VG Status resizable
  169. MAX LV 255
  170. Cur LV 17
  171. Open LV 9
  172. Max PV 255
  173. Cur PV 1
  174. Act PV 1
  175. VG Size 98.77 GB
  176. PE Size 4.00 MB
  177. Total PE 25284
  178. Alloc PE / Size 19828 / 77.45 GB
  179. Free PE / Size 5456 / 21.31 GB
  180. VG UUID G45wy5-orj4-z0Wq-XQ4g-vKqK-C3Qo-NIeYh0
  181.  
  182. [root@apple:Active:Standalone] config # vgextend vg-db-sda /dev/sda4
  183. Volume group "vg-db-sda" successfully extended
  184.  
  185. 10. Now you can see the VG size has been increased.(from 98.77GB to 298.77GB)
  186. [root@apple:Active:Standalone] config # vgdisplay
  187. --- Volume group ---
  188. VG Name vg-db-sda
  189. System ID (none)1338361604
  190. Format lvm1
  191. VG Access read/write
  192. VG Status resizable
  193. MAX LV 255
  194. Cur LV 17
  195. Open LV 9
  196. Max PV 255
  197. Cur PV 2
  198. Act PV 2
  199. VG Size 298.77 GB
  200. PE Size 4.00 MB
  201. Total PE 76486
  202. Alloc PE / Size 19828 / 77.45 GB
  203. Free PE / Size 56658 / 221.32 GB
  204. VG UUID G45wy5-orj4-z0Wq-XQ4g-vKqK-C3Qo-NIeYh0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement