# [FreeNAS] geom mirror cannot destroy device error 16



## HeroicGlaedr (Aug 12, 2011)

Hey guys,

I have successfully been running a FreeNAS Server for a while now without any issues.
I recently switched to a Software RAID configuration (GEOM Mirror) with my Disks and have had some weird problems with my 1TB Software RAID.

My server would suddenly shutdown after I tried accessing smb or when it was told so by a cron job but 
it halted at the end and did not switch off completely. I then had to go up to the server and reboot it manually.

The following error messages where printed (only) on the monitor:


```
gmirror: Cannot destroy device Hell (error=16)
geom: Could not unload module: device busy.
... (syncing buffer, inodes, etc.)
GEOM_MIRROR: Device Hell: provider mirror /Hell destroyed.
GEOM_MIRROR: Device Hell destroyed
```

When I try to manually stop the device with 
	
	



```
geom mirror stop Hell
```
 the same error comes up in the cli.

```
geom: Cannot destroy device Hell (error=16).
```

I ran fsck on the mirror and it doesn't find any faults.

Here some additional information:

Software RAID 1 with a Samsung SpinPoint F1 1 TB and WDCaviarGreen 1TB.

I've been also getting smartd reports with errors from the WDCaviarGreen Disk. This may be at the root of the problem:


```
Device: /dev/ad12, 4 Currently unreadable (pending) sectors
Device: /dev/ad12, 4 Offline uncorrectable sectors
```

(I can post full smartd report, if needed)

I know that the Load_cylce_count parameter on the WD Disk is very high, since I've only recently used WIDLE3 to set the parking of the head to a higher value. Maybe the disk is broken.. (hope not!)

Further errors are logged about the mirror device, but which, after searching through the FreeNAS forum, I have found to ignore because they are falsely reported by the OS.


```
kernel: GEOM: ad14: using the primary only -- recovery suggested.
kernel: GEOM: ad14: the secondary GPT table is corrupt or invalid.
kernel: GEOM: ad12: using the primary only -- recovery suggested.
kernel: GEOM: ad12: the secondary GPT table is corrupt or invalid.
```

System Info:

FreeNAS 0.7.2 Sabanda (revision 6694)
OS Version FreeBSD 7.3-RELEASE-p6 (revision 199506)
Platform	 amd64-embedded on Intel(R) Atom(TM) CPU 330 @ 1.60GHz
RAM 2GB

I'd be glad for some help with resolving this problem.

Cheers


----------



## HeroicGlaedr (Aug 23, 2011)

Bump - I've not been able to resolve this problem (neither have I found an answer in the Freenas forums).

I'm going to buy a new HDD to replace the old one to see if that is the problem.

Cheers


----------



## Terry_Kennedy (Aug 24, 2011)

HeroicGlaedr said:
			
		

> My server would suddenly shutdown after I tried accessing smb or when it was told so by a cron job but


If it shuts down when you use SMB, that sounds like a system panic. 7.3-RELEASE is rather old at this point. Once you get the immediate issues sorted out, you may want to check to see if you can upgrade to a version of FreeNAS based on a newer FreeBSD release.



> it halted at the end and did not switch off completely. I then had to go up to the server and reboot it manually.


One of the last steps during shutdown is to unmount the root device. If for some reason that can't be done, the system will hang at that point.



> The following error messages where printed (only) on the monitor:
> 
> 
> ```
> ...


error 16 is EBUSY (see /usr/include/errno.h). The system is telling you it can't release that device due to some incomplete operation on it.



> I've been also getting smartd reports with errors from the WDCaviarGreen Disk. This may be at the root of the problem:
> 
> 
> ```
> ...


That could well be the cause of the problem. What happens if you run the system with only the ad14 disk drive connected? CAUTION: If you do this, once you re-connect the ad12 disk to the system, gmirror is going to try to synchronize the 2 disks, which will likely fail due to the errors on the ad12 drive. If mirroring is important to you, I'd have the replacement drive ready to install instead of re-connecting the existing ad12 drive.


----------

