# Booting from second disk



## barp (Sep 19, 2012)

Hi, I have two disks that I need to use. First one has FreeBSD 9.0 and I installed FreeBSD 10 to the second one. The disk partiation is:

```
Filesystem      Size    Used   Avail Capacity  Mounted on
/dev/ada0p2     453G    2.5G    415G     1%    /
devfs           1.0k    1.0k      0B   100%    /dev
/dev/ada1s1d    458G    5.0G    416G     1%    /second_disk
```
So, I am on 9.0 and I installed kernel and world of 10.0 on /second_disk. I made it bootable in sysinstall.

My /etc/fstab file is:

```
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/ada0p2     /               ufs     rw      1       1
/dev/ada0p3     none            swap    sw      0       0
/dev/ada1s1d    /second_disk    ufs     rw      2       2
```
So, when I want to boot from /second_disk it gives the error,

```
Invalid Partition
No /boot/loader

FreeBSD/x86 boot
Default: 0:ad(0,a)/boot/kernel/kernel
boot:
invalid partition
No /boot/kernel/kernel
```
So, I read on forums is that it is needed to run
`# bsdlabel -e ada1s1`

for changing the label from d to a. But it gives the error 

```
bsdlabel: cannot open provider /dev/ada1s1 for writing label: Operation not permitted
bsdlabel: Try to use gpart(8).
```
How to fix it?


----------



## wblock@ (Sep 19, 2012)

There's no reason to mix the old MBR style with GPT partitions.  Use GPT with gpart(8).  fdisk(8) and bsdlabel(8) can be avoided, too.

That could also be causing the boot problem.  gptboot boots from the first disk, but then finds no GPT partitions on the second disk.  Probably have to set vfs.root.mountfrom in the loader before booting.

This all seems like more work than just doing a full install of 10.0 on the second disk and using the BIOS boot menu to select which disk boots.


----------



## scottro (Dec 22, 2019)

7 years later, this is still helpful. Thanks wblock@


----------

