ZFS How to install a ZFS based system using an existing system

If you mean it's a laptop with BIOS firmware, then you don't need a "efi" partition. You know which firmware is in use by executing sysctl machdep.bootmethod. If it returns BIOS, then you don't need a "efi" partition. If you see UEFI, then you need one.


That partition script is good for a empty disk or where you don't have use for the old one.

On a disk where there already are a number of partitions and you want to keep them, then you don't need a partition script. Just choose the partition you want to install the new ZFS system on to, set the partition name in the zpool script.


Best is you show us the disk partitions where you want the new system installed: gpart show -p <target_disk_name>

Point those partitions out you want to keep and which are expendable, or respectively, you want the new system installed.
I have seven partitions followed by 265GB of free space. I want to allocate 200GB for this ZFS partition, but I will also need a swap partition, although I don't know if I need a freebsd-boot partition. My other FreeBSD partitions don't need one, I just boot them up with a grub menu entry which simply specifies setting root and then kfreebsd /boot/loader . I don't know if I can do something similar with a ZFS partition.
 
Use installer media,
You could try first without freebsd-boot partition and check if grub finds it.
Boot from installer media.
drop into console
mount -u -o rw /
kbdmap mykeyboard
gpart create -t freebsd-swap -a 4K -l "MYSWAP" adaX
gpart create -t freebsd-zfs -a 4K -l "MYFREEBSD" adaX
zpool create MYZPOOL /dev/gpt/MYFREEBSD
normally its now mounted on /MYFREEBSD
pkg install wget curl (they are small so installer media accepts it)
Download kernel.txz, base.txz from freebsd ftp site..
Copy to /MYFREEBSD
Untar ,
tar xvfz *.txz
Check /MYFREEBDS/etc/fstab
Set bootfs option of MYZPOOL.
Now zpool MYZPOOL should be mountable.
Create grub config pointing to this MYZPOOL (see previous posts)
reboot
I failure post output

If success add to fstab your swap filesystem.
If success log all steps and write them to a shell script to memorise or do this "automatic".

If success you can create "sub datasets" and move your data , like "/home" , or set tunables
 
Sorry, Which exact command did you run ?
Note : geom can do protection , then you just do "sysctl kern.geom.debugflags=16".
But there will be a reason why geom does protection , eg "full disk" already mounted.
 
For fun i just did,
Code:
gpart show -l ada0
=>        34  1953525101  ada0  GPT  (932G)
          34  1287651334        - free -  (614G)
  1287651368   228718552     6  MyArtix  (109G)
  1516369920   214861824     5  mx  (102G)
  1731231744   222293391        - free -  (106G)

gpart add -t freebsd-zfs -a 4K -l "MYZFS" -s 2GB ada0
ada0p1 added
 
Back
Top