Gentoo Archives: gentoo-bsd

From: Joe Peterson <joe@×××××××.com>
To: gentoo-bsd@l.g.o
Subject: [gentoo-bsd] How to use a separate "/boot" partition with Gentoo FreeBSD
Date: Sun, 29 Apr 2007 15:28:38
Message-Id: 4634B977.3050104@skyrush.com
1 If anyone is interested, I was successfully able to install Gentoo
2 FreeBSD using a separate /boot partition. I don't know if some of you
3 have done this, but below are notes from my experience. Googling for
4 this came up with relatively little (some info I found did help, but it
5 seems there are not many who have bothered with this).
6
7 The Gentoo page on installing FreeBSD suggests using one giant partition
8 and turning off soft-updates. I wanted to avoid this (since many system
9 files are read/written during use of the OS, I want them to be as fast
10 as possible). One way would be to make separate /usr, /var, etc.
11 partitions as suggested in the FreeBSD handbook (leaving only "/", and
12 therefore "/boot", as non-soft-updates, since they would not see much
13 write activity), but some hard links in the gfbsd stage3 tarball made
14 this problematic (links between the bin dirs outside /usr to within
15 their /usr counterparts). I could have broken these links, but I wanted
16 to leave the system as the gfbsd folks designed it.
17
18 So I figured I'd try what I usually have done on Linux: make a small
19 (256M) "/boot" on /dev/ad0s1a, a large (~40G) "/" on /dev/ad0s1d, and
20 leave the rest for "/home" on /dev/ad0s1h. At least this lets me keep
21 my data and home dir files if I need to do a clean re-install. Soft
22 updates would be off on /boot but on on the other two. Also, not sure
23 it matters, but in /etc/fstab, I put the line for "/" (ad0s1d) first.
24
25 I came upon two issues:
26
27 1) The boot loader expects the kernel to be in "/boot/..."
28 2) The system has trouble finding "/" (the root) on booting
29
30 #1 is easy: If you do the usual thing and mount the boot partition on
31 /boot, there will be no "/boot/" prefix, so move its contents into a
32 subdirectory called "boot" within the boot partition. Now mount this
33 boot partition on "/mnt/boot" and make a symlink called "/boot" ->
34 "/mnt/boot/boot". The files will then be seen in their usual place when
35 the system boots, and the boot partition will look correct when first
36 booting too.
37
38 #2: When you first boot your system, you'll be asked to manually specify
39 where "root" is (in my case, "ufs:ad0s1d" did the trick). But I did not
40 want to have to type this every time I booted! I tried using grub,
41 thinking it might enable me to specify root like Linux does, but the
42 config was just wanting the boot partition, and there seemed no obvious
43 way to set what root would be after boot (BTW, I did get disk error 29
44 before heeding Gentoo's sysctl hint for grub). I ended up finding some
45 info that suggested creating a "/boot/loader.conf" file and adding this
46 line:
47
48 vfs.root.mountfrom="ufs:ad0s1d"
49
50 This worked. Now my system boots normally, and I have what seems a sane
51 partitioning scheme!
52
53 -Joe
54 --
55 gentoo-bsd@g.o mailing list