1

I have a laptop. It has two hard drives. One is an SSD with a normal Windows 10 install on it. The other is an mSata with a normal install of FreeBSD13 on it.

To install FreeBSD I removed the SSD, booted from the FreeBSD installer on a USB stick, installed FreeBSD to the mSata using the auto options, then shut down my machine and put the SSD back in.

When I look at gpart show it says this:

=> 63 468862065 ada0 MBR (224G) 63 1985 - free - (993K) 2048 1124352 1 ntfs [active] (549M) 1126400 466549872 2 ntfs (222G) 467676272 912 - free - (456K) 467677184 1179648 3 !39 (576M) 468856832 5296 - free - (2.6M) => 40 250069600 ada1 GPT (119G) 40 1024 1 freebsd-boot (512K) 1064 984 - free - (492K) 2048 4194304 2 freebsd-swap (2.0G) 4196352 245872640 3 freebsd-zfs (117G) 250068992 648 - free - (324K) 

I believe this is telling me that ada0 is my Windows 10 disc, and that ada1 is my FreeBSD disk.

When I look in /etc/fstab I see this line (there are no other entries).

/dev/ada0p2 none swap sw 0 0 

Did my method of installing FreeBSD cause an error? Is this something I need to fix? How should I fix it - what should my /etc/fstab actually say?

I'm guessing it should say /dev/ada1p2.

2
  • @Hannu thank you Hannu. The machine boots fine by using the bios boot option key, which launches the bios boot selection menu, which then boots either Win10 or FreeBSD. This is a normal method of dualbooting FreeBSD. Grub is deprecated for FreeBSD. freshports.org/sysutils/grub2 Commented Mar 21, 2022 at 22:16
  • On your GPT-partitioned disk currently known as /dev/ada1, you should assign GPT labels to each of the partitions, and then your /etc/fstab should reference those partitions by their GPT labels, not by raw /dev/adaXpY devices. That's what GPT labels are for. Unless and until you get that sorted, yes, your fstab on /dev/ada1 needs to reference partitions on /dev/ada1. Commented Mar 22, 2022 at 0:32

1 Answer 1

1

I'm guessing it should say /dev/ada1p2.

You surmise correctly. So long as that particular disk is plugged into that particular controller slot (all other things being equal), your system will probably see it as ada1. So yes, your swap partition on ada1 is correctly referenced as ada1p2.

But if you ever change your disk configuration, the device number may change, and then your /etc/fstab may break. Since you have a GPT partition on ada1, a better practice is to apply a GPT label to the swap partition:

# gpart modify -l bsd-swap -i 2 /dev/ada1 

and then mount it in /etc/fstab using the partition name (which is fixed) instead of the device/partition number (which is variable):

/dev/gpt/bsd-swap none swap sw 0 0 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.