No boot after power failure

Hi,

this is my first post. Sorry, if this is the wrong Subforum but I've had found a similar post in this subforum. Feel free to move this to the right place... (And excuse my english, I'm not a natural speaker)

As said in the subject, my system will not longer boot from ada0 after a power failure. Something switched the breaker...
So, all the data is still there, the system will simply not start.
At the moment I have the system up and running with the help of an LiveUSB-Stick.

The boot prompt say, that there is no bootloader and no kernel on ada0p2 (but if I read gpart right, the bootloader should be in ada0p1, or am I wrong?!?)
Bash:
gptboot: No /boot/loader on 0:ad(0p2)
gtpboot: No /boot/kernel/kernel on 0:ad(0p2)

FreeBSD/x86 boot
Default: 0:ad(0p2)/boot/kernel/kernel

This is how gpart see my system at the moment:

Bash:
gpart show
=>       40  937703008  ada0  GPT  (447G)
         40         24        - free -  (12K)
         64       1024     1  freebsd-boot  (512K)
       1088        960        - free -  (480K)
       2048    4194304     2  freebsd-ufs  (2.0G)
    4196352   16777216     3  freebsd-swap  (8.0G)
   20973568  916727808     4  freebsd-ufs  (437G)
  937701376       1672        - free -  (836K)

=>      40  61439927  da2  GPT  (29G)
        40    409600    1  efi  (200M)
    409640      1024    2  freebsd-boot  (512K)
    410664      7128       - free -  (3.5M)
    417792   1572864    3  freebsd-ufs  (768M)
   1990656  59449311       - free -  (28G)

=>     63  3928113  da0  MBR  (1.9G)
       63     1985       - free -  (993K)
     2048  3926016    1  fat32  (1.9G)
  3928064      112       - free -  (56K)

ada0 is my maindisk, da2 is the LiveUSB-Stick and da0 carries some extra-config for the Live-System (like IP-Adresses, users, and so on)

My goal is to remove da0 and da2 and work just with ada0, like in the past.

I'm from windows with linux skills, but I'm a relative noob with freebsd... This system only exist in my household because of its ZFS-capabilities.

Because of my lack of skills, I don't know exactly what to google and when I find something that only "halfway" fits, I hesitate to do it because I'm doing "open-heart surgery" here...

Feel free to ask what you need to help and I'm looking forward for your help in fixing my system.
 
In fact, the message you see comes from the second stage of booting. I mean gptboot which is located inside ada0p1 in the freebsd-boot partition. It can't find the files /boot/loader and /boot/kernel/kernel in order to continue the boot. See boot(8).

I don't know why you have two freebsd-ufs partitions (but, I almost never used UFS). I don't know on which partition these files are supposed to be. The system "thinks" they are on ada0p2 maybe because it's the first UFS partition but, these partitions can also have attributes, see gptboot(8).

If I was you, the first thing I do would be to check these two partitions for errors.
fsck ada0p2 and fsck ada0p4
 
Have a look at /boot/loader.conf.
I have two lines for zfs.
Code:
currdev="zfs:ZT2/ROOT/default:"
vfs.root.mountfrom="zfs:ZT2/ROOT/default"
You can change this for ufs.
 
I don't know why you have two freebsd-ufs partitions

This is because the SSD is "split" into system and data. As I mentioned, I come from Windows. All of my Windows computers have separate system and data partitions, so I did this with my bsd-machine as well.
To understand: You say the system finds the bootloader on the SSD and this tells the system to read the data required for booting from ada0p2, right? Hmm. See my comments under the next quote, I think it can't access that partition because of the error.

If I was you, the first thing I do would be to check these two partitions for errors.
fsck ada0p2 and fsck ada0p4

I did. The last line doesn't look good, does it? (btw: fsck ada0p4 shows no problems)

Bash:
% sudo fsck ada0p2
Password:
** /dev/ada0p2
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
UFS2 cylinder group 0 failed: cgp->cg_ckhash ("0") != calchash ("3338855313")
UFS2 cylinder group 0 failed: cg_chkmagic(cgp) ("0") == 0 ("0")
UFS2 cylinder group 0 failed: cgp->cg_niblk ("0") != sblock.fs_ipg ("65664")
UFS2 cylinder group 0 failed: cgp->cg_initediblk ("45605459") > sblock.fs_ipg ("65664")
CYLINDER GROUP 0: INTEGRITY CHECK FAILED
UNEXPECTED SOFT UPDATE INCONSISTENCY

REBUILD CYLINDER GROUP? [yn] y

PARTIALLY ALLOCATED INODE I=383
UNEXPECTED SOFT UPDATE INCONSISTENCY

CLEAR? [yn] y

PARTIALLY ALLOCATED INODE I=447
UNEXPECTED SOFT UPDATE INCONSISTENCY

CLEAR? [yn] y

INODE CHECK-HASH FAILED I=448  OWNER=root MODE=401
fsck: /dev/ada0p2: Segmentation fault

"Segmentation fault": At this point I'm close to go to the local computer store, buy a new SSD, install the system as before, and copy the data partition to the new SSD...
Or is there any hope for a segfaulted drive?
 
"Segmentation fault": At this point I'm close to go to the local computer store, buy a new SSD, install the system as before, and copy the data partition to the new SSD...
Or is there any hope for a segfaulted drive?

That is more likely to be an issue with the computer, not the drive.

Your next step is memtest86.
 
You can try to run fsck -f ada0p2 but, I'm not sure this will actually correct the file system. If it won't, I will reinstall the base system on ada0p2, hoping that the FreeBSD installer allows this.

Segfault is typically not a problem with hardware but with software. It points a bug in fsck in this peculiar circumstance.
 
… or very damaged filesystem …

I'd check this before anything else.

Boot from a suitable installer medium, use the fsck that's on this medium.

fsck -fn

(Discover as much as possible about what's detectably wrong, before attempting a repair.)
 
Back
Top