HOWTO: Modern FreeBSD Install RELOADED (vermaden way)

bbzz said:
edit: Is there a need for pool to have its own mountpoint i.e /pool?
No, I set it to none for most of the times:
Code:
# zfs set -o mountpoint=none pool
... or You can get rid of pool/data dataset and use /pool instead.
 
Thank you very much! It is a very good tutorial.

I faced a small problem. After reboot my zfs pool is "not available" (zfs filesystems not mounted).

I have
Code:
zfs_enable="YES"
in my /etc/rc.conf (no zfs filesystems entries in /etc/fstab). When I run zpool status after reboot, it says
Code:
no pools available
When I manually import pool, everything appears to be OK. But it is not again mounted automatically after reboot.

Any ideas?

P.S. 8.2-RELEASE-p0.
 
@vand777

I had a similar problem when I first tried this method. How are your disks set up? I'm going to assume that you have something like a CF for / and /usr and everything else is on the zfs pool. If this is the case, then you need to mount any pools specifically in the the path of UFS devices you set up. For example, in my setup I have /var/db/pkg as UFS, however my /var directory is on a zpool. So, in my /etc/fstab I have to specifically mount pool/var to /var before the /var/db/pkg mount can be made.

Code:
#dev		  #mount	#fs	#opts	#dump	#pass
/dev/ufs/root	  /		ufs	rw	1	1
/dev/ufs/usr	  /usr  	ufs	rw	2	2
pool/var	  /var		zfs	rw	0       0
/dev/ufs/pkg	  /var/db/pkg	ufs	rw	2	2

When I hadn't declared the mount, the system would boot, but hang when trying to mount the filesystems and kick me to the rescue shell, at which point I could import the pool and boot normally. After this tip from Vermaden, all has worked flawlessly since.
 
Thank you for your advice! I'll check it in the evening as I was playing with one of my home laptops.

I saw your posts about it in this topic and I've tried it. Currently, the line with /var/db/pkg is commented out in /etc/fstab. So in theory it should not conflict with zfs file systems.

I tried to specifically define mount points for zfs file systems in /etc/fstab but I faced some kind of error. At that moment didn't have much time to solve it but I'll try your advice tonight once I am at home.
 
As I expected, it didn't work. It didn't boot. The error was as follows:
Code:
Mounting local file systems:mount:zdata/home : No such file or directory

It failed on the first zfs file system line in /etc/fstab:
Code:
...
zdata/home   /home   zfs   rw    0 0
...

If I comment all zfs file systems in /etc/fstab, then it boots.
Code:
#zpool status
no pools available

I can then import zdata pool:

Code:
#zpool import zdata
#zpool status
pool: zdata
state: ONLINE
scrub: none requested
config:

    Name             State            Read   Write    Cksum
    zdata            ONLINE           0      0        0
       ada0s2        ONLINE           0      0        0

errors: No known data errors

Looking at the above report I just realized that the disk device name is completely wrong. On my laptop I have hardware RAID controller and I have setup RAID1 and would expect the device to have the name ar0 (so it should display ar0s2). It does look that it displays one of the disks and is conflicting with hardware RAID configuration... Will look into it closely...
 
I tried to add ada1s2 device to the pool but it said that the device was already there. If I look at /dev, there is no such device as ar0 anymore, only ada0* and ada1* left. The obvious solution here is to disable hardware RAID and setup it via FreeBSD (software RAID) but this will mean to reinstall everything from scratch.

Is there any other solution?
 
BTW, I found few worrying messages in /var/log/messages:

Code:
...
Oct 28 20:56:42 test kernel: GEOM ada0: the secondary GPT header is not in the last LBA.
Oct 28 20:56:42 test kernel: GEOM ada0s1: geometry does not match label (255h,63s != 16h,63s) 
...

I have same messages for ada1 and ada1s1. I have UFS file systems on this partition and have no problems mounting them.
 
vand777 said:
Decided to rebuild the system without using hardware RAID.

ZFS and hardware RAID are not playing well together, plain ZFS is just a lot better, configure RAID to 'expose disks' to ZFS and ZFS will take care of the rest ;)
 
vermaden said:
ZFS and hardware RAID are not playing well together, plain ZFS is just a lot better, configure RAID to 'expose disks' to ZFS and ZFS will take care of the rest ;)

Thank you for advice!
 
Without hardware RAID everything is working as expected. Unfortunately, FreeBSD 8.2 does not support WiFi device on my laptop (Lenovo Thinkpad W700) :( I'm planning to see whether FreeBSD 9.0 supports it or not. If not, I'll have to try Ubuntu on it :(

But for servers, FreeBSD forever :beer
 
vand777 said:
Unfortunately, FreeBSD 8.2 does not support WiFi device on my laptop (Lenovo Thinkpad W700) :( I'm planning to see whether FreeBSD 9.0 supports it or not.

I might become the happiest man in the world today. It does look that 9.0 supports WiFi device on my laptop :) Will try it properly in a few hours. Fingers crossed! :)
 
Code:
fixit# kldload /mnt2/boot/kernel/geom_mbr.ko
fixit# kldload /mnt2/boot/kernel/opensolaris.ko
fixit# kldload /mnt2/boot/kernel/zfs.ko

It's available shorten to:
[cmd="fixit#"]kldload geom_mbr[/cmd]
[cmd="fixit#"]kldload geom_mirror[/cmd]
[cmd="fixit#"]kldload opensolaris[/cmd]
[cmd="fixit#"]kldload zfs[/cmd]

Next, why don't use gpart and GPT-partition instead of (obsolete) MBR, bsdlabel and so on? What can be easier than that:

Partitioning and making bootable disk:
[cmd="fixit#"]gpart create -s GPT ad0[/cmd]
[cmd="fixit#"]gpart add -b 40 -s 128 -t freebsd-boot ad0[/cmd]
[cmd="fixit#"]gpart add -t freebsd-swap ad0[/cmd]
[cmd="fixit#"]gpart add -t freebsd-zfs -s 512M ad0[/cmd]
[cmd="fixit#"]gpart add -t freebsd-zfs ad0[/cmd]
[cmd="fixit#"]gpart bootcmd -b /boot/pmbr -p /boot/gptboot -i 1 ad0[/cmd]

For other disks can eliminate this steps by next simple command:
[cmd="fixit#"]gpart backup ad0 | gpart restore -F ad1 ad2[/cmd]

And next steps are yours gmirror creating and so on...
 
dewarrn1 said:
Hi Vermaden, great guide! Any chance of an update for 9.0? Much appreciated!

Thanks, I will look in to the differences in some free time ;)

RusDyr said:
It's available shorten to:
[cmd="fixit#"]kldload geom_mbr[/cmd]
[cmd="fixit#"]kldload geom_mirror[/cmd]
[cmd="fixit#"]kldload opensolaris[/cmd]
[cmd="fixit#"]kldload zfs[/cmd]
Its probably the difference between 8.x FIXIT and 9.x FIXIT, on 8.x it worked only that way.

Next, why don't use gpart and GPT-partition instead of (obsolete) MBR, bsdlabel and so on? What can be easier than that:
I used MBR partition because I also needed to boot Windows on that box, XP to e precise which does not support booting from GPT partitions.

Besides then that, I do not have any objections to GPT partitions.
 
RusDyr said:
gpart can also do MBR scheme, doesn't it?
[CMD="fixit#"]gpart create -s MBR ad0[/CMD]

At the time of writing the HOWTO I used the method that worked well for me, I didn't bother to check all other available alternatives.
 
@RusDyr

I want, dunno if I will use GPT partitions, but I currently do not have time to update the HOWTO.
 
Back
Top