# problem with sata port



## Jimny (Nov 18, 2020)

hello,

I have encountered a strange problem.

I bought a Chuwi corebox. It has an M.2 port with 256GB SSD installed and a spare sata3 port. I decide to install freebsd 12.2 on the 256GB SSD and connect a 2.5 inch HDD to that sata3 port.

The freebsd installation was successful and I can login to my account. So I powered off the corebox and connected the 2.5inch HDD to the sata3 port. After that, a problem occurred during the boot sequence, it prompted:

```
Mounting from ufs:/dev/ada0p2 failed with error 19.
```
then the "mountroot>" follows.

I am sure that the freebsd is installed in the M.2 SSD with the sata3 port unconnected and that should be ada0. So the 2.5inch HDD should be ada1 after I connected it to the sata3 port. And I use the default installation scheme with no changes to the partition.

When I enter "ufs:/dev/ada1p2" after "mountroot>", it works! The system boots successfully and the login prompt appears.

It seems that the HDD is assigned to ada0 and the SDD is assigned to ada1. How can this happen? And how can I fix this problem?


----------



## SirDice (Nov 18, 2020)

The order can change when you add/remove disks. That's just a fact of life. Use labels instead of drive names in fstab so the order doesn't matter any more.





__





						FreeBSD Labeled Filesystems
					





					www.wonkity.com


----------



## Jimny (Nov 18, 2020)

SirDice said:


> The order can change when you add/remove disks. That's just a fact of life. Use labels instead of drive names in fstab so the order doesn't matter any more.
> 
> 
> 
> ...


Hi, SirDice
Thank you for your reply.
The problem has been solved. The solution is to change all the adap0 to adap1 in fstab.


----------



## SirDice (Nov 18, 2020)

Yes, but if you remove that SATA drive it's going to change back to ada0 again and you will need to modify fstab again. If you use the labels then this won't be necessary.


----------



## Jimny (Nov 18, 2020)

SirDice said:


> Yes, but if you remove that SATA drive it's going to change back to ada0 again and you will need to modify fstab again. If you use the labels then this won't be necessary.


emm... You are right! I will read the web and use the label to indicate the disks.


----------



## SirDice (Nov 18, 2020)

The standard installation already creates partitions with labels on them. Look at the output from `gpart show -l`, adjust your fstab accordingly. When you get that mountroot prompt, also make sure to use the label. If done correctly then it's not going to matter any more if the disk shows up as ada0 or ada1.


----------



## T-Daemon (Nov 18, 2020)

Jimny said:


> I will read the web and use the label to indicate the disks.


Have also a look at this excellent HowTo from a forum member:









						Labeling partitions done right on modern computers.
					

If you have ever added or removed a disk from your computer running FreeBSD, you have probably experienced that device names had moved around after a reboot and FreeBSD wouldn't boot anymore or a ZFS pool failed. Labels can work around that.  Before we start, it’s important to know that there...




					forums.freebsd.org


----------

