# Multiboot



## b727plane (Monday at 3:03 AM)

I created a multi-boot on my laptop with Debian Linux and FreeBSD and another Linux on a thumb drive. I updated and now when I boot into FreeBSD, it falls into a mountroot terminal. The message says "waiting for device /dev/ada0s1a" which is incorrect. It should be ada0s4b. I have searched for four days and even tried solutions from the /bin/sh shell, but it is read-only. One message says it is not a "login shell." I'm trying not to have to reinstall because I have had this setup for over a year learning and experimenting. Is there a way to change how it can go to the correct device or can I rollback? I am beyond my witts end. Can someone lead me to a solution? Thank you.


----------



## SirDice (Monday at 12:04 PM)

The howto section is not for asking how to do things. Thread moved.


----------



## SirDice (Monday at 12:06 PM)

Boot to single user mode, I assume the entries in /etc/fstab are incorrect and that's why it's failing. 

For UFS:

```
fcsk -y
mount -a
```

For ZFS:
`zfs set readonly=off zroot/ROOT/default` # Assuming the default pool name and BE, adjust where needed.

You should learn these commands by heart. In single user mode only the root filesystem is mounted and will be mounted read-only.


----------



## T-Daemon (Monday at 2:58 PM)

b727plane said:


> ... when I boot into FreeBSD, it falls into a mountroot terminal.The message says "waiting for device /dev/ada0s1a"


When the boot ends printing the above message and presenting a mountroot prompt, then it's not possible to boot into single user mode. The root file system won't be mounted (read-only) at this stage, no /bin/sh shell to execute fsck or zfs commands.

With a Linux system on a thumb drive, every time that drive is plugged in or unplugged the FreeBSD device names will change *[EDIT]* which probably here won't be the case. USB devices are named /dev/daX *[/EDIT]*. Better is to label the partitions and modify the /etc/fstab accordingly.

b727plane, does the FreeBSD system boot normal when the thumb drive is unplugged?

*[EDIT]* if what covacat suggests doesn't work, enter `?` and post the output. *[/EDIT]
*


----------



## covacat (Monday at 3:13 PM)

you still should be able to type ufs:/dev/ada0s4b at the mountroot> prompt
then you might need to add a line to loader.conf to set 

vfs.root.mountfrom="ufs:/dev/ad0s4b"
a 'b' bsd partition is usually for swap but if you got creative it is what it is


----------



## b727plane (Tuesday at 2:11 AM)

Thanks all. I still cannot find what the drive designation would be. with the ? i get list of GEOM disk drives.


----------



## b727plane (Tuesday at 2:20 AM)

ufs: /dev/ada0s4a took me to "Enter full pathname of shell or RETURN for /bin/sh:"
root@:/ #


----------



## SirDice (Tuesday at 9:04 AM)

b727plane said:


> ufs: /dev/ada0s4a took me to "Enter full pathname of shell or RETURN for /bin/sh:"
> root@:/ #


Your /etc/fstab is still referencing the 'old' drive's designation. Pro tip, use labels instead of drive/partition names.


----------



## b727plane (Thursday at 10:45 PM)

I know you all probably have been doing this for years, but I'm trying to transition into FreeBSD. I'm not getting past this point to fix this situation. Is there a way to fix this from inside FreeBSD at the root@:/ or from the mountfrom prompt?


----------



## T-Daemon (Yesterday at 12:57 AM)

b727plane said:


> ufs: /dev/ada0s4a took me to "Enter full pathname of shell or RETURN for /bin/sh:"
> root@:/ #


Enter there `exit`. This will boot the system into multi-user mode.

Log in as root or user, edit as root /etc/fstab, set `/dev/ada0s4a` to the root ( / ) file system line.

```
# Device        Mountpoint    FStype    Options        Dump    Pass#
/dev/ada0s4a    /             ufs       rw             1       1
```
Eventually also set for swap the correct partition.


----------



## b727plane (Yesterday at 12:59 AM)

okay further I was able to get into root single user mode the su to my user name
I did a cat /etc/fstab
# Device           Mountpoint       FStype     Options    Dump     Pass#
/dev/ada0s1a    /                        ufs            rw            1             1
/dev/ada0s1b    /home               ufs            rw            2             2
/dev/ada0s1d    none                 swap        sw            0             0
# KDE
proc                   /proc                 procfs      rw             0             0
fdeesc                 /dev/fd             fdescfs    rw             0             0
# LINUX
linsysfs               /compat/linux/sys               linsysfs        rw        0         0
# USB
# /dev/da0p2      /myusb               msdosfs  rw            0              0

prior to whatever cause me to loose my Freebsd, I was able to boot into all three. 

I did a fsck -y
** /dev/ada0s4a (NO WRITE)
** SU+J Recovering /dev/ada0s4a

USE JOURNAL? no

** Skipping journal, falling through to full fsck

it went through Phases 1 - 5 then sai
Can't stat /dev/ada0s1b: No such file or directory

I then did mount -a and it said
mount: /dev/ada0s4a: Operation not permitted
mount: /dev/ada0s1b: Operation not permitted

How do I fix this? Normally, I would use sudo fsck but not sure in this case to get permission


----------



## b727plane (Yesterday at 2:10 AM)

SirDice you are correct. It is referring to the wrong drive.


----------

