UFS How to change default mounting point

rondo

New Member


Messages: 4

Hi all,

I have migrated a FreeBSD 9.0-RELEASE-p3 from VMware to HyperV. The migration appears to have been succesfull, but when I start the migrated server I get this mounting error:

Mounting failed with error 19.JPG


I can mount correctly with this command:

ufs:/dev/ada0p2

However, after a reboot it will again try to mount from ufs:/dev:da0p2. How can I make sure that the server always mounts from ufs:/dev/ada0p2?

Thanks,
Ronnie
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,939
Messages: 36,872

FreeBSD 9.0 is end-of-life since March 2013 and not supported any more. Please upgrade to a supported version as soon as possible.

How can I make sure that the server always mounts from ufs:/dev/ada0p2?
After you booted the system have a look in /boot/loader.conf. There should be a vfs.root.mountfrom, set that correctly.
 

im

Member

Reaction score: 37
Messages: 87

However, after a reboot it will again try to mount from ufs:/dev:da0p2
Are you checked your /etc/fstab ?
Usually you must edit fstab after migrating. Just set correct mount points for all filesystems.
 

Zirias

Daemon

Reaction score: 1,163
Messages: 2,097

Are you checked your /etc/fstab ?
Usually you must edit fstab after migrating. Just set correct mount points for all filesystems.
Boot loaders don't look in fstab. Follow SirDice's advice.
(Doesn't hurt correcting fstab as well of course)
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,939
Messages: 36,872

Are you checked your /etc/fstab ?
Definitely something to check too, but according to the OP the system boots fine after manually entering the vfs.root.mountfrom. Looking at the output it looks like a typo was made, it refers to da0 instead of ada0 or ad0.
 

obsigna

Daemon

Reaction score: 828
Messages: 1,233

I am not sure. Did FreeBSD 9.0-RELEASE come with the sysctl kern.cam.ada.legacy_aliases? This sysctl was introduced to solve this kind of problems:
The ata(4) driver now creates symbolic links for backward compatibility when ATA_CAM kernel option is enabled. In a kernel with ATA_CAM, an ATA/SATA disk is recognized as a device node with a name ada0 instead of ad0. A symbolic link /dev/ad0 is automatically generated for /dev/ada0 to keep backward compatibility. This symbolic link generation can be controlled by a kern.cam.ada.legacy_aliases (enabled by default when ATA_CAM is set).

Note, said sysctl does no more exit on non EoL FreeBSD systems.

Try # sysctl kern.cam.ada.legacy_aliases
  • If the output is sysctl: unknown oid 'kern.cam.ada.legacy_aliases', then forget it, your system is so old that it did no not even see this introduced and some years later removed sysctl setting.

  • If the output is kern.cam.ada.legacy_aliases: 0 then try setting it to 1 in /boot/loader.conf
Otherwise, my best advise would be to upgrade your zombie.
 

olli@

Daemon
Developer

Reaction score: 1,214
Messages: 1,108

I am not sure. Did FreeBSD 9.0-RELEASE come with the sysctl kern.cam.ada.legacy_aliases? This sysctl was introduced to solve this kind of problems:
No, that’s not related to this problem. That sysctl was introduced for the migration from the “ad” to “ada” (anyone remember “wd”?) when updating, but the problem of the OP relates to “da” (not “ad”), and he didn’t update at all, he just migrated the VM. Apparently, VMware emulated a SCSI disk, while HyperV emulates a SATA disk, hence the device names change.

Nonetheless, as SirDice pointed out, FreeBSD 9.0 is end-of-life for a long time already and has accumulated quite a few security vulnerabilities. It should be updated to a supported release urgently.
 
OP
R

rondo

New Member


Messages: 4

Hi all,

Thanks a lot for your replies. Unfortunately I don't think I can upgrade. The server is running one of the company's app, and that's an old version which I'm not sure can run on a newer FreeBSD version. However, I've made a copy and would like to try to upgrade the OS to see if the app is still working. Do you have a user guide to perform the upgrade?

Secondly, when I try to run the /boot/loader.conf I get a Permission denied error. I'm logged in as root. Do you have any suggestions for a work around about this?

Thanks a lot,
Ronnie
 

Attachments

  • Skærmbillede 2021-04-12 kl. 21.29.28.png
    Skærmbillede 2021-04-12 kl. 21.29.28.png
    78.2 KB · Views: 23
  • Skærmbillede 2021-04-12 kl. 21.39.28.png
    Skærmbillede 2021-04-12 kl. 21.39.28.png
    137.4 KB · Views: 22
  • Skærmbillede 2021-04-12 kl. 21.41.52.png
    Skærmbillede 2021-04-12 kl. 21.41.52.png
    349.9 KB · Views: 21

Misirca

New Member

Reaction score: 4
Messages: 17

when I try to run the /boot/loader.conf I get a Permission denied error
Actually, it's a configuration file, not an executable, so an error message is expected.

As mentioned earlier, you should edit this file, # ee /boot/loader.conf

Search for the line vfs.root.mountfrom=, and replace da0p2 with ada0p2

Best luck ;)
 

_martin

Aspiring Daemon

Reaction score: 226
Messages: 984

Before you start editing anything what is the contents of your /etc/fstab and /boot/loader.conf?
Actually you don't need to specify anything in loader.conf, fstab is sufficient if set correctly.
 

chungy

New Member

Reaction score: 9
Messages: 19

If FreeBSD 9 supported it (I am not sure), you can use /dev/gpt (GPT labels), /dev/gptid (GPT UUIDs), or /dev/ufs (UFS labels) to better describe your file systems and protect from changing the underlying hardware.

Of course, updating to FreeBSD 12.x or 13 will be the most advisable course of action. If your software really depends on 9.x's userland, you can stuff the old system into a jail on a newer FreeBSD release.
 
OP
R

rondo

New Member


Messages: 4

Thanks so far - I changed the /etc/fstab file and now the mounting part is working. I've also upgraded to v. 10.0 and will upgrade to a newer version while testing if the program installed is still working.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,939
Messages: 36,872

and will upgrade to a newer version while testing if the program installed is still working.
What application is that? We might be able to assist with that.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,939
Messages: 36,872

I found several applications that are named that, so you're going to need to be a little more specific. If it's about the WeDo planning application then I have some bad news, they shutdown in September 2020. Probably not a good idea to keep running it.
 
Top