Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Oct 2017 01:23:04 +0000
From:      Jonathan Bond-Caron <jbondc@gdesolutions.com>
To:        Fabian Keil <freebsd-listen@fabiankeil.de>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   RE: GELI disk and glabel label
Message-ID:  <CY4PR17MB11114662CD9EEE92F38E9C66B7750@CY4PR17MB1111.namprd17.prod.outlook.com>
In-Reply-To: <20171007133532.0c647a07@fabiankeil.de>
References:  <CY4PR17MB1111E0EB793D6970B7CEF7C4B7700@CY4PR17MB1111.namprd17.prod.outlook.com> <20171007133532.0c647a07@fabiankeil.de>

next in thread | previous in thread | raw e-mail | index | archive | help

> 
> > glabel secure /dev/da1
> > glabel backups /dev/da2
> >
> > The problem is now I can't mount them :/ geli attach -k /root/geli.key
> > geli: Cannot read metadata from /dev/da1
> 
> As Bernt already explained, that's the expected behaviour.
> 
> 
> If you have a backup of the whole disk, you can extract the geli metadata
> with "geli backup ..." and restore it with "geli restore ..."
> which will also overwrite the "glabel label".
> 

Thanks, thankfully it's a virtualized server so it was easy to mount the backup of the disks and geli backup then restore.

geli backup /dev/da6 /tmp/da1.meta
geli backup /dev/da7 /tmp/da2.meta
geli restore /tmp/da1.meta /dev/da1 
geli restore /tmp/da2.meta /dev/da2

No loss of data 😊

It would be nice if glabel would prevent the labelling of a geli disk, if someone is adventurous:
https://github.com/freebsd/freebsd/blob/master/sbin/geom/class/label/geom_label.c#L131

I'm thinking if eli_metadata_decode(buf, &md) is successful, it reports an error:
https://github.com/freebsd/freebsd/blob/386ddae58459341ec567604707805814a2128a57/usr.sbin/fstyp/geli.c

Thanks for feedback!
Jon




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CY4PR17MB11114662CD9EEE92F38E9C66B7750>