From owner-freebsd-questions@FreeBSD.ORG Mon Apr 15 09:28:39 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A705C2BA for ; Mon, 15 Apr 2013 09:28:39 +0000 (UTC) (envelope-from demelier.david@gmail.com) Received: from mail-we0-x236.google.com (mail-we0-x236.google.com [IPv6:2a00:1450:400c:c03::236]) by mx1.freebsd.org (Postfix) with ESMTP id 40635EF9 for ; Mon, 15 Apr 2013 09:28:39 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id m1so1414896wea.27 for ; Mon, 15 Apr 2013 02:28:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=EtKOEtDh0qYKh0cDjdw0J0fxm0pT0RkiTHztDE/gtQY=; b=a64/YGXmKSKN17qTJ99syClvWJuWqo8dl6zZ2ItQpRbUhGzGXyA6uIA8I6tBjSDuY7 IZUBgMcvmyQpyoadp3YzTk/ckr468JGX59s0CfggXI/iQkcrpfNj15c/J6zRprfZ4bjm zKUroeZaWnU0UKRH+CBBJdxk21VwfNtpZ8lXJX643xuyT02/Gk72x72TA4RYtBD9FpoU 7jAhnImrEY69c84C3TmZxEpDF8HPm9MKqNkmbI2sGd0QAe1QdxSH00pyBLiAI1RYvLIl WezSk68ipzpcNYVBW92YV6h/drmisE1Y6lN01kpyC2+WhFqRyJbuEKP18O4Uy3Scsawo puwQ== MIME-Version: 1.0 X-Received: by 10.180.91.106 with SMTP id cd10mr10577254wib.6.1366018118454; Mon, 15 Apr 2013 02:28:38 -0700 (PDT) Received: by 10.194.76.147 with HTTP; Mon, 15 Apr 2013 02:28:38 -0700 (PDT) In-Reply-To: References: Date: Mon, 15 Apr 2013 11:28:38 +0200 Message-ID: Subject: Re: ZFS mounting failed with error 2 From: David Demelier To: =?UTF-8?Q?Trond_Endrest=C3=B8l?= Content-Type: text/plain; charset=UTF-8 Cc: FreeBSD questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 09:28:39 -0000 I've successfully made booting one virtual machine, I tried again and it failed again. There's one thing I'm not sure about is that some people create a dataset root but that actually mounts at / (and not /root) and some just create others mount points directly on the zpool I've tested the second one so I did the following : zpool create -o altroot=/mnt tank /dev/gpt/disk0 zfs create tank/usr ... And then I've done all the other and I'm still unable to boot, this is the exact list (and order) I've used : gpart create -s GPT ada0 gpart add -t freebsd-boot -s 64k -l boot0 ada0 gpart add -t freebsd-swap -s 4G -l swap0 ada0 gpart add -t freebsd-zfs -l disk0 ada0 gpart bootcode -b /boot/pmbr ada0 gpart bootcode -p /boot/gptzfsboot -i 1 ada0 zpool create -o altroot=/mnt tank /dev/gpt/zfs0 zpool set bootfs=tank tank zfs set checksum=fletcher4 tank zfs create -o setuid=off tank/home zfs create -o setuid=off tank/tmp # /usr zfs create tank/usr zfs create tank/usr/local zfs create -o setuid=off -o compression=lzjb tank/usr/src zfs create -o setuid=off -o compression=lzjb tank/usr/ports # /var zfs create tank/var zfs create -o setuid=off -o compression=lzjb -o exec=off tank/var/crash zfs create -o setuid=off -o compression=lzjb -o exec=off tank/var/log zfs create -o setuid=off -o exec=off tank/var/run zfs create -o setuid=off tank/var/tmp chmod 1777 /mnt/tmp /mnt/var/tmp ### TYPE EXIT TO INSTALL THE SETS ### THEN CHOOSE LIVECD echo "/dev/label/swap0 none swap sw 0 0" >> /mnt/etc/fstab echo "zfs_enable=YES" >> /mnt/etc/rc.conf echo "zfs_load=YES" >> /mnt/boot/loader.conf echo "vfs.root.mountfrom=zfs:tank" >> /mnt/boot/loader.conf # zpool.cache (unable to boot without) zpool export tank zpool import -o cachefile=/tmp/zpool.cache -o altroot=/mnt tank cp /tmp/zpool.cache /mnt/boot/zfs zpool export tank # Finished shutdown -r now Regards, -- Demelier David