I've installed FreeBSD-7.4 on a 2000 make PC (* specs below)

When the disk is connected to the primary IDE socket, the OS boots fine but when it's connected to the secondary IDE socket, it boots only the first section, which greets you with a menu with options like "1. Boot FreeBSD [default]" "3. Boot FreeBSD in Safe Mode", etc.

I select the default 1st option and it boots for a while more and then it says

Trying to mount from ufs:/dev/ad0s1a
freebsd manual root filesystem specification:
<fstype>:<device> [options]   Mount <device> using filesystem <fstype>
                                eg. ufs:/dev/da0s1a
  ?               List valid disk boot devices
  <empty line>    Abort manual input

and drops into a useless mountroot prompt. Typing ? gives

List of GEOM managed disk devices:
  ufsid/5c922e4292c8e9fa ufsid/5c922e435b48afb7 
ufsid/5c922e4343d7ab4b ufsid/5c922e44e470015a 
ufsid/5c922e424bf39462 ad2s1g ad2s1f ad2s1e 
ad2s1c ad2s1b ad2s1a ad2s1 ad2

entering mount ufsid/5c922e4292c8e9fa and trying with all other devices, returns

Trying to mount root from mount ufsid/5c922e4292c8e9fa, etc, i.e. not giving any helpful info.

A similar problem has been posted at mixed IDE/SATA disks and boot troubles but it didn't help; it's just similar.

If I unplug the 40-pin ribbon IDE cable from the IDE2 socket and plug it into the IDE1 socket, then things returns to normal. This problem is limited to the case when the disk is used as secondary master IDE disk.

Actually, this problem first happened as I tried to access a second IDE disk from the primary IDE disk on which the same FreeBSD is installed.

When I did mount /dev/ad1* /mnt/mydisk ad1* being various options ad1s1 , ad1s1a, ad1s1b all of them consistently returned mount: /dev/ad1s1: Operation not permitted I suppose it couldn't mount the second IDE disk because there was problem in the secondary master IDE connection. I guess this problem might be fixed from the Bios settings. There a many Bios settings related to the primary and secondary IDE disks, like "Mode: LBA, Large, Auto" but I don't know what does what and I don't want to try random settings to fix this by chance.

How to boot from the secondary master IDE and/or how to use a second IDE disk in FreeBSD?

  • PC specs: PII 400Mhz, Gigabyte Intel 440BX MoBo, 512MB RAM, 16MB RAM graphics card, 15GB Ouantum Fireball IDE harddisk, Award Bios with the 2002 firmware
  • The boot loader wants a root filesystem syntax like <fstype>:<device>, e.g. ufs:/dev/ad2s1a. Try entering that and then continuing the boot from that slice, and edit your question to show the results of that. The odds are good that the root partition that was /dev/ad0s1a on the primary IDE becomes /dev/ad2s1a when it's connected to the secondary IDE.
    – Jim L.
    May 11, 2021 at 4:31

1 Answer 1


The boot loader does not see which BIOS drive maps to which IDE channel & master/slave position, so it simply assumes that hard drives are populated in primary–secondary, master–slave order without holes, and maps BIOS drive C, D, E… to IDE drive ad0, ad1, ad2.

On the other hand, IIRC the FreeBSD 7 default kernel (GENERIC) has a hard-wired IDE drive mapping:

  • /dev/ad0 is primary master
  • /dev/ad1 is primary slave
  • /dev/ad2 is secondary master
  • /dev/ad3 is secondary slave

In your case, the primary channel is not used, so the BIOS assigns drive C (0x80) to your FreeBSD hard drive. The boot loader then sees and boots off the BIOS drive C (/dev/ad0) slice 1 (likely the only partition on the drive) BSD disklabel partition a, converting that partition into /dev/ad0s1a and passing ufs:/dev/ad0s1a as the boot device to the kernel.

On the other hand, the kernel boot-up sequence scans the IDE channels and sees your FreeBSD drive at secondary master. Per the hard-wiring scheme above, the kernel assigns ad2 to the drive (not ad0). So when it's time to mount the rootdev it does not see ad0s1a passed down from the boot loader.

If your setup (FreeBSD on secondary master) is to stay, you need to fix up your configuration. Steps:

  1. Place the drive in the same IDE channel (primary/secondary) and the same position (master/slave) as when you first installed FreeBSD. (From your description it seems to be primary master.)
  2. Start the system.
  3. Once booting finishes, log in as root.
  4. Run this to teach the boot loader to pass ad2 (secondary master) to the kernel as the boot drive:
    echo 'vfs.root.mountfrom=ufs:/dev/ad2s1a' >> /boot/loader.conf
  5. Shut down the system.
  6. Put the drive back on the secondary IDE channel.

From the next boot, the kernel will use /dev/ad2s1a as the root device, ignoring the hint from the boot loader.

Note: You need to adjust the boot device in /boot/loader.conf if you want to move your drive to a different channel/position.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.