Using Ramdisk as rawdisk for swapspace in Windows
Posted: 9. Nov 2008, 06:48
I've just been experimenting with this, since it looked to me as an interesting topic to explore. Most of the people were interested in the use of ramdisk for storing windows pagefile. My intention was to try both with the pagefile and the photoshop swap file (though not at the same time)
Since I haven't found any "complete guides" to do this, i've decided to post it here. Hope it will be useful. So, here's how i achieved it under Ubuntu distro:
then, look for for something like this:
and at the end of this line, add ramdisk_size=VALUE_IN_MB ... example:
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=b360edaf-a86e-48a9-b209-721656f194b7 ro quiet splash ramdisk_size=768000
so, now there is:
exit and save the file, then restart the system to change the size of ramdisk, since the ramdisk init and creation are taking place during boot.
Useful link on ramdisk creation: http://ubuntuforums.org/showthread.php?t=182764
When the system restarts, you can check your ramdisk by mounting it (sudo mount /dev/ram0 /media/ramdisk) and browsing to its mount point and checking it's free space. If everything went fine, you can proceed to create rawdisk vmdk file that points to your ramdisk. Before doing so, you should unmount the ramdisk (sudo umount /dev/ram0)
So, the next step is to make a filesystem on ramdisk and create a .vmdk file:
And you should get this output:
before importing .vmdk file into VirtualBox, you must change its ownership, since the owner is root:
Then, open your VirtualBox, select your Windows VM, and go into Hard disk section and browse for .vmdk files. You should find ramdisk.vmdk or whatever you named it and be able to set it as an additional hard drive.
Next and final step is to start the virtual machine. During boot, the system could inform you of detecting new hardware as mine did, and you should right-click My Computer and go to Manage. There you should go to Disk Management and you should see your new disk labeled as "Unallocated" and a Wizard "Initialize and convert disk" should pop-up. You just need to select your drive to be initialized and converted, and then right-click Unallocated space and select "New volume" to create partition. For some reason, you can only set up the drive as Dynamic drive, so the only option for this drive is to create Simple dynamic disk.
So that's it. I hope it'll be of use to someone.
Since I haven't found any "complete guides" to do this, i've decided to post it here. Hope it will be useful. So, here's how i achieved it under Ubuntu distro:
Code: Select all
sudo gedit /boot/grub/menu.lstCode: Select all
title Ubuntu 8.10, kernel 2.6.27-7-generic
uuid b360edaf-a86e-48a9-b209-721656f194b7
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=b360edaf-a86e-48a9-b209-721656f194b7 ro quiet splash
initrd /boot/initrd.img-2.6.27-7-generic
quietkernel /boot/vmlinuz-2.6.27-7-generic root=UUID=b360edaf-a86e-48a9-b209-721656f194b7 ro quiet splash ramdisk_size=768000
so, now there is:
Code: Select all
title Ubuntu 8.10, kernel 2.6.27-7-generic
uuid b360edaf-a86e-48a9-b209-721656f194b7
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=b360edaf-a86e-48a9-b209-721656f194b7 ro quiet splash ramdisk_size=768000
initrd /boot/initrd.img-2.6.27-7-generic
quietUseful link on ramdisk creation: http://ubuntuforums.org/showthread.php?t=182764
When the system restarts, you can check your ramdisk by mounting it (sudo mount /dev/ram0 /media/ramdisk) and browsing to its mount point and checking it's free space. If everything went fine, you can proceed to create rawdisk vmdk file that points to your ramdisk. Before doing so, you should unmount the ramdisk (sudo umount /dev/ram0)
So, the next step is to make a filesystem on ramdisk and create a .vmdk file:
Code: Select all
sudo mke2fs /dev/ram0Code: Select all
sudo VBoxManage internalcommands createrawvmdk -filename /home/username/.VirtualBox/VDI/ramdisk.vmdk -rawdisk /dev/ram0Code: Select all
VirtualBox Command Line Management Interface Version 2.0.4
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
RAW host disk access VMDK file /home/username/.VirtualBox/VDI/ramdisk.vmdk created successfully.Code: Select all
sudo chown your_username /home/username/.VirtualBox/VDI/ramdisk.vmdkNext and final step is to start the virtual machine. During boot, the system could inform you of detecting new hardware as mine did, and you should right-click My Computer and go to Manage. There you should go to Disk Management and you should see your new disk labeled as "Unallocated" and a Wizard "Initialize and convert disk" should pop-up. You just need to select your drive to be initialized and converted, and then right-click Unallocated space and select "New volume" to create partition. For some reason, you can only set up the drive as Dynamic drive, so the only option for this drive is to create Simple dynamic disk.
So that's it. I hope it'll be of use to someone.