Freebsd Zfs Boot Error 2
with error 2: unknown file system after upgrade to 10.1-RELEASE Next message: Mounting from zfs:zroot/ROOT/default failed with error 2: unknown file system after upgrade to 10.1-RELEASE Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] On Wed, 19 Nov 2014 17:10+0100, Anton Eliasson wrote: > freenas mounting from zfs failed with error 2 Den 2014-11-19 08:22, Trond Endrestøl skrev: > > On Tue, 18 Nov 2014 23:05+0100, Anton Eliasson mountroot freebsd wrote: > > > > > Hi! > > > After upgrading a server from FreeBSD 10.0-RELEASE to 10.1-RELEASE it no > > > longer starts up. The bootloader shows its usual menu and then proceeds to > > > load zfs.ko, opensolaris.ko and some third module. Then kernel boots and > > > continues all the way to mountroot where it fails with the message > > > "Mounting > > > from zfs:zroot/ROOT/default failed with error 2: unknown file system." The > > > entire message: > > > https://cloud.solid.lth.se/public.php?service=files&t=27c15a131ca63b19f619a7ee558fe8d1 > > > > > > Entering zfs:zroot, zfs:zroot/ROOT, zfs:zroot/ROOT/default or > > > zfs:anythingelse > > > results in the same error. > > > > > > FreeBSD 10.0 was installed this summer. I believe I used the installer's > > > guided procedure for installing on a mirrored ZFS root. Each drive has a > > > GPT > > > table with a 512k freebsd-boot, a freebsd-swap and a freebsd-zfs > > > partition. No > > > separate /boot. > > > > > > There is no vfs.root.mountfrom directive in /boot/loader.conf and no / in > > > /etc/fstab. If I set vfs.root.mountfrom="zfs:zroot" it fails with the same > > > message but a slightly different path (zfs:zroot). > > > > > > The motherboard is a Supermicro X9SRH-7TF. I can import and mount the root > > > filesystem with a FreeBSD live CD without problems. > > > > > > Some config files pulled from a very similar installation (same server > > > model, > > > installed at the same time). They should be more or less identical on the > > > server that won't boot: > > > > > > /etc/rc.conf: > > > > > > hostname="..." > > > keymap="swedish.iso.kbd" > > > # Use synchronous DHCP; pause boot until DHCP is completed. > > > ifconfig_ix0="SYNCDHCP" > > > sshd_enable="YES" > > > ntpd_enable="YES" > > > # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable > > > dumpdev="AUTO" > > > zfs_enable="YES" > > > > > > # IPFW > > > [...] > > > > > > /boot/loader.conf: > > > > > > zfs_load="YES" > > > geom_mirror_load
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: https://lists.freebsd.org/pipermail/freebsd-questions/2014-November/262384.html Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top FreeBSD 10 won't boot to ZFS root after power failure up vote 3 down vote favorite 1 While installing new hardware today, I involuntarily disconnected the power to one of our servers. This server is running FreeBSD 10 with Root-on-ZFS as offered by http://serverfault.com/questions/616991/freebsd-10-wont-boot-to-zfs-root-after-power-failure the installer. It has a total of 36 disks, distributed into two RAID-Z2 which belong to the same pool (called zroot). After switching the server back on, it will now no longer boot. Before the boot menu shows up the following messages are printed: Loading /boot/defaults/loader.conf ZFS: i/o error - all block copies unavailable Warning: error reading file /boot/loader.conf Despite these messages, the system continues to boot the kernel until it stops at a mountfrom> prompt and I can't get it to continue from there. If I enter zfs:zroot/ROOT/default, it just says unknown filesystem. I can however boot from a USB stick, import the zpool and I can read both /boot/defaults/loader.conf and /boot/loader.conf. In fact, it appears that the zpool is perfectly fine. I have then tried to reinstall the bootcode: gpart bootcode -b /tmp/zroot/boot/pmbr -p /boot/gptzfsboot -i 1 da0 I have tried to recreate the zpool cache file: zpool set cachefile=/tmp/zroot/boot/zfs/zpool.cache zroot I have tried to manually tell the bootloader to load the ZFS module. All of these attempts still resulted in the same behaviour and I am now completely
use. One of the current limitations when installing FreeBSD 9 is you can not install the OS to a ZFS root pool from inside the default installer. Using https://calomel.org/zfs_freebsd_root_install.html the guide from aisecure we were able to get the ZFS root install working by manually typing commands. What we really wanted was the script on the FreeBSD 9 install media. Our goal was to http://questions.mfreebsd.xyz/2014/Nov/19/b14f988b01bb24af82edf978a0713eb5bfd002ed30f67d03699ab085.html boot the install media, execute the script and have the script do the FULL FreeBSD install for us without user intervention. We are happy to say we have a solution. On this page we are error 2 going to take a look at the script itself and then explain the simplest method we found to install a FreeBSD memstick image to a USB key and run our install script from the key. At that point you can complete a full install of FreeBSD on a ZFS root in around 2 minutes. Speed is neat, but the real advantage is you can do an install, play with the image freebsd zfs boot for a while and re-install without worrying about wasting a lot of time reinstalling. Lets take a look at the script first. ZFS Root Install Script for FreeBSD 11.0 You can copy and paste the following script if you like or download the same script from calomel.org : zfs.sh. The script is called "zfs.sh", but you can use any name you wish. Make sure to set the file to be executable or use "sh zfs.sh" to execute. We commented every section so take a look at the script before using it and make any changes you feel necessary for your environment. After this section we explain how to do the memstick install and how to use the fully operational memestick. But first, what does the script do? The script will remove any partitions from the drive. This is necessary if you use the same install script on the same drive and are just testing installs. We want to make sure we have a clean partition every time. Then we make a new partition table and align the disk for 4K (4096 byte) sectors. The ZFS pool is created and options are set which we prefer like setting the checksum to fletcher4 and turning the access time bit off. You will
thekernel:set debug.debuggeronpanic=3D"1"Judging from the screenshots you've provided and from what you wrotein your reply, it seems vfs.root.mountfrom is overridden somehow./boot/loader.conf would be a natural candidate.If the bootfs property is indeed set to zroot/ROOT/default, then it'svery strange that the kernel would proclaim:Trying to mount root from zfs:zroot []...instead of:Trying to mount root from zfs:zroot/ROOT/default []...And it's even stranger that nothing appears on lszfs' radar when askedto list zroot/ROOT/default.Selecting the old kernel in the boot menu and trying to boot normally fa=ilsbecause init is not found:https://cloud.solid.lth.se/public.php?service=3Dfiles&t=3D81fd35bb6348ae=7426553c2f59fb2a18Could this be a mismatch in kernel and kernel module versions? How would= I fixthat?If you can boot from a recent snapshot image or live image, and importthe zpool read-only, you could walk around and see ifzroot/ROOT/default/boot/loader.conf contains anything strange.This zpool command would allow you to go spelunking inside /zroot:zpool import -o readonly=3Don -f -R /zroot zrootYou might need to mount readonly any dataset you wish to examine.If you see the need for changing any of the files, you must export thezpool and re-import it readwrite, i.e. leave out the -o readonly=3Donoption.I admit I'm in unknown territory, even if I have managed multiple ZFSsystems over the past years, so be careful.Hi!I had forgot to remove the vfs.root.mountfrom that I experimented with. =This probably caused the failure to load init.I got it to work by chrooting into the system from a live cd and rolling =back the upgrade with freebsd-update rollback. Then it booted fine. =Now freebsd-version shows 10.0-RELEASE-p12 and uname -r shows =10.1-RELEASE. It looks a bit strange, but at least it works for now.I may have mixed up the commands used to upgrade the system. Is the =following the correct procedure for doing a major upgrade (with a stock =kernel)?freebsd-update -