# Booting FreeBSD from USB stick



## polle (Nov 24, 2010)

Recently I bought myself an Asus eee pc 701, as this pc boots easily from usb, its ideal to try some different OS on it. So I decided to try also FreeBSD. Installed it this way: downloaded an usb image of freebsd 8.1, wrote it to stick, booted and from here started the installation on other usb stick.installation went ok, and after booting started to get some addtional packages and configuring (installed Xorg, Xfce4, configured sound and wireless with WPA)
Only one problem left for the moment: when I boot I have to place the live usb stik also in the eee pc,if not boot fails with 'cannot mount root file system')
Tried this:





> There is a longstanding problem in the case where the boot disk is not the first disk in the system. The BIOS uses a different numbering scheme to FreeBSD, and working out which numbers correspond to which is difficult to get right.
> 
> In the case where the boot disk is not the first disk in the system, FreeBSD can need some help finding it. There are two common situations here, and in both of these cases, you need to tell FreeBSD where the root filesystem is. You do this by specifying the BIOS disk number, the disk type and the FreeBSD disk number for that type.
> 
> ...


But didn't find a way to get it working
I looked at /etc/fstab:

```
/dev/da1s1b    none  swap sw 
/dev/da1s1a    /     ufs  rw
/dev/da1s1f    /home ufs  rw
/dev/da1s1d    /usr  ufs  rw
/dev/da1s1e    /var  ufs  rw
```
If I change the entries in /dev/da01s1a and so one, will that make that I can boot without the live usb in the slot?
(while booting I can see that boot order is like this: 1 ssd, 2 usb live, 3 usb free bsd, 4usb sd card)
So that is why I think that with usb live removed, my freebsd changes from second to first da.
But as I'm new to freebsd and don't understand well its bootloadr and booting I would like to have your opinion before changing things in /etc/fstab and leaveme with an unbootable system


----------



## SirDice (Nov 24, 2010)

Yes, the order of drives changes if you order the USB drives around. The only 'real' way to circumvent this is to do an install by hand and use labels for each partition. The labels will never change so the order won't matter anymore.


----------



## polle (Nov 24, 2010)

SirDice said:
			
		

> Yes, the order of drives changes if you order the USB drives around. The only 'real' way to circumvent this is to do an install by hand and use labels for each partition. The labels will never change so the order won't matter anymore.



Ok, but that still doesn't answer my question,will changing fstab solve it or make things worse?


----------



## jalla (Nov 24, 2010)

Well, it won't make it worse  Either you hit the right devices or you don't.
In any case, note that at the 'cannot mount root' message you're prompted for the correct root device. From there you should be able to boot to singleuser, mount your filesystems manually, and fix fstab before you continue.


----------



## polle (Nov 24, 2010)

ok, I changed /etc/fstab and now freebsd boot from usb stick without ht nedd toputother stickin slot 1, thanks for the help


----------

