You are not logged in.

#1 2023-08-23 04:29:15

matryoshka
Member
Registered: 2022-05-14
Posts: 32

Virtual disk that include Windows partiton (mdadm)

I have found a great post about booting existing Windows partition in vm (https://simgunz.org/posts/2021-12-12-bo … linux-kvm/) but reading it through I do not understand "why's" Step 2 in that post. In Step 1 (3) it should create a device that is concatenated from 3 inputs (efi1 win-partition efi2) but Step 2 shows creating filesystems that make me think that it's wrong.

Like "mkpart primary fat32 2048 204799" as I understand, specify start and the end in MB but that does not make any sense as the size of efi1 file was 100MB (dd if=/dev/zero of=efi1 bs=1M count=100). And after that the next partition command create ntfs fs (as I understand it should align with the size of Windows partition).

Let's assume that start and end sizes that were sent to mkpart were correct. But is it safe to create a fs upon existing (It should not be right?). And why there is no usage of efi2 file later in the post?

Offline

#2 2023-08-23 11:44:14

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,104

Re: Virtual disk that include Windows partiton (mdadm)

Step 2 shows creating filesystems that make me think that it's wrong.

That step doesn't create filesystems but partitions.
run fdisk -l after step 1 and you'll find you created a device without any partitions .

No idea about efi1 & efi2 although they do look like they could be needed to store gpt headers .


Trying to run a windows physical install in a VM raises several questions including legal ones , see https://bbs.archlinux.org/viewtopic.php?id=238095 .

Last edited by Lone_Wolf (2023-08-23 11:44:39)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2023-08-23 11:58:05

matryoshka
Member
Registered: 2022-05-14
Posts: 32

Re: Virtual disk that include Windows partiton (mdadm)

Thank you, you are right, mkpart does not format but rather just says that this partition would "contain" this fs. I got that from here: https://unix.stackexchange.com/question … how-does-i

As for why the second partition is needed I have found this post (https://www.reddit.com/r/VFIO/comments/ … &context=3) where it says it needed for gpt's sake.

Offline

#4 2023-08-24 04:14:36

matryoshka
Member
Registered: 2022-05-14
Posts: 32

Re: Virtual disk that include Windows partiton (mdadm)

Like "mkpart primary fat32 2048 204799" as I understand, specify start and the end in MB but that does not make any sense as the size of efi1 file was 100MB (dd if=/dev/zero of=efi1 bs=1M count=100)..

That starts making sense as the first command to parted is to set unit to sectors. Also sector size is 512 so 100MB * 1024 * 1024 / 512 = 204800.


I was able to successfully boot windows from partition (but I have decided to clone it first to external disk) and everything works. The only issue I had is the efi partition did not have a fs so I was not able to exec bcdedit. I had to format it to fat32 in diskpart.

Running disk check in windows showed no errors and it's quite usable with virtio drivers

Offline

Board footer

Powered by FluxBB