LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Make a partition bootable (https://www.linuxquestions.org/questions/%2Absd-17/make-a-partition-bootable-58422/)

J_Szucs 05-06-2003 01:40 PM

Make a partition bootable
 
I made a mistake when replacing a system disk (da0), and I ended up with 5 unbootable partitions:
ad0s1b (should be swap)
ad0s1e (should be /)
ad0s1f (should be /var)
ad0s1g (should be /usr)
ad1s1e (should be /home)
Partitions on the ad0 drive are copies of the partitions on the old da0 drive (copied by cpio), but, as you may see, I do not have a bootable, type 'a' partition, so I cannot boot the system.
All that I have is a bootable FreeBSD 4.8 installation CD, but re-installing the whole system is out of question (too much work, too much time, and maybe too little skill).
My questions are:
1. So far as I can see the first thing to do is to make the ad0s1e partition bootable. Am I right? Can it be done using only the installation CD?
2. If so, what are my chances that the data remains intact on it while the partition type is changed (it should be labelled to ad0s1a)?
3. After making ad0s1e bootable, my next move would be to edit the completely obsolete /etc/fstab file. Am I right? How can I get a command prompt to do that after reboot?
4. I will need partition size information to write it into /etc/fstab. What command can I use to obtain that information?
5. The new swap space (ad0s1b) was formerly partitioned and labelled by sysinstall. Will the system automatically use it (supposed that I write it into /etc/fstab), or do I have to do any other special preparation?
6. When I copied the files from the / partition to the new drive, the system was in a high runlevel. When I copied the /var and /usr partitions, the system was in runlevel 1. What are my chances that the copies are correct in spite of the high runlevels, and I will have a clean system as before?
7. Are there any other special difficulties I cannot foresee?

Tomorrow in the morning I will have to wake up that system in the shortest possible time, so I would be grateful for any help.
Thank you in advance!

J_Szucs 05-07-2003 02:07 PM

I could not do it, and gave it up.

I could not change the file system type of ad0s1e to ad0s1a with sysinstall.
So I deleted everything including the slices and partitions, and decided to start it all over again from the beginning.

Soon after I was wondering about the meaning of a sentence in the FreeBSD manual: "type 'a' partitions are mounted to /". Does this also mean that if I create a partition as usual and specify / as the mount point, then that partition will automatically be a type 'a' partition?
But how could I specify / as a mount point, when the root partition of the old drive is mounted there? I should mount the new drive to /mnt. But then it will never be a type 'a' partition, and the new drive will not be bootable again.
So I decided to give it a try and specified the mount point of the root partition of the new drive as /. At first it seemed to be OK: the new partition was not actually mounted to /, but it became /dev/ad0s1a.

But from the time I mounted it to /mnt, in order that I can copy the files from the old drive to the new one, nothing worked as expected: cpio copied files it should not, these files could not be deleted, while the partition concerned seemed to be empty by df, partitions seemed to be merged, and so forth. I also had tons of 'superblock errors'.
I deleted all partitions on the new drive several times afterwards to get a clear situation, but I could no longer get rid of those errors, so finally I gave it up.

What did I do wrong?
Could anyone tell me how to replace a FreeBSD system drive?

Also: why fdisk told me that the geometry data of the drive is wrong and I should use the same geometry that was recognized by the system bios? I double checked it and it was the same!. Yet, I got this message anytime I tried to (re-)create a slice on the new drive.


All times are GMT -5. The time now is 05:34 AM.