Re: GELI disk corrupted or external influence?

From: Karl Denninger <karl_at_denninger.net>
Date: Sat, 18 May 2024 17:18:38 UTC
Gpart on the raw device, if you do the whole device, will not show 
anything until and unless you attach it at which point "gpart show" on 
the ".eli" device will work.

But its entirely possible the other OS scribbled on some number of the 
first few blocks, in which case you may be utterly boned as even IF you 
restore the metadata its highly-probable the data has been severely 
damaged.  You can try it (and I would certainly), but you may be screwed.

IF you can get Geli to attach it then a "gpart show /dev/ada0.eli"  
SHOULD show the structure -- assuming gpart can find a usable partition 
table.

I am not a fan of using geli on the whole disk for this exact reason; 
another OS is very likely to assume the disk is not formatted AT ALL 
because it does not see a partition table signature and in some cases it 
might gratuitously write to it and you might either (in confusion) 
approve it or worse, it might not even ask!  You'd hope nobody would 
design something in an OS that is that THAT dumb but.....

On 5/18/2024 12:59, Anon Loli wrote:
> Hello mailing list!
> I've had an event which includes modifying some BIOS settings (can't
> remember which exactly), and testing some OS other than FreeBSD.
>
> And I think that the said OS did something malicious to the disk in
> question because it has been doing it for prolonged period of time, and
> mentioned disks..
>
> So this was all on same machine, like dual-booting but from another
> drive.
>
> Then when I went back into FreeBSD I noticed an error, `geli attach`
> doesn't work, I used a /etc/rc.local script for the GELI disk like so:
> `geli attach -p -k /etc/diskpassword.key /dev/ada0
> zpool import zmedia`
> I get an error message when I try to run the geli command:
>> geli: Cannot read metadata from /dev/ada0: Invalid argument.
> I have /var/backupts/ada.eli if that can help..
> There's only /dev/ada0, no ada0s1 for example or .eli or whatever..
> Also when running `gpart show`, I see 2 disks:
> xxx GPT (main boot drive)
> freebsd-boot
> freebsd-swap
> freebsd-zfs
>
> and
> ada0 GPT (the drive in problem)
> -free- (everything)
>
>
> Does this indicate that everything has been lost, like the partitioning
> table or whatever you call it, like it has been formatted?
> Did the other evil OS-fucker destroy my disk without saying it would do
> that?
>
>
> If you can't tell, I'm hesitant to give more information than what's
> necessary for someone to help me because almost any data can be used to
> deanonymize someone, but if you do need some information, please feel
> free to ask.
>
>
> TL;DR: some OS could have wiped some part of a FreeBSD-zfs drive, can
> you help me conclude wether or not we can somehow save it?
>
-- 
Karl Denninger
karl@denninger.net
/The Market Ticker/
/[S/MIME encrypted email preferred]/