All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dev-manual: add instructions for compacting WSLv2 VHDX files using DiskPart for those systems which lack optimize-vhd
@ 2022-03-09  2:42 Tony McDowell
  2022-03-09  7:54 ` [docs] " Michael Opdenacker
  0 siblings, 1 reply; 6+ messages in thread
From: Tony McDowell @ 2022-03-09  2:42 UTC (permalink / raw)
  To: docs

This is an alternative way to compact VHDX files for Yocto Project use
since the prior instructions depended on a Windows tool not available
on all Windows hosts.

---
 documentation/dev-manual/start.rst | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/documentation/dev-manual/start.rst
b/documentation/dev-manual/start.rst
index 9c7dde8cf..80288b607 100644
--- a/documentation/dev-manual/start.rst
+++ b/documentation/dev-manual/start.rst
@@ -523,8 +523,7 @@ your Yocto Project build host:
       Your VHDX file path is:
       ``C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx``

-   2. *Optimize your VHDX file:* Open a Windows Powershell as
-      Administrator to optimize your VHDX file, shutting down WSL first::
+   2a. *Optimize your VHDX file using Windows Powershell:* To use the
optimize-vhd cmdlet below, first install the Hyper-V option on
Windows.  Then, open a Windows Powershell as Administrator to optimize
your VHDX file, shutting down WSL first::

          C:\WINDOWS\system32> wsl --shutdown
          C:\WINDOWS\system32> optimize-vhd -Path
C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx
-Mode full
@@ -533,6 +532,16 @@ your Yocto Project build host:
       VHDX file, and storage should now be reflected correctly on the
       Windows Explorer.

+   2b. *Optimize your VHDX file using DiskPart:* The optimize-vhd
cmdlet noted in step 2a above is provided by Hyper-V.  Not all SKUs of
Windows can install Hyper-V.  As an alternative, use the DiskPart
tool.  To start, open a Windows command prompt as Administrator to
optimize your VHDX file, shutting down WSL first::
+
+         C:\WINDOWS\system32> wsl --shutdown
+         C:\WINDOWS\system32> diskpart
+
+         DISKPART> select vdisk file="<path_to_VHDX_file>"
+         DISKPART> attach vdisk readonly
+         DISKPART> compact vdisk
+         DISKPART> exit
+
 .. note::

    The current implementation of WSLv2 does not have out-of-the-box
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [docs] [PATCH] dev-manual: add instructions for compacting WSLv2 VHDX files using DiskPart for those systems which lack optimize-vhd
  2022-03-09  2:42 [PATCH] dev-manual: add instructions for compacting WSLv2 VHDX files using DiskPart for those systems which lack optimize-vhd Tony McDowell
@ 2022-03-09  7:54 ` Michael Opdenacker
  2022-03-09 15:53   ` Tony McDowell
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Opdenacker @ 2022-03-09  7:54 UTC (permalink / raw)
  To: Tony McDowell, docs

Hi Tony,

On 3/9/22 03:42, Tony McDowell wrote:
> This is an alternative way to compact VHDX files for Yocto Project use
> since the prior instructions depended on a Windows tool not available
> on all Windows hosts.


Many thanks for this patch.

However, did you try to apply it to the "master" branch of yocto-docs?
I'm getting this error:
error: git diff header lacks filename information when removing 1
leading pathname component (line 6)

Thanks again
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [docs] [PATCH] dev-manual: add instructions for compacting WSLv2 VHDX files using DiskPart for those systems which lack optimize-vhd
  2022-03-09  7:54 ` [docs] " Michael Opdenacker
@ 2022-03-09 15:53   ` Tony McDowell
  2022-03-09 15:57     ` Michael Opdenacker
  0 siblings, 1 reply; 6+ messages in thread
From: Tony McDowell @ 2022-03-09 15:53 UTC (permalink / raw)
  To: Michael Opdenacker; +Cc: docs

On Wed, Mar 9, 2022 at 12:54 AM Michael Opdenacker
<michael.opdenacker@bootlin.com> wrote:
>
> Hi Tony,
>
> On 3/9/22 03:42, Tony McDowell wrote:
> > This is an alternative way to compact VHDX files for Yocto Project use
> > since the prior instructions depended on a Windows tool not available
> > on all Windows hosts.
>
>
> Many thanks for this patch.
>
> However, did you try to apply it to the "master" branch of yocto-docs?
> I'm getting this error:
> error: git diff header lacks filename information when removing 1
> leading pathname component (line 6)
>
> Thanks again
> Michael.
>
> --
> Michael Opdenacker, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>

Thanks, Michael.  I think the problem is that I created it with
TortoiseGit on Windows and it didn't capture the proper context of the
files.  I'll try to fix it today and resubmit.  For the etiquette of
this mailing list, should that be a new patch email or as a reply on
this one?

Thanks
Tony
-- 
_________________________
Sent from GMail Web


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [docs] [PATCH] dev-manual: add instructions for compacting WSLv2 VHDX files using DiskPart for those systems which lack optimize-vhd
  2022-03-09 15:53   ` Tony McDowell
@ 2022-03-09 15:57     ` Michael Opdenacker
  2022-03-09 23:48       ` Tony McDowell
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Opdenacker @ 2022-03-09 15:57 UTC (permalink / raw)
  To: Tony McDowell; +Cc: docs

Hi Tony,

On 3/9/22 16:53, Tony McDowell wrote:
>
> Thanks, Michael.  I think the problem is that I created it with
> TortoiseGit on Windows and it didn't capture the proper context of the
> files.  I'll try to fix it today and resubmit.  For the etiquette of
> this mailing list, should that be a new patch email or as a reply on
> this one?


Thanks for asking!
I believe it's best to send the new patch as a reply on this thread, but
this is not a very strict requirement :)

I suggest you to send your patch to yourself first, save the message to
a file, create a new branch from "master" and try to apply your patch
using "git am <file>".
Thanks in advance
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [docs] [PATCH] dev-manual: add instructions for compacting WSLv2 VHDX files using DiskPart for those systems which lack optimize-vhd
  2022-03-09 15:57     ` Michael Opdenacker
@ 2022-03-09 23:48       ` Tony McDowell
  2022-03-10  7:48         ` Michael Opdenacker
  0 siblings, 1 reply; 6+ messages in thread
From: Tony McDowell @ 2022-03-09 23:48 UTC (permalink / raw)
  To: Michael Opdenacker; +Cc: docs

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

On Wed, Mar 9, 2022 at 8:57 AM Michael Opdenacker
<michael.opdenacker@bootlin.com> wrote:
>
> Hi Tony,
>
> On 3/9/22 16:53, Tony McDowell wrote:
> >
> > Thanks, Michael.  I think the problem is that I created it with
> > TortoiseGit on Windows and it didn't capture the proper context of the
> > files.  I'll try to fix it today and resubmit.  For the etiquette of
> > this mailing list, should that be a new patch email or as a reply on
> > this one?
>
>
> Thanks for asking!
> I believe it's best to send the new patch as a reply on this thread, but
> this is not a very strict requirement :)
>
> I suggest you to send your patch to yourself first, save the message to
> a file, create a new branch from "master" and try to apply your patch
> using "git am <file>".
> Thanks in advance
> Michael.
>
> --
> Michael Opdenacker, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>

Hi Michael:

I was able to apply my patch directly against the yocto-docs repo and
it applied without issue and I saw the change show up in start.rst
like I expected.  I have attached the .patch file that TortoiseGit
generated for me if that works more easily for you.

thanks
.tony

[-- Attachment #2: 0001-dev-manual-add-instructions-for-compacting-WSLv2-VHD.patch --]
[-- Type: application/octet-stream, Size: 2242 bytes --]

From 62e89ca9691ac0d2188e43445974d41ecafc2af4 Mon Sep 17 00:00:00 2001
From: Tony McDowell <svet.am@gmail.com>
Date: Tue, 8 Mar 2022 19:25:15 -0700
Subject: [PATCH] dev-manual: add instructions for compacting WSLv2 VHDX files
 using DiskPart for those systems which lack optimize-vhd

---
 documentation/dev-manual/start.rst | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/documentation/dev-manual/start.rst b/documentation/dev-manual/start.rst
index 9c7dde8cf..80288b607 100644
--- a/documentation/dev-manual/start.rst
+++ b/documentation/dev-manual/start.rst
@@ -523,8 +523,7 @@ your Yocto Project build host:
       Your VHDX file path is:
       ``C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx``
 
-   2. *Optimize your VHDX file:* Open a Windows Powershell as
-      Administrator to optimize your VHDX file, shutting down WSL first::
+   2a. *Optimize your VHDX file using Windows Powershell:* To use the optimize-vhd cmdlet below, first install the Hyper-V option on Windows.  Then, open a Windows Powershell as Administrator to optimize your VHDX file, shutting down WSL first::
 
          C:\WINDOWS\system32> wsl --shutdown
          C:\WINDOWS\system32> optimize-vhd -Path C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx -Mode full
@@ -533,6 +532,16 @@ your Yocto Project build host:
       VHDX file, and storage should now be reflected correctly on the
       Windows Explorer.
 
+   2b. *Optimize your VHDX file using DiskPart:* The optimize-vhd cmdlet noted in step 2a above is provided by Hyper-V.  Not all SKUs of Windows can install Hyper-V.  As an alternative, use the DiskPart tool.  To start, open a Windows command prompt as Administrator to optimize your VHDX file, shutting down WSL first::
+	   
+         C:\WINDOWS\system32> wsl --shutdown
+         C:\WINDOWS\system32> diskpart
+		 
+         DISKPART> select vdisk file="<path_to_VHDX_file>"
+         DISKPART> attach vdisk readonly
+         DISKPART> compact vdisk
+         DISKPART> exit
+		 
 .. note::
 
    The current implementation of WSLv2 does not have out-of-the-box
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [docs] [PATCH] dev-manual: add instructions for compacting WSLv2 VHDX files using DiskPart for those systems which lack optimize-vhd
  2022-03-09 23:48       ` Tony McDowell
@ 2022-03-10  7:48         ` Michael Opdenacker
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Opdenacker @ 2022-03-10  7:48 UTC (permalink / raw)
  To: Tony McDowell; +Cc: docs

Hi Tony,

On 3/10/22 00:48, Tony McDowell wrote:
> On Wed, Mar 9, 2022 at 8:57 AM Michael Opdenacker
> <michael.opdenacker@bootlin.com> wrote:
>> Hi Tony,
>>
>> On 3/9/22 16:53, Tony McDowell wrote:
>>> Thanks, Michael.  I think the problem is that I created it with
>>> TortoiseGit on Windows and it didn't capture the proper context of the
>>> files.  I'll try to fix it today and resubmit.  For the etiquette of
>>> this mailing list, should that be a new patch email or as a reply on
>>> this one?
>>
>> Thanks for asking!
>> I believe it's best to send the new patch as a reply on this thread, but
>> this is not a very strict requirement :)
>>
>> I suggest you to send your patch to yourself first, save the message to
>> a file, create a new branch from "master" and try to apply your patch
>> using "git am <file>".
>> Thanks in advance
>> Michael.
>>
>> --
>> Michael Opdenacker, Bootlin
>> Embedded Linux and Kernel engineering
>> https://bootlin.com
>>
> Hi Michael:
>
> I was able to apply my patch directly against the yocto-docs repo and
> it applied without issue and I saw the change show up in start.rst
> like I expected.  I have attached the .patch file that TortoiseGit
> generated for me if that works more easily for you.

Thanks for this update. I managed to apply the new patch.

I modified it a bit to fix a formatting issue that I had at least with
my version of Sphinx. I also added a Signed-off-by line to the commit,
which is required by the Yocto Project. Don't forget next time.

Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
... and merged into "master-next".

Thanks again. Don't hesitate to send us more improvements!
Cheers
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-10  7:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09  2:42 [PATCH] dev-manual: add instructions for compacting WSLv2 VHDX files using DiskPart for those systems which lack optimize-vhd Tony McDowell
2022-03-09  7:54 ` [docs] " Michael Opdenacker
2022-03-09 15:53   ` Tony McDowell
2022-03-09 15:57     ` Michael Opdenacker
2022-03-09 23:48       ` Tony McDowell
2022-03-10  7:48         ` Michael Opdenacker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.