VirtualBox

Opened 14 years ago

Last modified 11 years ago

#5629 closed enhancement

Suggestion: Add option to have emulated hard disk report itself as an SSD, and support TRIM — at Initial Version

Reported by: Donuts Owned by:
Component: virtual disk Version: VirtualBox 3.0.12
Keywords: ssd trim vdi sector size 4kb Cc:
Guest type: other Host type: other

Description

Add an option to have VirtualBox report the emulated hard disk as an SSD to the guest OS. (For ATA drives, word 217 of IDENTIFY DEVICE should be 1.)

Also support TRIM (for ATA, the DATA SET MANAGEMENT command with TRIM bit set). That would allow an SSD-aware guest to tell VirtualBox which sectors it no longer needs. Then VirtualBox could reuse those sectors in the VDI file when "new" sectors are written to. In other words, that would reduce the rate of growth of dynamically-expanding VDI files. (Reading back TRIMed sectors should return all 0 bytes.)

So SSD-aware guest OSes like Windows 7 would behave optimally, e.g. by not defragmenting/optimising the disk in the background. Even when the host VDI file is on a normal hard disk, that is a good idea. For dynamically-expanding VDI files, defragmenting/optimising disk layout by the guest has no beneficial effect, and causes VDI file size to increase unnecessarily. And any I/O scheduler behaviour in the guest to minimise seeks could be disabled.

More generally, it would be great if the user could specify certain properties of any emulated hard disk. Apart from reporting as an SSD, allow the user to set the logical and physical block sizes, and logical sector offset. See for example http://mkp.net/pubs/storage-topology.pdf and other documents at http://mkp.net/computing.html

That would be invaluable for testing purposes (not many people have real 4KB-sector drives to test with), but also has real-world uses. If the VDI file is on a drive with 4KB sectors, allowing the guest OS to know that would improve performance. More generally, it would make moving to and from physical media with non-512-byte sectors easy. (For example, DVD-RAM has 2048-byte logical sectors, 32768-byte physical. Some MO disks have 1024-, 2048- or 4096-byte sectors. Plasmon UDO disks have 8192-byte sectors.)

Change History (0)

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use