Internal Error Failed To Initialize Zfs Library Freebsd
[ thread ] [ subject ] [ author ] Hi, I just tried to install FreeBSD 9.0RC3 with a ZFS-only file system. I succeeded by doing a manual install. The bsdinstaller failed: it would write not write the new filesystem to /mnt as expected (I presume it has overwritten the memstick filesystem at /). I'm relative new to FreeBSD, so I'm trying to understand what I did wrong, or if this is quirk in the bsdinstaller (unlikely). This is how it failed: - ----- start log #1 -------- When bsdinstall asks how to partition the disk, drop to the shell. Use this shell to set up partitions for the new system. When finished, mount the system at /mnt and place an fstab file for the new system at /tmp/bsdinstall_etc/fstab. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'. # gpart add -t freebsd-zfs -l ssd0 ada0 # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0 # gpart show ada0 => 34 30932925 ada0 GPT (14G) 34 128 1 freebsd-boot (64k) 162 30932797 2 freebsd-zfs (14G) # zpool list ZFS NOTICE: Prefetch is disabled by default on i386 -- to enable, add "vfs.zfs.prefetch_disable=0" to /boot/loader.conf. ZFS WARNING: Recommended minimum kmem_size is 512MB; expect unstable behavior. Consider tuning vm.kmem_size and vm.kmem_size_max in /boot/loader.conf. ZFS filesystem version 5 ZFS storage pool version 28 no pools available # zpool import no pools available to import # zpool create -m /mnt zroot /dev/gpt/ssd0 # zpool set bootfs=zroot zroot # zfs set checksum=fletcher4 zroot # zfs create zroot/var # zfs create zroot/var/log # zfs set compression=lzjb zroot/var/log # zfs create zroot/tmp # chmod 1777 /mnt/tmp # zfs create -V 2G zroot/swap # zfs set org.freebsd:swap=on zroot/swap # zfs set checksum=off zroot/swap (Not creating /tmp/bsdinstall_etc/fstab since ZFS takes care of the mounting). # touch /tmp/bsdinstall_etc/fstab # exit (Proceed with bsdinstall as usual. After running it is finished, I drop back to the shell:) # zfs list internal error: failed to in
article is no longer updated, and may be outdated. A large part of this tutorial is based on the excellent tutorials by George Kontostanos. Contents 1 Preparation 2 Create the ZFS partition 3 Create the ZFS file system 4 ZFS configuration 5 Installation of FreeBSD 6 Configuration of Boot Parameters 7 ZFS settings 8 Troubleshooting Preparation First of all, create a USB memory stick with the FreeBSD installer, as explained in the FreeBSD handbook in the section on Prepare the Installation Media. Run the FreeBSD installer and select "install" to start and installation procedure. After setting the keyboard settings, hostname https://lists.freebsd.org/pipermail/freebsd-current/2012-January/031081.html and selecting the components to install, you will reach the partitioning stage. Create the ZFS partition At the partitioning stage, select "shell". (Thus not "Guided" or "Manual".) You first get a helpful message: Use this shell to set up partitions for the new system. When finished, mount the system at /mnt and place an fstab file for the new system at /tmp/bsdinstall_etc/fstab. Then type 'exit'. You can also enter http://www.macfreek.nl/memory/FreeBSD_9_with_ZFS_bootdisk the partition editor at any time by entering 'bsdinstall partedit'. First, determine the names of your disks: # camcontrol devlist at scbus0 target 0 lun 0 (ada0,pass0) at scbus3 target 0 lun 0 (ada1,pass1) at scbus7 target 0 lun 0 (da0,pass2) For more info, you can search dmesg: # grep 'ada0' /var/run/dmesg.boot # egrep '[ac]?da[0-9]' /var/run/dmesg.boot In this case, the USB key with the installer was located at /dev/da0, and the SSD which would contain the new system at /dev/ada0. The 3 TByte HDD at /dev/ada1 is not of importance yet (it will be configured later). Once determined, use gpart to list the existing partitions (this list was engineered to show a few examples): # gpart show => 0 7821312 da0 BSD (3.7G) 0 1095504 1 freebsd-ufs (534M) 1095504 6725808 - free - (3.2G) => 34 30932925 ada0 GPT (14G) 34 6 - free - (3.0K) 40 984 1 freebsd-boot (492k) 1024 30932797 2 freebsd-zfs (14G) => 34 30932925 ada1 GPT (14G) 34 500 1 freebsd-boot (250k) 534 10485760 2 freebsd-ufs (5.0G) 10485922 16777216 3 freebsd-ufs (8.0G) 27263138 3667968 4 freebsd-swap (1.8G) 30931106 1853 - free - (926k) If a disk has no known recognised partitio
zfs.ko [norman@harmonia ~]$ zfs list internal error: failed to initialize ZFS library Anyway thx for the info.. At least now I know why it "should" not work ;-) bye Norman http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2008-05/msg01513.html 2008/5/29 Pawel Jakub Dawidek : On Fri, Apr 11, 2008 at 01:41:28PM -0500, Mark Kane wrote: On Fri, Apr 11, 2008, at 15:13:16 +0200, Norman Maurer wrote: Hi all, is it normal that I can't do a 'zfs list' ( for example ) as non-root user ? $ zfs list internal error: failed to initialize ZFS library I think there is really a use case for use some zfs internal error commands as non-root user.. Thx Norman Hi. One way to do this as a non-root user is to add the account to the "operator" group. This is what I do on my personal desktop machine and it has worked fine, but I understand that may not be best in all cases. You might also try changing the permissions on /dev/zfs. I don't do this method and I'm not sure internal error failed if it's a proper way, but from trying it very briefly it seems to work correctly with the user not in the "operator" group. In Solaris anyone can open /dev/zfs and the kernel side of ZFS decides if the user has permission to perform some action or not. In FreeBSD we try to be more careful for now, but it will change soon, once we import delegated administration functionality. Although... The error above (failed to initialize ZFS library) most likely means that zfs.ko module wasn't loaded. zfs(8) tries to do that automatically, but of course it will only succeed if we are root. In this case zfs.ko has to be manually loaded by root and then members of operator group can use zfs(8) command. -- Pawel Jakub Dawidek http://www.wheel.pl pjd@xxxxxxxxxxx http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! _______________________________________________ freebsd-questions@xxxxxxxxxxx mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx" References: Re: zfs list and non-root user From: Pawel Jakub Dawidek Prev by Date: Re: Delaying mount of UFS filesystem in ZFS pool Next by Date: Re: External USB disk won't mount Previous by thread: Re: zfs list and non-root user Index(es): Date Thread Flag as inappropriate (AWS) Security UNIX Linux Coding Usenet Mailing-ListsNewsgroupsAbout