Re: GELI disk corrupted or external influence?

From: Anon Loli <anonloli_at_autistici.org>
Date: Sat, 18 May 2024 17:53:21 UTC
Yeah I did just that, I did `zpool export [zfs pool]` and ran
`gpart show /dev/ada0.eli`, and it tells me this:
> gpart: No such geom: /dev/ada0.eli.` so I guess this is what you meant
by the partition table?

In any case, a zpool scrub should be useful in this case?
Maybe I'm doing it wrong?
Anyways thanks for your response.


The reason I'm leaving FreeBSD is that it's full of bugs including but
not limited to filename handling by ls/cd (specifically some encoding
like Swedish encoding or something couldn't handle the weird letters)
and ports, I couldn't get them to work after an upgrade, perhaps I
didn't do something correctly, everything was broken and I decided to
switch to OpenBSD, in where it's much better..

Don't get me wrong for something like gaming and lazy/irresponsible
storage usecases FreeBSD is alright, but OpenBSD just feels right..

Also FreeBSD crashes as-in reboots the entire PC if the HDMI cable of
one of displays I tested is inserted only half-way.

On Sat, May 18, 2024 at 01:18:38PM -0400, Karl Denninger wrote:
> 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]/