Hi,
I'm currently managing a rented server from a provider (OVH) that does not allow to natively install freeBSD. However, it is still possible and so I installed freebsd 14.1 from the official sources (the BASIC-CLOUDINIT-zfs version).
My server has 4 identical hard drives (ada0, ada1, ada2 and ada3). The system is installed on ada0 on the fresh install and the others disk are currently not used.
What I would like to di is to add the other 3 disks to the pool. I could just do a simple "zpool add zroot ada1 ada2 ada3" after after changing the default blocksize from 9 to 12 (sysctl vfs.zfs.min_auto_ashift=12). This work fine. Thing is, the only rescue I can use in case of problems (and I do a lot of stupid things sometimes) is a debian10 based rescue which doesn't support all features from the zroot pool. So what I'm trying to do is to migrate the pool from ada0 to ada1 (or 2 or 3, doesn't matter) by creating a pool supported by the rescue OS. Here is what I have been trying to do :
So the gpart show output is:
Then I create the pool with support for debian10 and copy the data :
Then I install bootloader on disk ada1
Then I configure the pool "master" as the boot root:
Finally I edit /etc/fstab so it looks like this:
But yet when I try to reboot, nothing happens. The server doesn't reboot. What have I been doing wrong ? I'm thinking that ada1 is not set to be boot on in bios, but if this is it, then I can't access bios...
I'm currently managing a rented server from a provider (OVH) that does not allow to natively install freeBSD. However, it is still possible and so I installed freebsd 14.1 from the official sources (the BASIC-CLOUDINIT-zfs version).
My server has 4 identical hard drives (ada0, ada1, ada2 and ada3). The system is installed on ada0 on the fresh install and the others disk are currently not used.
What I would like to di is to add the other 3 disks to the pool. I could just do a simple "zpool add zroot ada1 ada2 ada3" after after changing the default blocksize from 9 to 12 (sysctl vfs.zfs.min_auto_ashift=12). This work fine. Thing is, the only rescue I can use in case of problems (and I do a lot of stupid things sometimes) is a debian10 based rescue which doesn't support all features from the zroot pool. So what I'm trying to do is to migrate the pool from ada0 to ada1 (or 2 or 3, doesn't matter) by creating a pool supported by the rescue OS. Here is what I have been trying to do :
Code:
gpart create -s gpt ada1
gpart add -a 4k -s 500 -t freebsd-boot -l bootz ada1
gpart add -a 1M -s 40M -t efi -l efiz ada1
gpart add -a 1M -s 2G -t freebsd-swap -l swapz ada1
gpart add -a 1M -t freebsd-zfs -l zfsz ada1
So the gpart show output is:
Code:
=> 34 3907029094 ada0 GPT (1.8T)
34 345 1 freebsd-boot (173K)
379 66584 2 efi (33M)
66963 2097152 3 freebsd-swap (1.0G)
2164115 2048 4 freebsd (1.0M)
2166163 10485760 5 freebsd-zfs (5.0G)
12651923 3894377205 - free - (1.8T)
=> 40 3907029088 ada2 GPT (1.8T)
40 3907029088 - free - (1.8T)
=> 40 3907029088 ada3 GPT (1.8T)
40 3907029088 - free - (1.8T)
=> 40 3907029088 ada1 GPT (1.8T)
40 496 1 freebsd-boot (248K
536 1512 - free - (756K)
2048 81920 2 efi (40M)
83968 4194304 3 freebsd-swap (2.0G)
4278272 3902750720 4 freebsd-zfs (1.8T)
3907028992 136 - free - (68K)
Then I create the pool with support for debian10 and copy the data :
Code:
zpool create -o feature@vdev_zaps_v2=disabled -o feature@head_errlog=disabled -o feature@zilsaxattr=disabled master ada1p4
zfs snapshot -r zroot@migration
zfs send -R zroot@migration | zfs recv -F master
Then I install bootloader on disk ada1
Code:
newfs_msdos /dev/gpt/efiz
mount -t msdosfs /dev/gpt/efiz /mnt
mkdir -p /mnt/efi/boot
cp /boot/loader.efi /mnt/efi/boot/bootx64.efi
umount /mnt
Then I configure the pool "master" as the boot root:
Code:
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada1
zpool set bootfs=master/ROOT/default master
echo 'vfs.root.mountfrom="zfs:master/ROOT/default"' >> /boot/loader.conf
Finally I edit /etc/fstab so it looks like this:
Code:
# Custom /etc/fstab for FreeBSD VM images
# ZFS datasets
master/ROOT/default / zfs rw 0 0
master/home /home zfs rw 0 0
master/tmp /tmp zfs rw 0 0
master/usr /usr zfs rw 0 0
master/var /var zfs rw 0 0
# Swap and EFI partitions
/dev/gpt/swapz none swap sw 0 0
/dev/gpt/efiz /boot/efi msdosfs rw 2 2
# Older conf was :
#/dev/gpt/swapfs none swap sw 0 0
#/dev/gpt/efiesp /boot/efi msdosfs rw 2 2
But yet when I try to reboot, nothing happens. The server doesn't reboot. What have I been doing wrong ? I'm thinking that ada1 is not set to be boot on in bios, but if this is it, then I can't access bios...
Last edited by a moderator: