{"id":15,"date":"2020-10-24T11:27:13","date_gmt":"2020-10-24T09:27:13","guid":{"rendered":"https:\/\/ptdb.ch\/?p=15"},"modified":"2020-10-24T11:27:13","modified_gmt":"2020-10-24T09:27:13","slug":"expanding-a-virtual-box-6-1-16-virtual-nvme-disk-without-downtime-on-centos-8-2-is-not-possible","status":"publish","type":"post","link":"https:\/\/ptdb.ch\/?p=15","title":{"rendered":"Expanding a Virtual Box (6.1.16) Virtual NVMe Disk Without Downtime on CentOS 8.2 is Not Possible"},"content":{"rendered":"<p>Today I have tried to expand a virtual disk online, a feature, which I have done on VMware for a long time,<br \/>\nbut it looks that this feature is still not possible.<\/p>\n<p>I understand that resizing a virtual disk is not possible, if it is a fixed size disk, or if it has snaphots on it,<br \/>\nbut even with a dynamic sized disk, you still can&#8217;t do it online.<\/p>\n<p>My plan was to resize the PostgreSQL Disk PGDisk02, which is a dynamic disk online.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nC:\\Program Files\\Oracle\\VirtualBox&gt;VBoxManage.exe showmediuminfo D:\\OCM\\Virtualbox\\ocm199\\PGDisk02.vdi\nUUID:           32545f8c-8791-4b3c-9a41-e5f0e6477446\nParent UUID:    base\nState:          locked write\nType:           normal (base)\nLocation:       D:\\OCM\\Virtualbox\\ocm199\\PGDisk02.vdi\nStorage format: VDI\nFormat variant: dynamic default\nCapacity:       32768 MBytes\nSize on disk:   9 MBytes\nEncryption:     disabled\nProperty:       AllocationBlockSize=1048576\nIn use by VMs:  ocm199 (UUID: 4bca963d-eb2f-4179-91a8-132f67635b09)\n<\/pre>\n<p>Unfortunately, if you try to do so, you will run into the following error:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nC:\\Program Files\\Oracle\\VirtualBox&gt;VBoxManage.exe modifymedium disk D:\\OCM\\Virtualbox\\ocm199\\PGDisk02.vdi --resize 40960\nVBoxManage.exe: error: Failed to lock media when resizing 'D:\\OCM\\Virtualbox\\ocm199\\PGDisk02.vdi'\nVBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MediumWrap, interface IMedium, callee IUnknown\nVBoxManage.exe: error: Context: &quot;Resize(cbResize, pProgress.asOutParam())&quot; at line 810 of file VBoxManageDisk.cpp\nVBoxManage.exe: error: Failed to resize medium!\n<\/pre>\n<p>You really need to shutdown the Virtual Box VM first, to get the job done. After I did so, I could resize the<br \/>\ndisk from 32GB to 40GB.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nC:\\Program Files\\Oracle\\VirtualBox&amp;gt;VBoxManage.exe modifymedium disk D:\\OCM\\Virtualbox\\ocm199\\PGDisk02.vdi --resize 40960\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\n<\/pre>\n<p>Afterwards, it is immediately reflected in the Gui.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-17 zoooom\" src=\"https:\/\/ptdb.ch\/wp-content\/uploads\/2020\/10\/Resized_40GB_Disk-300x244.jpg\" alt=\"\" width=\"300\" height=\"244\" \/><\/p>\n<p>Now we can start up the VM and do the rest of the work.<\/p>\n<p>However, like expected, in the OS it still has not the full capacity. That is very normal. You need to expand the PV disk first, and afterwards use lvextend to do the rest.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@ocm199 ~]# df -h | grep ptdbdata\n\/dev\/mapper\/pgvgdata-pglvdata   21G  183M   21G   1% \/ptdbdata\n&#x5B;root@ocm199 ~]#\n\n&#x5B;root@ocm199 ~]# cat \/etc\/fstab | grep ptdbdata\n\/dev\/pgvgdata\/pglvdata          \/ptdbdata                       xfs     defaults        0 0\n&#x5B;root@ocm199 ~]#\n\n&#x5B;root@ocm199 ~]# pvs | grep pgvgdata\n\/dev\/nvme0n9 pgvgdata lvm2 a--   &amp;lt;22.00g 1020.00m\n\n&#x5B;root@ocm199 ~]# pvresize \/dev\/nvme0n9\nPhysical volume &quot;\/dev\/nvme0n9&quot; changed\n1 physical volume(s) resized or updated \/ 0 physical volume(s) not resized\n<\/pre>\n<p>The PV disk reflects now the new size. (40GB)<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@ocm199 ~]# pvs | grep pgvgdata\n\/dev\/nvme0n9 pgvgdata lvm2 a--  40.00g 19.00g\n<\/pre>\n<p>Now we can use lvresize to extend the logical volumne to it&#8217;s full extent (100%) and at the same time extend the XFS file system.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@ocm199 ~]# lvresize --extents +100%FREE --resizefs \/dev\/pgvgdata\/pglvdata\nSize of logical volume pgvgdata\/pglvdata changed from 21.00 GiB (5376 extents) to 40.00 GiB (10239 extents).\nLogical volume pgvgdata\/pglvdata successfully resized.\nmeta-data=\/dev\/mapper\/pgvgdata-pglvdata isize=512    agcount=4, agsize=1376256 blks\n=                       sectsz=512   attr=2, projid32bit=1\n=                       crc=1        finobt=1, sparse=1, rmapbt=0\n=                       reflink=1\ndata     =                       bsize=4096   blocks=5505024, imaxpct=25\n=                       sunit=0      swidth=0 blks\nnaming   =version 2              bsize=4096   ascii-ci=0, ftype=1\nlog      =internal log           bsize=4096   blocks=2688, version=2\n=                       sectsz=512   sunit=0 blks, lazy-count=1\nrealtime =none                   extsz=4096   blocks=0, rtextents=0\ndata blocks changed from 5505024 to 10484736\n\n&#x5B;root@ocm199 ~]# df -h | grep ptdbdata\n\/dev\/mapper\/pgvgdata-pglvdata   40G  318M   40G   1% \/ptdbdata\n<\/pre>\n<p>Conclusion<\/p>\n<p>Unfortunately, the online resize feature is still not available with Virtual Box Version 6.1.16. In case I<br \/>\nhave missed something, and it is possible, then please leave a comment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I have tried to expand a virtual disk online, a feature, which I have done on VMware for a long time, but it looks that this feature is still not possible. I understand that resizing a virtual disk is not possible, if it is a fixed size disk, or if it has snaphots on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[10,5],"tags":[26],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-centos-os","category-os","tag-virtual-box","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Expanding a Virtual Box (6.1.16) Virtual NVMe Disk Without Downtime on CentOS 8.2 is Not Possible - ptdb - Platinum DB<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ptdb.ch\/?p=15\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Expanding a Virtual Box (6.1.16) Virtual NVMe Disk Without Downtime on CentOS 8.2 is Not Possible - ptdb - Platinum DB\" \/>\n<meta property=\"og:description\" content=\"Today I have tried to expand a virtual disk online, a feature, which I have done on VMware for a long time, but it looks that this feature is still not possible. I understand that resizing a virtual disk is not possible, if it is a fixed size disk, or if it has snaphots on [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ptdb.ch\/?p=15\" \/>\n<meta property=\"og:site_name\" content=\"ptdb - Platinum DB\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-24T09:27:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ptdb.ch\/wp-content\/uploads\/2020\/10\/Resized_40GB_Disk-300x244.jpg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ptdb.ch\/?p=15\",\"url\":\"https:\/\/ptdb.ch\/?p=15\",\"name\":\"Expanding a Virtual Box (6.1.16) Virtual NVMe Disk Without Downtime on CentOS 8.2 is Not Possible - ptdb - Platinum DB\",\"isPartOf\":{\"@id\":\"https:\/\/ptdb.ch\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ptdb.ch\/?p=15#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ptdb.ch\/?p=15#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ptdb.ch\/wp-content\/uploads\/2020\/10\/Resized_40GB_Disk-300x244.jpg\",\"datePublished\":\"2020-10-24T09:27:13+00:00\",\"author\":{\"@id\":\"https:\/\/ptdb.ch\/#\/schema\/person\/0b7baf52d23e71d85e1c95442306090b\"},\"breadcrumb\":{\"@id\":\"https:\/\/ptdb.ch\/?p=15#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ptdb.ch\/?p=15\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ptdb.ch\/?p=15#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ptdb.ch\/?p=15#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ptdb.ch\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Expanding a Virtual Box (6.1.16) Virtual NVMe Disk Without Downtime on CentOS 8.2 is Not Possible\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ptdb.ch\/#website\",\"url\":\"https:\/\/ptdb.ch\/\",\"name\":\"ptdb - Platinum DB\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ptdb.ch\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/ptdb.ch\/#\/schema\/person\/0b7baf52d23e71d85e1c95442306090b\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ptdb.ch\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1a3dffc48c5f6bae0b88a9f0b2a986d48d322673fbc2880c5abbfab96e45da8a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1a3dffc48c5f6bae0b88a9f0b2a986d48d322673fbc2880c5abbfab96e45da8a?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/ptdb.ch\"],\"url\":\"https:\/\/ptdb.ch\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Expanding a Virtual Box (6.1.16) Virtual NVMe Disk Without Downtime on CentOS 8.2 is Not Possible - ptdb - Platinum DB","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ptdb.ch\/?p=15","og_locale":"en_US","og_type":"article","og_title":"Expanding a Virtual Box (6.1.16) Virtual NVMe Disk Without Downtime on CentOS 8.2 is Not Possible - ptdb - Platinum DB","og_description":"Today I have tried to expand a virtual disk online, a feature, which I have done on VMware for a long time, but it looks that this feature is still not possible. I understand that resizing a virtual disk is not possible, if it is a fixed size disk, or if it has snaphots on [&hellip;]","og_url":"https:\/\/ptdb.ch\/?p=15","og_site_name":"ptdb - Platinum DB","article_published_time":"2020-10-24T09:27:13+00:00","og_image":[{"url":"https:\/\/ptdb.ch\/wp-content\/uploads\/2020\/10\/Resized_40GB_Disk-300x244.jpg","type":"","width":"","height":""}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/ptdb.ch\/?p=15","url":"https:\/\/ptdb.ch\/?p=15","name":"Expanding a Virtual Box (6.1.16) Virtual NVMe Disk Without Downtime on CentOS 8.2 is Not Possible - ptdb - Platinum DB","isPartOf":{"@id":"https:\/\/ptdb.ch\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ptdb.ch\/?p=15#primaryimage"},"image":{"@id":"https:\/\/ptdb.ch\/?p=15#primaryimage"},"thumbnailUrl":"https:\/\/ptdb.ch\/wp-content\/uploads\/2020\/10\/Resized_40GB_Disk-300x244.jpg","datePublished":"2020-10-24T09:27:13+00:00","author":{"@id":"https:\/\/ptdb.ch\/#\/schema\/person\/0b7baf52d23e71d85e1c95442306090b"},"breadcrumb":{"@id":"https:\/\/ptdb.ch\/?p=15#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ptdb.ch\/?p=15"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ptdb.ch\/?p=15#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/ptdb.ch\/?p=15#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ptdb.ch\/"},{"@type":"ListItem","position":2,"name":"Expanding a Virtual Box (6.1.16) Virtual NVMe Disk Without Downtime on CentOS 8.2 is Not Possible"}]},{"@type":"WebSite","@id":"https:\/\/ptdb.ch\/#website","url":"https:\/\/ptdb.ch\/","name":"ptdb - Platinum DB","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ptdb.ch\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ptdb.ch\/#\/schema\/person\/0b7baf52d23e71d85e1c95442306090b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ptdb.ch\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1a3dffc48c5f6bae0b88a9f0b2a986d48d322673fbc2880c5abbfab96e45da8a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1a3dffc48c5f6bae0b88a9f0b2a986d48d322673fbc2880c5abbfab96e45da8a?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/ptdb.ch"],"url":"https:\/\/ptdb.ch\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/ptdb.ch\/index.php?rest_route=\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ptdb.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ptdb.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ptdb.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ptdb.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15"}],"version-history":[{"count":0,"href":"https:\/\/ptdb.ch\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions"}],"wp:attachment":[{"href":"https:\/\/ptdb.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ptdb.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ptdb.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}