|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
To know where each partition physically lives on your drive, you can run disklabel.
Code:
$ disklabel sd0c |
|
|||
First of all have a look at this blogpost.
I might be mistaken, but you may have messed up the partitions/partition table. If you make a backup of all the partitions and you know where they EXACTLY are/were, there is a good chance that everything can be recovered. The steps depend also on the config, whether it's a one machine/one OS config or something else. I would not reboot until I understood what exactly happened and figured out the steps to recover (I mean if there isn't an easier way to solve this). Your situation is a bit different from the blogpost, but understing the hints there will help to figure out the next steps. |
|
|||
Code:
of=/dev/rsd0c |
|
||||
Well you guys were right, data got wrecked. Couldn't save much, but I was happy to have a backup (not much data was lost, not that it was that important in the first place). I'm sorry I couldn't reply in any way, I was waiting for a new laptop already to install OpenBSD on.
Anyway, to anyone reading this and that might have made a similar mistake try to backup as much data as you can without rebooting. If you can't mount a physical device for some reason. DO NOT ls into /dev!! That's how I got a kernel panic.
__________________
If you tell me "who would care enough to hack me" or "nothing to hide nothing to fear", then be sure we won't get along. |
|
|||
Sorry to hear that a fix was not available. Several years ago I was basically in a similar situation on a desktop machine. At the beginning of the HDD there were some other OS partitions and grub. The partition table was messed up, as it was pointed out by gpatrick. As I had the same partitioning for a long time, I could just have a look at one of the backups and take the numbers from there in order to restore the partition table (managed to restore the MBR).
I had a backup of the grub partition and I could recover it where it was before. Even without a backup it would not have been an issue as I could have just installed it again on the partiton it was before. Luckily the OpenBSD partition was an easy fix too as I just took the hdd, run a tool (cannot remember exactly what it was, maybe testdisk) and it discovered the lost partition (I'm talking about one partition and not partitions because it was one softraid encrypted partition). The dd command did not affect the partition itself, being around the end of the hdd. After the tool recovered it, I booted into Grub and it chainloaded OpenBSD as usual. I'm wondering: - If something like that happens and the system is still up, would a dd command work to copy at least /home on a usb stick (would the system work that long)? - Might it be possible to run a command using the files in /var/backups in order to restore the partition table and at least the partition structure first? Those files are created daily when the security script runs at 1:30. In a situation like that it's good to make a hdd image first. In that case it won't get worse while trying recovery. |
|
||||
I don't think there would be a useful answer to this, it would depend on how much damage was done and where/what was overwritten. You could imagine over-writing the MBR and part of another OS only, or a small part of the running OS, or lots of it. The time it might run would probably be very different in these cases. Eventually, once the kernel starts to access garbage on-disk, it will cause some kind of problems/corruption and most likely crash.
|
|
|||
dd is one of the commands whose arguments I always double check, specifically to be sure that "of" points to something whose contents are either duplicated or unneeded.
|
Tags |
dd corruption loss data accident |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Security "Data and Goliath" , a book by Bruce Schneier | J65nko | News | 0 | 11th March 2015 01:38 AM |
Multihome, packets leaving by "wrong" interface | irukandji | FreeBSD Security | 7 | 13th July 2013 05:12 AM |
EU's AXLE to drive open source "Big Data" analytics | J65nko | News | 0 | 1st May 2013 05:33 PM |
Data caps a "crude and unfair tool" for easing online congestion | J65nko | News | 0 | 4th December 2011 09:33 PM |
Fixed "xinit" after _7 _8, "how" here in case anyones' "X" breaks... using "nvidia" | jb_daefo | Guides | 0 | 5th October 2009 09:31 PM |