On 2023-09-27, sprits killshot <spritskills...@gmail.com> wrote:
> I did the thing.
> dd'd a 5gb img to my ssd instead of my usb and I want to die.
>
> dd if=file.iso of=/dev/sd1c
>
> I am using a CRYPTO RAID partition and luckily I'm smart enough not to
> nuke that.
>
> My ssd is 2TB so I believe it uses FFS2 by default.  I'm hopelessly
> running scan_ffs on it in case it was silently updated or the man is
> wrong or there's a God.
>
> Any advice on how to recover what's left?

With a typical softraid FDE setup, not going too far from the defaults,
this likely means that the partition table, disklabel, root partition
and swap on the softraid volume were overwritten, but other partitions
might be ok if you can find them.

If you don't have a copy of the disklabel stored away somewhere,
current options are probably

- port the scan_ffs ffs2 support from netbsd

- hack things up so you can get something out of our scan_ffs as in
https://marc.info/?l=openbsd-misc&m=167702020925723

(as shown in Matthew's mail, your initial target with either of these
should be /var/backups/disklabel.sd1.* so you can restore it and skip
scanning for other filesystems)

- brute-force likely locations for /var (try on 1G boundaries) with the
read-only mount approach from that mail

- try to recreate disklabel from scratch (*if* you accepted auto
partition defaults when installing, you might be able to recreate them
by using disklabel from the same OpenBSD version as you used to install
with auto-partitioning again, but the default sizes have changed over
time, so that will only help if you know the version).

Reply via email to