How to map disk partition as a VDI

Discussions related to using VirtualBox on Linux hosts.
Post Reply
desibabu
Posts: 1
Joined: 7. Dec 2022, 02:01

How to map disk partition as a VDI

Post by desibabu »

Gentlemen:

On a sandbox I have two hard disks which have a 500Gb partition on each mounted on the host os Ubuntu 22.04 as /mnt/disk1 and /mnt/disk2
Is there a way I can map one vdi to each of these partitions/mount points?

The idea is to define these vdi's as storage for a guest VM (FreeBSD) I'll be creating on Ubuntu.

The goal is to create a mirrored disk setup in the VM/guest os

Is this even possible?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to map disk partition as a VDI

Post by scottgus1 »

There are two ways to do this:

1. make two actual vdi files, one on /mnt/disk1 and the other on /mnt/disk2. This is the easiest way, and the easiest to back up the VM.

2. use Raw Disk Access (see the manual, chapter 9) to take the actual partitions away from the host and use them in the VM directly. Backing up the VM will be harder, and the data loss risk will be great if the host re-enumerates the disks differently one day. Raw Disk Access is experts-only and we don't tell folks how to do it on the forum.
Post Reply