I'm a bit confused here.
I just installed a new 128GB SSD on a Windows PC and then created a 50GB partition on that drive. I did not format it, so that it is labeled "50,00GB RAW" in the "Disk Management" utility.
It is located at \\.\PhysicalDrive0
, I used VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
to see if the partition is visible to VirtualBox.
I then used VBoxManage internalcommands createrawvmdk -filename "C:\Users\USERNAME\VirtualBox VMs\Disks\ssd370-p1.vmdk" -rawdisk \\.\PhysicalDrive0 -partitions 1
to create a vmdk representing that partition.
Then I created a new Virtual Machine and instead of creating a new hard disk, I chose "Use an existing virtual hard disk file," where I selected the beforementioned vmdk.
I mounted the Ubuntu iso as a CD and booted the VM.
I had to try this a couple of times. My main problem was that the vmdk presents itself as a 119,24GB drive, so the creation of the linux partition failed. On one attempt I told the installer, while doing a manual partitioning process during the install, that it should create a partition of 48GB, which is below the 50GB size I used in windows. This worked.
I rebooted the VM and it still worked, which leaves me a bit confused.
During the install I told it to install GRUB. Am I wrong in my assumption that some booting/GRUB-related stuff makes use of the MBR? I mean, something in the install process would need to have written something to the MBR.
Is VirtualBox emulating the MBR? Or has it written a MBR into that partition and shrunk the rest a bit?
I also tried to do a sudo fstrim -v /
, which ends with a FITRIM ioctl failed: Operation not supported
. Is this normal?
Also, I skipped the creation of a swap partition; could I have created one of 2 GB in size? Should I redo all the installation procedure, create a partition of 45GB and a swap of 3-4GB? Would that work?
Would I be better off using a 50GB vmdk file instead of using the RAW partition?