# harddisk errors on a Virtual Server?



## jw (Jun 8, 2012)

Hello,

I am trying to get my head around the current situation with my VPS. The VPS is running FreeBSD 8.2 64bit and it's a reasonably clean install from the image provided by the VPS Hoster.

Now I find these errors in my /var/log/messages:

[cmd=]# cat messages | grep ad0[/cmd]

```
Jun  6 13:35:55 kali kernel: ad0: 307200MB <QEMU HARDDISK 0.15.0> at ata0-master WDMA2
Jun  6 13:35:55 kali kernel: ad0: 307200MB <QEMU HARDDISK 0.15.0> at ata0-master WDMA2
Jun  6 13:35:55 kali kernel: Trying to mount root from ufs:/dev/ad0s1a
Jun  6 12:07:42 kali kernel: ad0: 307200MB <QEMU HARDDISK 0.15.0> at ata0-master WDMA2
Jun  6 12:07:42 kali kernel: Trying to mount root from ufs:/dev/ad0s1a
Jun  6 12:17:34 kali kernel: ad0: 307200MB <QEMU HARDDISK 0.15.0> at ata0-master WDMA2
Jun  6 12:17:34 kali kernel: Trying to mount root from ufs:/dev/ad0s1a
Jun  6 13:02:40 kali kernel: ad0: 307200MB <QEMU HARDDISK 0.15.0> at ata0-master WDMA2
Jun  6 13:02:40 kali kernel: Trying to mount root from ufs:/dev/ad0s1a
Jun  6 23:08:35 kali kernel: ad0: 307200MB <QEMU HARDDISK 0.15.0> at ata0-master WDMA2
Jun  6 23:08:35 kali kernel: Trying to mount root from ufs:/dev/ad0s1a
Jun  6 23:56:05 kali kernel: ad0: TIMEOUT - WRITE_DMA48 retrying (1 retry left) LBA=307623487
Jun  6 23:56:18 kali kernel: ad0: TIMEOUT - WRITE_DMA48 retrying (0 retries left) LBA=307623487
Jun  6 23:56:18 kali kernel: ad0: FAILURE - WRITE_DMA48 status=41<READY,ERROR> error=4<ABORTED> LBA=307623487
Jun  6 23:56:18 kali kernel: g_vfs_done():ad0s1a[WRITE(offset=148913258496, length=16384)]error = 5
Jun  7 00:55:27 kali kernel: ad0: TIMEOUT - WRITE_DMA48 retrying (1 retry left) LBA=307623487
Jun  7 00:55:38 kali kernel: ad0: TIMEOUT - WRITE_DMA48 retrying (0 retries left) LBA=307623487
Jun  7 00:55:38 kali kernel: ad0: FAILURE - WRITE_DMA48 status=41<READY,ERROR> error=4<ABORTED> LBA=307623487
Jun  7 00:55:38 kali kernel: g_vfs_done():ad0s1a[WRITE(offset=148913258496, length=16384)]error = 5
Jun  7 02:54:07 kali kernel: ad0: TIMEOUT - WRITE_DMA48 retrying (1 retry left) LBA=307623487
Jun  7 02:54:17 kali kernel: ad0: TIMEOUT - WRITE_DMA48 retrying (0 retries left) LBA=307623487
Jun  7 02:54:17 kali kernel: ad0: FAILURE - WRITE_DMA48 status=41<READY,ERROR> error=4<ABORTED> LBA=307623487
Jun  7 02:54:17 kali kernel: g_vfs_done():ad0s1a[WRITE(offset=148913258496, length=16384)]error = 5
Jun  7 07:55:55 kali kernel: ad0: TIMEOUT - WRITE_DMA retrying (1 retry left) LBA=79612255
Jun  8 03:58:44 kali kernel: ad0: TIMEOUT - WRITE_DMA48 retrying (1 retry left) LBA=307636159
Jun  8 03:58:44 kali kernel: ad0: FAILURE - WRITE_DMA48 status=41<READY,ERROR> error=4<ABORTED> LBA=307636159
Jun  8 03:58:44 kali kernel: g_vfs_done():ad0s1a[WRITE(offset=148919746560, length=16384)]error = 5
```
According to the VPS provider they currently have no issues on their storage servers, so it has to be the configuration. A somewhat cheap shot, since they also provided the image for the FreeBSD installation, but I can see their point. 

Question: what could be causing the (virtual) harddisk failures since it's not just a defective harddisk? Any ideas would be welcome!


Jorge.


----------



## SirDice (Jun 8, 2012)

They might not have (physical) disk errors on their storage servers but the disk image they assigned to you might be corrupt.


----------



## wblock@ (Jun 8, 2012)

It shouldn't give a write timeout, though.  Sparse disk images and out of disk space, maybe.


----------



## SirDice (Jun 8, 2012)

wblock@ said:
			
		

> It shouldn't give a write timeout, though.  Sparse disk images and out of disk space, maybe.



Yeah, that's true. Thinking a little more about it I would have expected all sorts of weird errors _except_ DMA errors.

It's possible 8.2 simply doesn't like the virtualized disks. Or there's some incompatibility between the VPS abstraction layer and FreeBSD 8.2.

For what it's worth, I'm running 9.0 on a VPS that has a similar disk image:

```
da0: <QEMU QEMU HARDDISK 0.13> Fixed Direct Access SCSI-5 device
```

It's detected slightly different and has a different number (is that a version number perhaps?). But I'm not sure if the differences are because of 9.0 or a different VPS implementation.


----------



## mav@ (Jun 8, 2012)

The adX driver still used by 8.x has quite aggressive command timings. If the host system or hardware is too busy, I think it is possible that it won't fit into the time frame. FreeBSD 9.x uses different drivers with more relaxed timeouts.


----------



## jw (Jun 10, 2012)

> The adX driver still used by 8.x has quite aggressive command timings. If the host system or hardware is too busy, I think it is possible that it won't fit into the time frame. FreeBSD 9.x uses different drivers with more relaxed timeouts.



So, would that mean I could do 'something' for updating this adX driver on the 8.2 install, and then be able to get rid of the timeouts? (If so, could you maybe point me 'somewhere' related to 'something'? 

Or is installing 9.0 the only feasible way to get this 'more relaxed' driver for adX to (hopefully) get rid of these errors?

Thanks,

Jorge.


----------



## mav@ (Jun 10, 2012)

There is a kernel configuration option ATA_REQUEST_TIMEOUT. You may rebuild your kernel specifying a different value in seconds. Default is 10 there, while more usual value used by new drivers is 30 seconds.

Also you may switch to the new ATA drivers already present in the 8.x branch, but disabled by default for compatibility reasons.


----------

