HOWTO: Modern FreeBSD Install (vermaden way)

vermaden said:
... and you do not know what to do next?

Why I have this strange constant feeling that you do not know anything about UNIX ...

Show output of that command: # du -m -x -d 1 /boot | sort -n

Code:
/ # du -m -x -d 1 /boot | sort -n
1	/boot/defaults
1	/boot/firmware
1	/boot/modules
1	/boot/zfs
38	/boot/kernel
207	/boot/kernel.old
245	/boot
/
 
If your current kernel is functioning properly, just delete /boot/kernel.old. The moment you build a new kernel, /boot/kernel will be saved to /boot/kernel.old, and the current /boot/kernel.old will be deleted anyway.
 
vermaden said:
Thanks mate ;)

One of the reasons to create own KERNCONF can be power saving (on laptops mostly). Move all hardware you would like to disable temporary to save power (with [cmd=]hw.pci.do_power_nodriver=3[/Cmd] in /boot/loader.conf). This way devices without attached driver would not consume power.



Code:
bsd# [color="Blue"]du -m -x -d 1 / | sort -n[/color]
0       /proc
1       /.snap
1       /dev
1       /libexec
1       /mnt
1       /root
1       /tmp
1       /usr
1       /var
2       /bin
2       /etc
5       /rescue
6       /sbin
7       /lib
44      /boot
64      /

bsd# [color="Blue"]du -sh /boot[/color]
 44M    /boot

bsd# [color="Blue"]df -h /[/color]
Filesystem           Size    Used   Avail Capacity  Mounted on
/dev/label/rootfs    496M     63M    393M    14%    /

The / filesystem does not only contain kernel ...

Check [Cmd=]du -m -x -d 1 / | sort -n[/Cmd] command on your box.

Sure, but I'm refering to servers in my saying. Regarding power consumption, there is a nice tutorial in the FreeBSD wiki: http://wiki.freebsd.org/TuningPowerConsumption
 
Vermaden - Thanks for the great guide. I'm a new BSD user, been using Gentoo/Funtoo/Linux for years but decided to give FreeBSD a shot on a new system that I'm putting together to be my file server.

Couple things I had to add...

geom_mbr.ko to loader.conf:

Code:
cat /boot/loader.conf
zfs_load="YES"
ahci_load="YES"
geom_mirror_load="YES"
geom_mbr_load="YES"

And my /boot is also above 240MB it appears...

Code:
[root@fs ~]# du -m -x -d 1 / |sort -n
1       /.snap
1       /dev
1       /libexec
1       /media
1       /mnt
1       /proc
1       /root
1       /scratch
1       /tmp
1       /usr
1       /var
2       /bin
2       /etc
5       /rescue
5       /sbin
8       /lib
242     /boot
262     /
[root@fs ~]# du -m -x -d 1 /boot |sort -n
1       /boot/defaults
1       /boot/firmware
1       /boot/modules
1       /boot/zfs
241     /boot/kernel
242     /boot

I haven't rebuilt world / kernel yet though... Should that shrink it? Just did this install a few days ago.

I'll probably re-work the build to use two CF cards for the basefs and then put all the other file systems on my 4 disk raidz that'll be used for storage... Then I can get rid of the two boot drives that I currently have mirrored.

Is there any reason to use a particularly fast flash drive for the root file system? If I'm understanding things correctly, rarely will anything be written to / unless you're updating the system and therefore reads are more important. If most of your reading is being done from the HDD backed zpool, then is there any advantage to spending $30 more on a 300x/400x CF over say a $15 4G Kingston (http://www.newegg.com/Product/Product.aspx?Item=N82E16820134575)? Going to throw them into these Syba SATA -> CF adapters (http://www.newegg.com/Product/Product.aspx?Item=N82E16812186061) and call it a day.

This is unrelated and I may end up opening another thread for it, so feel free to push me to open a new thread to keep this on topic. I can't seem to get AHCI to work on my rig (Gigabyte GA-K8U-735 Mobo / Sempron 1800+ proc / Supermicro AOC-SAT2-MV8 HBA) and I believe that's why the kernel will panic if I pull out one of the two system drives. I've actually had my ZFS pool corrupt itself as a result and upon reboot immediately panic the system when it attempts to mount the ZFS drive. Additionally, I can't seem to add a new eSATA disk once the system has booted to one of the open AOC-SAT2-MV8 ports via an internal SATA -> eSATA cable converter. Am I correct in assuming that AHCI is controlled at the controller level? So the built in Northbridge on the motherboard would need AHCI support for that to work? Likewise, the AOC-SAT2-MV8 would need to support AHCI?

Thanks again for your great guide!
 
carpenike said:
Vermaden - Thanks for the great guide. I'm a new BSD user, been using Gentoo/Funtoo/Linux for years but decided to give FreeBSD a shot on a new system that I'm putting together to be my file server.

Thanks mate, I have came the same road as You, from Gentoo to FreeBSD not so long time ago ;)

carpenike said:
geom_mbr.ko to loader.conf:

Code:
cat /boot/loader.conf
zfs_load="YES"
ahci_load="YES"
geom_mirror_load="YES"
geom_mbr_load="YES"
... for logical/extended partitions?

carpenike said:
And my /boot is also above 240MB it appears...

Code:
[root@fs ~]# du -m -x -d 1 /boot |sort -n
241     /boot/kernel
242     /boot

Its because of the DEBUG *.symbols that are placed into /boot/kernel by default, You can safely remove them, so You will end with something like that (mine /boot/kernel):

Code:
% du -sm -x /boot 
45      /boot
% du -sm -x /boot/kernel
44      /boot/kernel

carpenike said:
I haven't rebuilt world / kernel yet though... Should that shrink it? Just did this install a few days ago.
No, just remove the DEBUG symbols /boot/kernel/*.symbols.

carpenike said:
I'll probably re-work the build to use two CF cards for the basefs and then put all the other file systems on my 4 disk raidz that'll be used for storage... Then I can get rid of the two boot drives that I currently have mirrored.
Yes its also a very good idea, mostly that most of the time You will use / as read only (I even have it mounted read-only all the time).

carpenike said:
Is there any reason to use a particularly fast flash drive for the root file system? If I'm understanding things correctly, rarely will anything be written to / unless you're updating the system and therefore reads are more important. If most of your reading is being done from the HDD backed zpool, then is there any advantage to spending $30 more on a 300x/400x CF over say a $15 4G Kingston (http://www.newegg.com/Product/Product.aspx?Item=N82E16820134575)? Going to throw them into these Syba SATA -> CF adapters (http://www.newegg.com/Product/Product.aspx?Item=N82E16812186061) and call it a day.
The root filesystem will be used only to boot up mostly, and flash drives even that they can have slow sequential speeds, they often have very small access times which will make booting faster, generally You can put mirrored / on flash drives/CF cards without any problem, that would work very good for that ZFS setup. Some even prefere to put whole FreeBSD base system on Flash/CF (along with /usr) like phoenix from these forums and its also works very good, You can strip all ZFS pool disks right away and You still have fully capable system, I do not mind changing disks that often, so I can end up with more 'hybrid' setup.

carpenike said:
This is unrelated and I may end up opening another thread for it, so feel free to push me to open a new thread to keep this on topic. I can't seem to get AHCI to work on my rig (Gigabyte GA-K8U-735 Mobo / Sempron 1800+ proc / Supermicro AOC-SAT2-MV8 HBA) and I believe that's why the kernel will panic if I pull out one of the two system drives. I've actually had my ZFS pool corrupt itself as a result and upon reboot immediately panic the system when it attempts to mount the ZFS drive. Additionally, I can't seem to add a new eSATA disk once the system has booted to one of the open AOC-SAT2-MV8 ports via an internal SATA -> eSATA cable converter. Am I correct in assuming that AHCI is controlled at the controller level? So the built in Northbridge on the motherboard would need AHCI support for that to work? Likewise, the AOC-SAT2-MV8 would need to support AHCI?
The AHCI is experimental (not enabled by default) feature of FreeBSD 8.0-RELEASE, but it will be enabled by default in 8.1 (will be released in July), so as of 8.0, many aspects of AHCI does not work properly, better try 8-STABLE snapshot [1] with has all new AHCI bits added.

[1] ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201005/
 
Hi Vermaden,

I used the same partition steps that you listed in your guide, only I added an extra partition to one of my disks as it's larger than the other one. Used the extra space in a scratch zpool.

Thanks for the symbol tip; removing that reduced boot to a more reasonable level:

Code:
[root@fs /usr/src]# du -m -x -d 1 /boot |sort -n
1       /boot/defaults
1       /boot/firmware
1       /boot/modules
1       /boot/zfs
47      /boot/kernel
48      /boot

In regards to the CF card; will the speed differences in 133x vs 300x/400x be noticeable / worth the extra $ for a boot mirror?

I'm currently using 8-Stable which will change to 8.1-Prerelease once my buildworld finishes:

Code:
[root@fs /usr/src]# uname -a
FreeBSD fs.holthome.local 8.0-STABLE-201004 FreeBSD 8.0-STABLE-201004 #0: Mon Apr  5 15:59:06 UTC 2010     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

Additionally, none of my drives show up as /dev/ada*, only /dev/ad*, which I believe implies that AHCI is not being used. Dmesg |grep -i ahci finds nothing either...

Thanks again!
 
carpenike said:
In regards to the CF card; will the speed differences in 133x vs 300x/400x be noticeable / worth the extra $ for a boot mirror?

I would say get the 'jack of all trades', the card that is reasonably cheap and fast at the same time, I remember when I looked for such card, 133x/166x were rather rationally priced while anything faster was well over the reasonable price levels.

Also, You need about 512MB for / alone and about 4GB card for / and /usr (to have whole FreeBSD base system on CF RAID1 setup), so limiting yourself to 4GB or less will definitely lower the price.

But in the end, You will mostly benefit from CF speed only at boot, and 133x is more then enough for that, IMHO its just not worth the extra money.

carpenike said:
I'm currently using 8-Stable which will change to 8.1-Prerelease once my buildworld finishes:

Code:
[root@fs /usr/src]# uname -a
FreeBSD fs.holthome.local 8.0-STABLE-201004 FreeBSD 8.0-STABLE-201004 #0: Mon Apr  5 15:59:06 UTC 2010     root@mason.cse.buffalo.edu:/usr
/obj/usr/src/sys/GENERIC  amd64

Additionally, none of my drives show up as /dev/ada*, only /dev/ad*, which I believe implies that AHCI is not being used. Dmesg |grep -i ahci finds nothing either...

Thanks again!

You have ahci_load="YES" on /boot/loader.conf to enable AHCI module loading enabled at boot? It the answer is yes here, and You still do not have AHCI mode enabled (and that seems to be the case) then submit a bug [1] and start a discussion on FreeBSD mailing lists [2] and cooperate with developers to fix it, they will send you some patches to test if it may work, if it will these changes will be added to the FreeBSD source and You will propably see them later in 8.1-RELEASE. Remember to also add BUG link to the started discussion.

[1] http://freebsd.org/send-pr.html
[2] http://lists.freebsd.org
 
OK. I've got the kernel module loaded:

Code:
[root@fs /usr/src]# kldstat
Id Refs Address            Size     Name
 1   21 0xffffffff80100000 d55d60   kernel
 2    1 0xffffffff80e56000 190260   zfs.ko
 3    2 0xffffffff80fe7000 3860     opensolaris.ko
 4    1 0xffffffff80feb000 21100    geom_mirror.ko
 5    1 0xffffffff8100d000 f590     ahci.ko
 6    1 0xffffffff8101d000 3868     geom_mbr.ko
 7    1 0xffffffff81222000 a49      snp.ko

Should I see any indication of AHCI being loaded in dmesg even if the card is not supported by AHCI?

Thanks,
Ryan
 
@carpenike

I have as much as that:
Code:
% kldstat | grep ahci
 9    1 0xffffffff81083000 b0c0     ahci.ko

% dmesg | grep ahci  
ahci0: <AHCI controller> port 0xd880-0xd887,0xd800-0xd803,0xd480-0xd487,0xd400-0xd403,0xd080-0xd09f mem 0xfeb79800-0xfeb79fff irq 19 at device 31.2 on pci0
ahci0: [ITHREAD]
ahci0: AHCI v1.20 with 6 3Gbps ports, Port Multiplier not supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich0: [ITHREAD]
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich1: [ITHREAD]
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich2: [ITHREAD]
ahcich3: <AHCI channel> at channel 3 on ahci0
ahcich3: [ITHREAD]
ahcich4: <AHCI channel> at channel 4 on ahci0
ahcich4: [ITHREAD]
ahcich5: <AHCI channel> at channel 5 on ahci0
ahcich5: [ITHREAD]
ada0 at ahcich0 bus 0 target 0 lun 0
ada1 at ahcich1 bus 0 target 0 lun 0
ada2 at ahcich2 bus 0 target 0 lun 0
cd0 at ahcich4 bus 0 target 0 lun 0
 
Vermaden,

Yeah I don't get any of that, looks like it's not picking up any compatible AHCI controllers, as I don't even get that initial line that you have which describes the controller itself prior to any channels / disks.

Code:
[root@fs ~]# dmesg |grep ahci
[root@fs ~]#
 
carpenike said:
Vermaden,

Yeah I don't get any of that, looks like it's not picking up any compatible AHCI controllers, as I don't even get that initial line that you have which describes the controller itself prior to any channels / disks.

Code:
[root@fs ~]# dmesg |grep ahci
[root@fs ~]#

You should definitely start http://lists.freebsd.org discussion about that controller, especially while there are Linux drivers available (hope the source is also available), also provide pciconf -lb and pciconf -lv output to them in the discussion.
 
@carpenike

Good, I see that we can describe your case as 'solved' since that 8-port card is not AHCI capable and You have mvs(8) at the same time? :)
 
killasmurf86 said:
Code:
Invalid vdev specification
[red]use '-f' to override the following error[/red]
/dev/ad4s2 is part of potentially active pool 'basefs'

-f

I encountered this error as well, so for future reference to others and myself :)

Code:
# zpool create [b]-f[/b] basefs ad4s2

I also was wondering if the spacing matters for writing config files or what's the pattern?

One space, tab etc ?
 
Back
Top