Home arrow Debugging Tips arrow geli: Cannot read metadata from /dev/ad4: Invalid argument.
geli: Cannot read metadata from /dev/ad4: Invalid argument. PDF
Wednesday, 16 March 2011
If you get an error like this when you try to attach a geli hard drive (where ad4 is the hard drive you want to attach):

geli: Cannot read metadata from /dev/ad4: Invalid argument.

the problem is with metadata stored on last sector of your drive. Something went wrong when you init the geli hard drive and somehow geli cannot use metadata info when attaching.

How to solve this
---------------------

When you init the hard drive with geli init command, a backup of metadata (which is stored on last sector of your hard drive) is saved in /var/backups. You can restore metadata info from that file with command:

geli restore /var/backups/ad4.eli /dev/ad4

When issuing previous command if you get the error:

geli: Cannot open /dev/ad4: Operation not permitted.

then you must:

sysctl kern.geom.debugflags=0x10

I want to never have this problem again
---------------------------------------------

Best practice is to create a partition with gpart a little less than hard drive size. That way there will be space for metadata to be saved in last sector of the drive.

Last Updated ( Tuesday, 01 November 2011 )
 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?