UFS My FreeBSD system is unable to mount a hard drive and is saying that the file isn't there even though it is.

I am running FreeBSD 12.2.

I have a hard drive connected through SATA to the computer. It has been formatted as a freebsd filesystem. Its name according to
Code:
geom disk list
is ada0. I checked the /dev file and ada0 is definitely there. Whenever I try to mount it with
Code:
mount /dev/ada0 /MOUNTPOINT
it gives me an error saying that there is no file /dev/ada0. This is completely impossible because there is a file called /dev/ada0 and I checked.
Why does FreeBSD mount say that a hard drive doesnt exist when it definitely does?
 
Partitioning and formatting ( newfs)?

Paste:
dmesg | grep ada0
cat /etc/fstab
ls -ld /dev/ada0
ls -ld /MOUNTPOINT
 
In addition to the information CuatroTorres already requested ...

I have a hard drive connected through SATA to the computer. It has been formatted as a freebsd filesystem.
That seems a little bit unlikely, but theoretically possible: on FreeBSD (and in fact on most Unix-derived systems), one typically doesn't create a file system on a whole disk, but on a partition or slice of a disk. Typical partition names are /dev/ada0p2 or /dev/ada3p0 and so on. It is possible to create a file system on a whole disk (bypassing the partitioning system completely), but that requires manual commands, and is unusual and a bad idea.

Because naming disk partitions by a system that relies on counting is difficult and unreliable, best practice is to name disk partitions. Depending on how that file system was created, it probably has a name, such as /dev/gpt/foo_bar_movable_disk. Referring to partitions by their name is easier and safer.

Furthermore, there is no single "freebsd filesystem". There are two file systems in common use in FreeBSD, namely UFS and ZFS. The way they are mounted is quite different.

So: Can you please tell us how that file system was created? And try to find the partitions? For example, with the command "gpart list ada0"?

Its name according to "geom disk list" is ada0.

That's possible, but again somewhat unlikely. The command "geom disk list" (which is very similar to the output from gpart list and then looking only at whole disks) gives you a list of all disks found. In a typical installation, /dev/ada0 will be the boot disk, which by construction has to have some partitions already mounted when the system is running. So I don't think that ada0 is a disk you connected recently.

I checked the /dev file and ada0 is definitely there.
That seems perfectly reasonable, but it doesn't mean that ada0 contains a file system, and even less that it can be mounted. Matter-of-fact, just saying that /dev/ada0 exists doesn't even mean that it is a disk device. Can you show us the output from "ls -l /dev/ada0"? And make sure you are running as root?

Whenever I try to mount it with "mount /dev/ada0 /MOUNTPOINT" it gives me an error saying that there is no file /dev/ada0.
That is indeed an unusual error message. The typical one would be "operation not permitted", which also is given if the device is the wrong type (for example whole disk if one partition is already in use). Please tell us the exact error message, there is a huge difference between "mount: /dev/ada0: No such file or directory" and "mount: /mountpoint: No such file or directory".

In summary, let's do some step-by-step debugging. What you are saying here is unlikely or impossible to be the whole situation.
 
Is there a slice or partition of that? Starting with /dev/ada0, like /dev/ada0s1a or /dev/ada0p1. If it has partitions or slices within that drive, it won't mount as one whole drive, but instead will need to for each slice or partition at a time. It also may depend on what you have for that partition in /etc/fstab.
 
Back
Top