Solved Running FreeBSD from external USB drive : possible to always assign da0 to it ?

Hello !
I don't know if my title ils clear, here is the problem.

I run FreeBSD from an external SSD (USB enclosure, ZFS filesystem), everything does work fine but, of course, my fstab devices point to da0 which is fine to boot.
Fine most of the time, but if I boot with another USB drive plugged in, I'll end in single user mode because /bin/sh is not found (quite normal, da0 is another drive).

My question is : can I add a line in fstab (or somewhere else) to force the system to assign da0 to the FreeBSD drive ? (Is it even possible...?)

Note that the drive is always plugged to the same connector (I have only one USB 3.2 connrctor), it might be helpful.

Thanks very much, that's definitely not a major problem but I'd love to solve it 😄
 
Thanks very much !!!
I feel damn' stupid I missed it, because the handbook explains EXACTLY my situation.

Handbook

Shame on me !!
I'll test this tomorrow if I have enough time and I'll feedback.

Thanks again, you rock 🤟
 
Thanks again, but small question because I wouldn't like to break everything...
On my fstab: I have the following lines I have to change (ZFS pool ; there's also proc) :
Code:
# Device                                        Mountpoint                      FStype  Options         Dump    Pass#
/dev/da0p1                                      /boot/efi                       msdosfs rw              2       2
/dev/da0p3                                      none                            swap    sw              0       0

If I'm not wrong, I'll have then to use (labels are for example) :
Code:
gpart modify -l bsdefi -i 1 da0
gpart modify -l bsdswap -i 3 da0

Then I simply edit fstab...?
Code:
# Device                                        Mountpoint                      FStype  Options         Dump    Pass#
/dev/gpt/bsdefi                                    /boot/efi                       msdosfs rw              2       2
/dev/gpt/bsdswap                                      none                            swap    sw              0       0

Thanks again, I try not to break my setup... !
 
Thanks very much. I tried and... woa, it boots perfectly. I tested with a setup known to move daX, and it works perfect - my main disk went to da1, and it booted fine.
I'm very happy how easy it was, and I'd like to thank you all for your help... Hope this can help other people, because if you're really novice, you start looking on
tunefs(8)(), newfs(8)() or glabel(8)() and it can be disturbing, mainly if you're running ZFS. gpart(8)() does it easily, that's so KISS :)
 
Back
Top