How to repair BFS partition?

My question is as simple as that. I killed my BFS boot partition, so I can`t boot. If I boot from CD I can’t mount the partition (error: general error). So how can I repair that? Checkfs can only be used on mounted partitions.
Are other tools included in recent nightlies?

Start haiku from cd. And then open a terminal.

makebootable /path/to/bfs/disc

If only the bootsector are broken.

The disk is located at /dev/disk/scsi/0/3/0/raw, the partition I want to boot from is located at /dev/disk/scsi/0/3/0/1.
Also present is a extended partition at /0/3/0/0 with a FAT32 partition at /0/3/0/0_0.

makebootable using the /0/3/0/1 does not work. Using the raw device resulted in a trashed MBR. So what device am I supposed to use?

If you can’t mount the partition, it is unlikely that you can fix it.
However, the “recover” tool can be used to try to recover some files from it onto another partition (with enough free space).
You may need a 64bit version of Haiku and a very large swap file, depedning on the number of files that are on the partition.

Really? Haiku has no way to repair a volume before mounting?
Still what would be the correct path for makebootable?

makebootable also needs the volume to be mounted, because it needs to read some files inside it to find where the stage 2 bootloader is located.

There is a “makebootabletiny” around which could work without mounting, but I’m not sure it will work with package management.

When your filesystem is corrupt to the point you can’t mount it, it is dangerous to attempt in-place repair. So, tools like recover are the best choice to try to get your data back, without corrupting the source disk even more.

Or just back up your data regularly and don’t worry about it. Just reformat the partition and reinstall all your backed up files. That’s what I do.

That is exactly what I will do today, just format and reinstall. And write a script which makes some backups of my home folder during start up. But somehow it troubles me that the possibilities of data recovery seems to be limited.

First, realize the tools on other OSes that do in-place repair are considered very dangerous.

Worse than not being able to recover the files, they often give you a valid partition but the files inside the partition as corrupted. And you often do not know which ones or how bad it is.

Even if you use another OS the standards are to recover the files to a different partition and then BACKUP, BACKUP and BACKUP!

I don’t agree with your statement about dangerous in-place repair. It may result in file/data loss but at least I can mount the partition and copy files without need for special repair tools.
But that is not what I find disturbing. I think it is strange that there are recovery tools available but they are not included on CD and seem to have issues with memory consumption (see PulkoMandys reply 4). Which effectively means that I can’t use the tools directly but I have to use a special recovery partition/disk for this task.

And yes, not having a backup is indeed entirely my fault.