Solved Reinstall FreeBSD without formatting /home

Dear FreeBSD users,

My desktop has frozen a lot during last month. I knew I had to act quickly. But, I was too late!

I was forced into single-user mod since / could not be mounted. Running fsck -y, I discovered bad sector on / partition, particularly:
Code:
CANNOT READ: BLK XXX
The problem seems to be severe, as fsck failed to fix it. After going through several threads on fourm, I came to understand that these bad sectors can be automatically replaced by spare sectors. Or I can use dd to save data into another disk.

I don't have an extra disk. At the moment, I am thinking to reinstall FreeBSD 10.1 on my desktop, backup important data in /home and replace the HDD.

Back in Linux day, I can reinstall it on/ leaving /home untouched. But, I believe this is not possible with BSD installer, since all partitions will be formatted.

So my questions are:
1. Is there any way for me to install FreeBSD but leaving my data on /home untouched?
2. I can still mount /home in single-user mode. Is there a way to access internet and upload my data somewhere else temporarily?

I am very grateful if someone can point me to the right direction.
fsck_output.jpg
 
If /home was on a separate partition or filesystem, then yes, you can reinstall without touching it. But I'm guessing you used the standard, default, partitioning, which puts everything (including /home) on a single filesystem. In that case, no, it's not possible.
 
Do you have a USB drive or large thumb drive? Just boot in live CD mode and mount the drive read only and hopefully you can copy your important files away. If I was seeing errors like this, I wouldn't power on the drive unless I was attempting a recovery just to reduce the risk of further damage. Your best bet is probably to save what is important on an external disk and re-install on a brand new drive.
 
SirDice: My /etc/fstab has the following entries:
Code:
/dev/ada0p2         /                ufs            rw
/dev/ada0p3         none             swap           sw
/dev/ada0p4         /usr             ufs            rw
/dev/ada0p5         /home            ufs            rw
So I do have a separate filesystem/partition for /home. I figured out how to keep /home untouched from another thread Thread newfs-without-usr-home.20094.

junovitch: I will follow your suggestion and backup my data to external disk.

Thanks for your replies.
 
Back
Top