Page 1 of 1

Kernel panic with physical disk access

Posted: 22. Jun 2012, 11:43
by fpabernard
Hello,

I am new on this forum. I'm French, I'm sorry for my poor english ...

I'm using Virtual Box in order to run a NAS on Debian (it is OpenmediaVault, but I don't think it is relevant).

I have a SATA physical disk attached to this VM. I created a vmdk file using
"C:\Program Files\Oracle\VirtualBox\VBoxManage" internalcommands createrawvmdk -filename "D:\Users\me\VirtualBox VMs\DD1.vmdk" -rawdisk \\.\PhysicalDrive1

I created a SATA controler via VB GUI, and then attached an existing disk on this controler, choosing DD1.vmdk

I experience kernel panic (see attached screen shot), which becomes almost systematic, until I remove the SATA controler, recreate it and attach again the physical disk.

I have another similar VM. I noticed that if I remove the SATA controler on this other VM, and then start my Openmediavault VM, it works as if I had removed and recreated the SATA controler on the Openmediavault VM

Re: Kernel panic with physical disk access

Posted: 22. Jun 2012, 12:00
by mpack
What host OS?

If it's Windows 7 then read this :-
Enabling raw access to Win7 / Win2k8 disks.
viewtopic.php?f=6&t=38914#p175089

Be warned that raw is access can trash your data in the blink of an eye. If you ignore the dire warnings given here and in the user manual then you do it at your own risk.

Most people find that shared folders is the proper and safe way to share data between a host and a guest OS.

Re: Kernel panic with physical disk access

Posted: 22. Jun 2012, 14:35
by fpabernard
Hello,

Thank you for this response.

The host is Windows7 64.

Shared folders won't work for me, as the physical disk has a XFS partition. Using a NAS Linux guest is the simplest way I found to access files within this disk from Windows.

I encounter this problem only on my office PC (Windows 7 Professionnal). It's fine on Windows 7 Home Premium.

The VM, if it's start, is very stable and can work several hours. I did not encounter any disk corruption. The kernel panic occurs only on VM startup. It never corrupted the disk.

Following the given link, I check :
- the disk is not read-only in DISKPART
- if I OFFLINE the disk, it's the same
- it's not enough to create a vmdk with option -partitions 1 (kernel panic in the guest)
- when the VM starts, I see that VirtualBox takes a handle on Harddisk1, when there is a kernel panic, it does not, so it may be an access problem to the hard disk, may be a service that exists only on Windows 7 Pro. But I see no process having a handle on the raw disk

Re: Kernel panic with physical disk access

Posted: 22. Jun 2012, 15:09
by mpack
fpabernard wrote:I did not encounter any disk corruption.
Disk corruption would be likely to occur if both the host OS and the guest OS was each trying to manage the disk filesystem at the same time, with independant cacheing etc. If you are saying that the host is unable to use that drive (because of the foreign filesystem) then you shouldn't have that problem.

Ok, your problem does not seem to be a read-only disk, in which case I don't have a good idea what actual problem might be. Hopefully a Linux expert will want to comment.

Re: Kernel panic with physical disk access

Posted: 22. Jun 2012, 15:34
by Perryg
Well what can I say? There are a lot of ways this can go wrong, but I don't have enough information to know what at this point.

It looks like the disk you added was a working MedaVault HDD from/on metal, is this the case, or did you install MediaVault to the drive after you created the RAW drive?

Can you provide a step by step detail of how you are doing this (excluding the creatfromraw steps as there are already given)?
Please make them bullet lists with only steps and little explanation.

Re: Kernel panic with physical disk access

Posted: 25. Jun 2012, 17:15
by fpabernard
Yes, you are right, I have a "metal" Openmediavault system and I attach a drive to either system, metal or VM.

The drive does not contain the OS. It is a logical volume, (see lvm2 on Linux litterature), which contains an XFS file system
- I created a VM for "Debian 64 bits" with a 4GB virtual disk on an IDE controller.
- I installed on it OpenmediaVault by the standard procedure (booting with an ISO install media)
- I added a SCSI controller and attached the VMDK for the physical drive
- when the VM starts, the drive is detected by Openmediavault as a new logical volume and after that you can create a CIFS/SMB share to use this volume as a network drive, etc.

From the guest system point of view, it is very simple :
- a boot system disk
- a network (bridge)
- one extra drive pointing to a physical disk which contains a file system not usable by Windows (a Linux logical volume)

Re: Kernel panic with physical disk access

Posted: 25. Jun 2012, 17:53
by Perryg
If you keep trying does the guest actually mount and work properly, or does it always produce the panic?

Re: Kernel panic with physical disk access

Posted: 25. Jun 2012, 22:57
by fpabernard
There are two possibilities :
- either the guest produces the panic at startup
- or it starts normally and then keep stable for days ...

Re: Kernel panic with physical disk access

Posted: 25. Jun 2012, 23:06
by Perryg
And the version of VirtualBox you are using?

Note: I have see these kernel panics on a normal machine from time to time. How often does it actually fail compared to the number of times you try to start it?

Re: Kernel panic with physical disk access

Posted: 26. Jun 2012, 09:32
by fpabernard
Last version of Virtual Box (4.1.18 r78361)

I thought the VM almost always starts if I recreate the SATA controller and disk attachment but it's not true. It fails almost always and sometimes it starts (5% success ?)

Re: Kernel panic with physical disk access

Posted: 26. Jun 2012, 14:46
by Perryg
Like I said I have seen the panic on occasion and it used to be more of an issue which was actually fixed. The issue I saw was during a cold boot and it almost always failed, but a warm boot worked always. That said it sounds like a timing issue that May be fixed in the next release but I am not sure that it applies to RAW. You need to post a ticket at bugtracker and see if the DEVs know what you should do or perhaps fix the problem. Be sure to provide ample information including log files.