|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
powersurge - missing mbr?
2 days ago we had a powersurge and no electricity for 1 hour. After the power came back i turned on my server only to notice that i needed to run manual fsck_ffs for wd4. Being very busy in rl i shut off the power.
Now i got a little time over so i started the server, entered shell and tried disklabel -p wd4 and according to disklabel there is no partitions at all, luckily this wasnt very important data but still, i havent "lost" data like that, might have been a few blocks but this seems to be the mbr? Is there some sort of way to possibly restore the mbr? doing fsck wd4 i get Cant open /dev/wd4a: device not configured |
|
|||
Does the kernel see wd4?
Code:
grep wd[0-9] /var/log/messages
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
Code:
fdisk wd4 3: A6 0 1 1 1453515 14 63 63: 14665144002 OpenBSD |
|
|||
Yes something is there, but it looks messed up. Compare with one of mine
Code:
$ fdisk wd1 Disk: wd1 geometry: 38913/255/63 [625142448 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------ 0: A5 0 1 1 - 5220 254 63 [ 63: 83875302 ] FreeBSD *1: A6 5221 0 1 - 10441 254 63 [ 83875365: 83875365 ] OpenBSD 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
That is the MBR partition table, it resides in the first 512 bytes of the disk.. OpenBSD's disklabel resides within the MBR partition.
I can't explain how things got mangled like that, but a copy of it would have resided in /var/backups. Does /var/backups/disklabel.wd4.current have what you need? EDIT: J65nko may have spotted further issues, full output from commands in [code][/code] blocks would be appreciated. |
|
|||
Code:
#fdisk wd4 Disk: wd4 geometry: 1453521/16/63 [1465149168 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------ 0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused *3: A6 0 1 1 - 1453515 14 63 [ 63: 1465144002 ] OpenBSD |
|
|||
That looks fine, not sure what he was hinting at.. can you check that file? presumably you haven't kept this system running after the disk issue .
You never posted the output of disklabel, either. |
|
|||
This is current disklabel wd4
Code:
# Inside MBR partition 3: type A6 start 63 size 1465144002 # /dev/rwd4c: type : ESDI disk: ESDI/IDE disk label: SAMSUNG HD753LJ flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 16 tracks/cylinder: 1008 cylinders: 1453521 total sectors: 1465149168 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # microseconds track-to-track seek: 0 # microseconds drivedata: 0 16 partitions: # size offset type [fsize bsize cpg] c: 1465149168 0 unused Code:
# Inside MBR partition 3: type A6 start 63 size 1465144002 # /dev/rwd4c: type : ESDI disk: ESDI/IDE disk label: SAMSUNG HD753LJ flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 16 sectors/cylinder: 1008 cylinders: 16383 total sectors: 1465149168 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # microseconds track-to-track seek: 0 # microseconds drivedata: 0 16 partitions: # size offset type [fsize bsize cpg] a: 1465144002 63 4.2BSD 2048 16384 328 c: 1465149168 0 unused |
|
|||
No, you should use disklabel wd4 to re-add the lost a partition.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
I edited what was needed, but i cant access the cpg-value. Dont have a clue what it actually is. Any way to access/change the value would be more then welcome
Code:
# size offset type [fsize bsize cpg] a: 1465144002 63 4.2BSD 2048 16384 1 Last edited by knasbas; 5th December 2009 at 09:25 AM. Reason: changed the cpgvalue. changed from quote2code |
|
|||
After editing with disklabel -E wd4 how does it look like now?
BTW Please use code tags instead of quote tags IIRC values like cpg are a result from the newfs formatting command
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
Thank you for help!
disklabel -R worked and now everything is back to normal! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
sys.tar.gz missing from 3rd CD in 4.5? | thirdm | OpenBSD Installation and Upgrading | 0 | 5th May 2009 03:25 PM |
Disk space gone missing | EricM | FreeBSD General | 0 | 26th February 2009 02:25 AM |
The case of the missing 24GB | Bruco | FreeBSD General | 3 | 20th October 2008 06:44 PM |
Update from 6.3 to 7.0 (libs missing etc.) | Calderon | FreeBSD Installation and Upgrading | 16 | 17th May 2008 09:03 PM |