Re: ZFS booting without partitions
Henri Hennebert wrote: Kip Macy wrote: On Mon, Jun 1, 2009 at 10:21 AM, Adam McDougall wrote: I'm thinking that too. I spent some time taking stabs at figuring it out yesterday but didn't get anywhere useful. I did try compiling the -current src/sys/boot tree on 7.2 after a couple header tweaks to make it compile but the loader still didn't work. The working loader is the same file size as the broken loader unless it was compiled on i386 and then it is ~30k bigger for some reason (it shrinks to the same size as the rest if I force it to use the same 32bit compilation flags as used on amd64). Just mentioning this in case it saves someone else some time. I'm real pleased it works at all. If someone has the time to track down the differences I'll MFC them. I'm not using ZFS boot at the moment so I have no way of testing. At last I get this F.G diff!!! The problem was in libstand.a. By the way , the patch also take into account the update of Doug Rabson to answer my problem with too many devices / pools. Happy to help on this one. I can confirm that this fixes my loader when I patch, compile, install libstand then compile and install the loader. Thanks for finding it! ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: ZFS booting without partitions
Kip Macy wrote: On Mon, Jun 1, 2009 at 10:21 AM, Adam McDougall wrote: I'm thinking that too. I spent some time taking stabs at figuring it out yesterday but didn't get anywhere useful. I did try compiling the -current src/sys/boot tree on 7.2 after a couple header tweaks to make it compile but the loader still didn't work. The working loader is the same file size as the broken loader unless it was compiled on i386 and then it is ~30k bigger for some reason (it shrinks to the same size as the rest if I force it to use the same 32bit compilation flags as used on amd64). Just mentioning this in case it saves someone else some time. I'm real pleased it works at all. If someone has the time to track down the differences I'll MFC them. I'm not using ZFS boot at the moment so I have no way of testing. At last I get this F.G diff!!! The problem was in libstand.a. By the way , the patch also take into account the update of Doug Rabson to answer my problem with too many devices / pools. Happy to help on this one. Cheers, Kip --- lib/libstand/stand.h.orig 2007-01-09 02:02:04.0 +0100 +++ lib/libstand/stand.h2009-06-03 17:24:42.627552341 +0200 @@ -167,7 +167,7 @@ #define SOPEN_RASIZE 512 }; -#defineSOPEN_MAX 8 +#defineSOPEN_MAX 64 extern struct open_file files[]; /* f_flags values */ --- lib/libstand/nfs.c.orig 2004-01-21 21:12:23.0 +0100 +++ lib/libstand/nfs.c 2009-06-05 20:36:26.001368421 +0200 @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libstand/nfs.c,v 1.12 2004/01/21 20:12:23 jhb Exp $"); +__FBSDID("$FreeBSD: src/lib/libstand/nfs.c,v 1.14 2008/11/21 09:14:29 luigi Exp $"); #include #include @@ -405,16 +405,23 @@ #ifdef NFS_DEBUG if (debug) - printf("nfs_open: %s (rootpath=%s)\n", path, rootpath); + printf("nfs_open: %s (rootpath=%s)\n", upath, rootpath); #endif if (!rootpath[0]) { printf("no rootpath, no nfs\n"); return (ENXIO); } + /* +* This is silly - we should look at dv_type but that value is +* arch dependant and we can't use it here. +*/ #ifndef __i386__ if (strcmp(f->f_dev->dv_name, "net") != 0) return(EINVAL); +#else + if (strcmp(f->f_dev->dv_name, "pxe") != 0) + return(EINVAL); #endif if (!(desc = socktodesc(*(int *)(f->f_devdata ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: ZFS booting without partitions
OK, so I've got my next little adventure here to share :-) ... after reading Your posts I was very eager to give the whole boot-zfs-without-partitions thing a new try. My starting situation was a ZFS mirror made up, as I wrote, of two GPT partitions, so my pool looked like: phaedrus# zpool status pool: tank state: ONLINE scrub: none requested config: NAMESTATE READ WRITE CKSUM tank ONLINE 0 0 0 ad6p4 ONLINE 0 0 0 ad4p4 ONLINE 0 0 0 it was root-mounted and everything was seemingly working fine, with the machine surviving several bonnie++'s, sysbenches, and supersmacks concurrently for many hours (cool!). So to give it another try my plan was to detach one partition, clear the gmirror on the UFS boot partition, make a new pool made out of the free disk and start the experiment over. it looked almost like this: zpool offline tank ad4p4 zpool detach tank ad4p4 gmirror stop gmboot (made out of ad6p2 and ad4p2) gmirror remove gmboot ad4p2 then I had to reboot cause it wouldn't give up on the swap partition on the zpool. That's where the first problem began: it wouldn't boot anymore... just because I removed a device? In this case I was stuck at the mountroot: stage. It wouldn't find the root filesystem on zfs. (this happened also when physically detaching ad4). So I booted off a recent 8-CURRENT iso DVD, and although the mounroot stage is, iirc, at a later stage than the loader, I smelled it could have something to do with it and downloaded Adam's CURRENT/ZFS loader, put it in the appropriate place on my UFS boot partition... note: From the CD, I had to import the pool with zpool import -o altroot=/somewhere tank to avoid having problems with the datasets being mounted on top of the 8-fixit environment's /usr ... Ok, rebooted, and whoops it would boot again in the previous environment. So... from there I started over with the creation of a ZFS-bootonly situation on ad4 (with the intention of zpool-attaching ad6 later on) dd if=/dev/zero bs=1m of=/dev/ad4 count=200 (just to be safe, some 'whitespace'..) zpool create esso da4 zfs snapshot -r t...@night zfs send -R t...@night | zfs recv -d -F esso (it did what it had to do - cool new v13 feature BTW!) zpool export esso dd if=/boot/zfsboot of=/dev/ad4 bs=512 count=1 dd if=/boot/zfsboot of=/dev/ad4 bs=512 skip=1 seek=1024 zpool import esso zpool set bootfs=esso esso the mountpoints (legacy on the poolfs, esso, and the corresponding ones) had been correctly copied by the send -R. Just shortly mounted esso somewhere else, edited loader.conf and fstab, and put it back to legacy. shutdown -r now. Upon boot, it would wait a while, not present any F1/F5, and booted into the old environment (ad6p2 boot partition and then mounted tank as root). From there, a zfs list or zpool status just showed the root pool (tank), but the new one (esso) was not present. A zpool import showed: heidegger# zpool import pool: esso id: 865609520845688328 state: UNAVAIL status: One or more devices are missing from the system. action: The pool cannot be imported. Attach the missing devices and try again. see: http://www.sun.com/msg/ZFS-8000-3C config: essoUNAVAIL insufficient replicas ad4 UNAVAIL cannot open zpool import -f esso did not succeed, instead, looking on the console, I found ZFS: WARNING: could not open ad4 for writing I repeated the steps above two more times, making sure I had wiped everyhing off ad4 before trying... but it would always come up with that message. The disk is OK, the cables too, I triple-checked it. Besides, writing to the disk with other means (such as dd or creating a new pool) succeeded... (albeit after the usual sysctl kern.geom.debugflags=16 ...) well for now I think I'll stick to the GPT + UFS Root + ZFS Root solution (I'm so happy this works seemlessly, so this is a big THANX and not a complaint!), but I thought I'd share the latest hickups... I won't be getting to that machine for a few days before restoring to the gpt-ufs-based mirror, so if someone would like me to provide other info I'll be happy to contribute it. Big Regards! Lorenzo On 01.06.2009, at 19:09, Lorenzo Perone wrote: On 31.05.2009, at 09:18, Adam McDougall wrote: I encountered the same symptoms today on both a 32bit and 64bit brand new install using gptzfsboot. It works for me when I use a copy of loader from an 8-current box with zfs support compiled in. I haven't looked into it much yet but it might help you. If you want, you can try the loader I am using from: http://www.egr.msu.edu/~mcdouga9/loader Thanx for posting me your loader, I'll try with this tomorrow night! (any hint, btw, on why the one in -STABLE seems to be broken, or whether it has actually been fixed by now?) ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.
Re: ZFS booting without partitions
On Mon, Jun 1, 2009 at 10:21 AM, Adam McDougall wrote: > I'm thinking that too. I spent some time taking stabs at figuring it out > yesterday but didn't get anywhere useful. I did try compiling the -current > src/sys/boot tree on 7.2 after a couple header tweaks to make it compile but > the loader still didn't work. The working loader is the same file size as > the broken loader unless it was compiled on i386 and then it is ~30k bigger > for some reason (it shrinks to the same size as the rest if I force it to > use the same 32bit compilation flags as used on amd64). Just mentioning > this in case it saves someone else some time. I'm real pleased it works at > all. If someone has the time to track down the differences I'll MFC them. I'm not using ZFS boot at the moment so I have no way of testing. Cheers, Kip ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: ZFS booting without partitions
On Monday 01 June 2009 12:06:18 Henri Hennebert wrote: > Lorenzo Perone wrote: > > Hi, > > > > I tried hard... but without success ;( > > > > the result is, when choosing the disk with the zfs boot > > sectors in it (in my case F5, which goes to ad6), the kernel > > is not found. the console shows: > > > > forth not found > > definitions not found > > only not found > > (the above repeated several times) > > This is the file /boot/loader from 7.2-STABLE which is wrong. > > You can find a copy from 8.0-CURRENT and a script that I tested on a USB > key) and is running for me: > > http://verbier.restart.be/xfer/boot-zfs/ Thanks! I replaced /boot/loader with the file from your link. Now the system boot. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: ZFS booting without partitions
I'm thinking that too. I spent some time taking stabs at figuring it out yesterday but didn't get anywhere useful. I did try compiling the -current src/sys/boot tree on 7.2 after a couple header tweaks to make it compile but the loader still didn't work. The working loader is the same file size as the broken loader unless it was compiled on i386 and then it is ~30k bigger for some reason (it shrinks to the same size as the rest if I force it to use the same 32bit compilation flags as used on amd64). Just mentioning this in case it saves someone else some time. I'm real pleased it works at all. Kip Macy wrote: Odds are that there are more changes that were made in HEAD to the loader that need to be MFC'd. -Kip On Mon, Jun 1, 2009 at 3:55 AM, Alberto Villa wrote: On Mon, Jun 1, 2009 at 12:06 PM, Henri Hennebert wrote: This is the file /boot/loader from 7.2-STABLE which is wrong. You can find a copy from 8.0-CURRENT and a script that I tested on a USB key) and is running for me: replacing /boot/loader with yours did the job thanks! -- Alberto Villa ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org" ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: ZFS booting without partitions (was: ZFS boot on zfs mirror)
On 31.05.2009, at 09:18, Adam McDougall wrote: I encountered the same symptoms today on both a 32bit and 64bit brand new install using gptzfsboot. It works for me when I use a copy of loader from an 8-current box with zfs support compiled in. I haven't looked into it much yet but it might help you. If you want, you can try the loader I am using from: http://www.egr.msu.edu/~mcdouga9/loader Hi, thanx a lot for this hint. Meanwhile, I was almost giving up, and had a try with ZFS on Root with GPT partitioning, using gptzfsboot as the bootloader, a UFS root partition as boot partition (gmirrored to both disks), and the rest (inclusive of a zvol for swap!) on ZFS. This worked perfectly on the first try. (if anyone is interested, I can post my commented command series for that, but it's just a mix of the available tutorials on the web..). I'll be glad do give the zfs-only solution a new try. Had the same impression, that the loader was involved in the problem, but had no env at hand to build a -CURRENT right away... (I did, in fact, repeat the dd-steps a zfsboot bootloader from a recent 8- snapshot iso... with the results being the same as before...). Sidenote: I encountered a few panics when using rsync with the HAX flags enabled (rsync -avxHAX from UFS to ZFS). I'll try to figure out which one of the flags caused it... (Hard links, ACLs, or eXtended attributes..). Never had even the slightest problem with rsync -avx. Thanx for posting me your loader, I'll try with this tomorrow night! (any hint, btw, on why the one in -STABLE seems to be broken, or whether it has actually been fixed by now?) Regards, Lorenzo (...) 2009/5/28 Lorenzo Perone: Hi, I tried hard... but without success ;( the result is, when choosing the disk with the zfs boot sectors in it (in my case F5, which goes to ad6), the kernel is not found. the console shows: forth not found definitions not found only not found (the above repeated several times) can't load 'kernel' and I get thrown to the loader prompt. lsdev does not show any ZFS devices. (...) ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: ZFS booting without partitions
Odds are that there are more changes that were made in HEAD to the loader that need to be MFC'd. -Kip On Mon, Jun 1, 2009 at 3:55 AM, Alberto Villa wrote: > On Mon, Jun 1, 2009 at 12:06 PM, Henri Hennebert wrote: >> This is the file /boot/loader from 7.2-STABLE which is wrong. >> >> You can find a copy from 8.0-CURRENT and a script that I tested on a USB >> key) and is running for me: > > replacing /boot/loader with yours did the job > thanks! > -- > Alberto Villa > ___ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org" > -- When bad men combine, the good must associate; else they will fall one by one, an unpitied sacrifice in a contemptible struggle. Edmund Burke ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: ZFS booting without partitions
On Mon, Jun 1, 2009 at 12:06 PM, Henri Hennebert wrote: > This is the file /boot/loader from 7.2-STABLE which is wrong. > > You can find a copy from 8.0-CURRENT and a script that I tested on a USB > key) and is running for me: replacing /boot/loader with yours did the job thanks! -- Alberto Villa ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: ZFS booting without partitions
Henri Hennebert wrote: Lorenzo Perone wrote: Hi, I tried hard... but without success ;( the result is, when choosing the disk with the zfs boot sectors in it (in my case F5, which goes to ad6), the kernel is not found. the console shows: forth not found definitions not found only not found (the above repeated several times) This is the file /boot/loader from 7.2-STABLE which is wrong. You can find a copy from 8.0-CURRENT and a script that I tested on a USB key) and is running for me: http://verbier.restart.be/xfer/boot-zfs/ Put this directory somewhere, eg /tmp/boot-zfs and run the script eg: `cd /tmp/boot-zfs && sh -x make_usb_key.sh da6 kingston` good luck CAVEAT: The script put tuning in '/boot/loader.conf' wich imply "options KVA_PAGES=384" in my i386 kernel. Henri Henri can't load 'kernel' and I get thrown to the loader prompt. lsdev does not show any ZFS devices. Strange thing: if I boot from the other disk, F1, which is my ad4 containing the normal ufs system I used to make up the other one, and escape to the loader prompt, lsdev actually sees the zpool which is on the other disk, and shows: zfs0: tank I tried booting with boot zfs:tank or zfs:tank:/boot/kernel/kernel, but there I get the panic: free: guard1 fail message. (would boot zfs:tank:/boot/kernel/kernel be correct, anyways?) Sure I'm doing something wrong, but what...? Is it a problem that the pool is made out of the second disk only (ad6)? Here are my details (note: latest stable and biosdisk.c merged with changes shown in r185095. no problems in buildworld/kernel): Machine: p4 4GHz 4 GB RAM (i386) Note: the pool has actually a different name (heidi instead of tank, if this can be of any relevance...), just using tank here as it's one of the conventions... mount (just to show my starting situation) /dev/mirror/gm0s1a on / (ufs, local) devfs on /dev (devfs, local) /dev/mirror/gm0s1e on /tmp (ufs, local, soft-updates) /dev/mirror/gm0s1f on /usr (ufs, local, soft-updates) /dev/mirror/gm0s1d on /var (ufs, local, soft-updates) gmirror status NameStatus Components mirror/gm0 DEGRADED ad4 (ad6 used to be the second disk...) echo 'LOADER_ZFS_SUPPORT=yes' >> /etc/make.conf cd /usr/src make buildworld && make buildkernel KERNCONF=HEIDI make installkernel KERNCONF=HEIDI mergemaster make installworld shutdown -r now dd if=/dev/zero of=/dev/ad6 bs=512 count=32 zpool create tank ad6 zfs create tank/usr zfs create tank/var zfs create -V 4gb tank/swap zfs set org.freebsd:swap=on tank/swap zpool set bootfs=tank tank rsync -avx / /tank rsync -avx /usr/ /tank/usr rsync -avx /var/ /tank/var cd /usr/src make installkernel KERNCONF=HEIDI DESTDIR=/tank zpool export tank dd if=/boot/zfsboot of=/dev/ad6 bs=512 count=1 dd if=/boot/zfsboot of=/dev/ad6 bs=512 skip=1 seek=1024 zpool import tank zfs set mountpoint=legacy tank zfs set mountpoint=/usr tank/usr zfs set mountpoint=/var tank/var shutdown -r now ... at the 'mbr prompt' I pressed F5 (the second disk, ad6) .. as written above, loader gets loaded (at this stage I suppose it's the stuff dd't after block 1024?), but kernel not found. /usr/src/sys/i386/conf/HEIDI: (among other things...): options KVA_PAGES=512 (/tank)/boot/loader.conf: vm.kmem_size="1024M" vm.kmem_size_max="1024M" vfs.zfs.arc_max="128M" vfs.zfs.vdev.cache.size="8M" vfs.root.mountfrom="zfs:tank" (/tank)/etc/fstab: # DeviceMountpointFStypeOptionsDumpPass# tank/zfsrw00 /dev/acd0/cdromcd9660ro,noauto00 any help is welcome... don't know where to go from here right now. BTW: I can't stop thanking the team for the incredible pace at which bugs are fixed these days! Regards, Lorenzo On 26.05.2009, at 18:42, George Hartzell wrote: Andriy Gapon writes: on 26/05/2009 19:21 George Hartzell said the following: Dmitry Morozovsky writes: On Tue, 26 May 2009, Mickael MAILLOT wrote: MM> Hi, MM> MM> i prefere use zfsboot boot sector, an example is better than a long talk: MM> MM> $ zpool create tank mirror ad4 ad6 MM> $ zpool export tank MM> $ dd if=/boot/zfsboot of=/dev/ad4 bs=512 count=1 MM> $ dd if=/boot/zfsboot of=/dev/ad6 bs=512 count=1 MM> $ dd if=/boot/zfsboot of=/dev/ad4 bs=512 skeep=1 seek=1024 MM> $ dd if=/boot/zfsboot of=/dev/ad6 bs=512 skeep=1 seek=1024 s/skeep/skip/ ? ;-) What is the reason for copying zfsboot one bit at a time, as opposed to dd if=/boot/zfsboot of=/dev/ad4 bs=512 count=2 seek=1024 for the second part? and no 'count=1' for it? :-) [Just guessing] Apparently the first block of zfsboot is some form of MBR and the rest is zfs-specific code that goes to magical sector 1024. Ok, I managed to read the argument to seek as "one block", apparently my coffee hasn't hit yet. I'm still confused about the two parts of zfsboot and what's magical about seeking to 1024. g. ___ freebsd-stable@freebsd.org mailing list http:/
Re: ZFS booting without partitions
Lorenzo Perone wrote: Hi, I tried hard... but without success ;( the result is, when choosing the disk with the zfs boot sectors in it (in my case F5, which goes to ad6), the kernel is not found. the console shows: forth not found definitions not found only not found (the above repeated several times) This is the file /boot/loader from 7.2-STABLE which is wrong. You can find a copy from 8.0-CURRENT and a script that I tested on a USB key) and is running for me: http://verbier.restart.be/xfer/boot-zfs/ Put this directory somewhere, eg /tmp/boot-zfs and run the script eg: `cd /tmp/boot-zfs && sh -x make_usb_key.sh da6 kingston` good luck Henri can't load 'kernel' and I get thrown to the loader prompt. lsdev does not show any ZFS devices. Strange thing: if I boot from the other disk, F1, which is my ad4 containing the normal ufs system I used to make up the other one, and escape to the loader prompt, lsdev actually sees the zpool which is on the other disk, and shows: zfs0: tank I tried booting with boot zfs:tank or zfs:tank:/boot/kernel/kernel, but there I get the panic: free: guard1 fail message. (would boot zfs:tank:/boot/kernel/kernel be correct, anyways?) Sure I'm doing something wrong, but what...? Is it a problem that the pool is made out of the second disk only (ad6)? Here are my details (note: latest stable and biosdisk.c merged with changes shown in r185095. no problems in buildworld/kernel): Machine: p4 4GHz 4 GB RAM (i386) Note: the pool has actually a different name (heidi instead of tank, if this can be of any relevance...), just using tank here as it's one of the conventions... mount (just to show my starting situation) /dev/mirror/gm0s1a on / (ufs, local) devfs on /dev (devfs, local) /dev/mirror/gm0s1e on /tmp (ufs, local, soft-updates) /dev/mirror/gm0s1f on /usr (ufs, local, soft-updates) /dev/mirror/gm0s1d on /var (ufs, local, soft-updates) gmirror status NameStatus Components mirror/gm0 DEGRADED ad4 (ad6 used to be the second disk...) echo 'LOADER_ZFS_SUPPORT=yes' >> /etc/make.conf cd /usr/src make buildworld && make buildkernel KERNCONF=HEIDI make installkernel KERNCONF=HEIDI mergemaster make installworld shutdown -r now dd if=/dev/zero of=/dev/ad6 bs=512 count=32 zpool create tank ad6 zfs create tank/usr zfs create tank/var zfs create -V 4gb tank/swap zfs set org.freebsd:swap=on tank/swap zpool set bootfs=tank tank rsync -avx / /tank rsync -avx /usr/ /tank/usr rsync -avx /var/ /tank/var cd /usr/src make installkernel KERNCONF=HEIDI DESTDIR=/tank zpool export tank dd if=/boot/zfsboot of=/dev/ad6 bs=512 count=1 dd if=/boot/zfsboot of=/dev/ad6 bs=512 skip=1 seek=1024 zpool import tank zfs set mountpoint=legacy tank zfs set mountpoint=/usr tank/usr zfs set mountpoint=/var tank/var shutdown -r now ... at the 'mbr prompt' I pressed F5 (the second disk, ad6) .. as written above, loader gets loaded (at this stage I suppose it's the stuff dd't after block 1024?), but kernel not found. /usr/src/sys/i386/conf/HEIDI: (among other things...): options KVA_PAGES=512 (/tank)/boot/loader.conf: vm.kmem_size="1024M" vm.kmem_size_max="1024M" vfs.zfs.arc_max="128M" vfs.zfs.vdev.cache.size="8M" vfs.root.mountfrom="zfs:tank" (/tank)/etc/fstab: # DeviceMountpointFStypeOptionsDumpPass# tank/zfsrw00 /dev/acd0/cdromcd9660ro,noauto00 any help is welcome... don't know where to go from here right now. BTW: I can't stop thanking the team for the incredible pace at which bugs are fixed these days! Regards, Lorenzo On 26.05.2009, at 18:42, George Hartzell wrote: Andriy Gapon writes: on 26/05/2009 19:21 George Hartzell said the following: Dmitry Morozovsky writes: On Tue, 26 May 2009, Mickael MAILLOT wrote: MM> Hi, MM> MM> i prefere use zfsboot boot sector, an example is better than a long talk: MM> MM> $ zpool create tank mirror ad4 ad6 MM> $ zpool export tank MM> $ dd if=/boot/zfsboot of=/dev/ad4 bs=512 count=1 MM> $ dd if=/boot/zfsboot of=/dev/ad6 bs=512 count=1 MM> $ dd if=/boot/zfsboot of=/dev/ad4 bs=512 skeep=1 seek=1024 MM> $ dd if=/boot/zfsboot of=/dev/ad6 bs=512 skeep=1 seek=1024 s/skeep/skip/ ? ;-) What is the reason for copying zfsboot one bit at a time, as opposed to dd if=/boot/zfsboot of=/dev/ad4 bs=512 count=2 seek=1024 for the second part? and no 'count=1' for it? :-) [Just guessing] Apparently the first block of zfsboot is some form of MBR and the rest is zfs-specific code that goes to magical sector 1024. Ok, I managed to read the argument to seek as "one block", apparently my coffee hasn't hit yet. I'm still confused about the two parts of zfsboot and what's magical about seeking to 1024. g. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org" ___
Re: ZFS booting without partitions (was: ZFS boot on zfs mirror)
On Thu, May 28, 2009 at 3:58 PM, Lorenzo Perone wrote: > the result is, when choosing the disk with the zfs boot > sectors in it (in my case F5, which goes to ad6), the kernel > is not found. the console shows: > > forth not found > definitions not found > only not found > (the above repeated several times) > > can't load 'kernel' > > and I get thrown to the loader prompt. > lsdev does not show any ZFS devices. same here on 7-stable (csupped yesterday) i've followed the same steps, but i've used gpt as explained in the first mail. the same exact steps worked perfectly on 8-current in virtualbox -- Alberto Villa ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: ZFS booting without partitions (was: ZFS boot on zfs mirror)
On Thursday 28 May 2009 15:58:04 Lorenzo Perone wrote: > Hi, > > I tried hard... but without success ;( > > the result is, when choosing the disk with the zfs boot > sectors in it (in my case F5, which goes to ad6), the kernel > is not found. the console shows: > > forth not found > definitions not found > only not found > (the above repeated several times) > > can't load 'kernel' > > and I get thrown to the loader prompt. > lsdev does not show any ZFS devices. > > Strange thing: if I boot from the other disk, F1, which is my > ad4 containing the normal ufs system I used to make up the other > one, and escape to the loader prompt, lsdev actually sees the > zpool which is on the other disk, and shows: > zfs0: tank > > I tried booting with boot zfs:tank or zfs:tank:/boot/kernel/kernel, > but there I get the panic: free: guard1 fail message. > (would boot zfs:tank:/boot/kernel/kernel be correct, anyways?) > > Sure I'm doing something wrong, but what...? Is it a problem that > the pool is made out of the second disk only (ad6)? > > Here are my details (note: latest stable and biosdisk.c merged > with changes shown in r185095. no problems in buildworld/kernel): > > > > Machine: p4 4GHz 4 GB RAM (i386) > > Note: the pool has actually a different name (heidi > instead of tank, if this can be of any relevance...), > just using tank here as it's one of the conventions... > > mount (just to show my starting situation) > > /dev/mirror/gm0s1a on / (ufs, local) > devfs on /dev (devfs, local) > /dev/mirror/gm0s1e on /tmp (ufs, local, soft-updates) > /dev/mirror/gm0s1f on /usr (ufs, local, soft-updates) > /dev/mirror/gm0s1d on /var (ufs, local, soft-updates) > > gmirror status >NameStatus Components > mirror/gm0 DEGRADED ad4 > (ad6 used to be the second disk...) > > echo 'LOADER_ZFS_SUPPORT=yes' >> /etc/make.conf > > cd /usr/src > make buildworld && make buildkernel KERNCONF=HEIDI > make installkernel KERNCONF=HEIDI > mergemaster > make installworld > shutdown -r now > > dd if=/dev/zero of=/dev/ad6 bs=512 count=32 > > zpool create tank ad6 > zfs create tank/usr > zfs create tank/var > zfs create -V 4gb tank/swap > zfs set org.freebsd:swap=on tank/swap > zpool set bootfs=tank tank > > rsync -avx / /tank > rsync -avx /usr/ /tank/usr > rsync -avx /var/ /tank/var > cd /usr/src > make installkernel KERNCONF=HEIDI DESTDIR=/tank > > zpool export tank > > dd if=/boot/zfsboot of=/dev/ad6 bs=512 count=1 > dd if=/boot/zfsboot of=/dev/ad6 bs=512 skip=1 seek=1024 > > zpool import tank > > zfs set mountpoint=legacy tank > zfs set mountpoint=/usr tank/usr > zfs set mountpoint=/var tank/var > > shutdown -r now ... > > at the 'mbr prompt' I pressed F5 (the second disk, ad6) > .. as written above, loader gets loaded (at this stage > I suppose it's the stuff dd't after block 1024?), > but kernel not found. > > /usr/src/sys/i386/conf/HEIDI: > (among other things...): > options KVA_PAGES=512 > > (/tank)/boot/loader.conf: > vm.kmem_size="1024M" > vm.kmem_size_max="1024M" > vfs.zfs.arc_max="128M" > vfs.zfs.vdev.cache.size="8M" > vfs.root.mountfrom="zfs:tank" > > (/tank)/etc/fstab: > # Device Mountpoint FStype Options DumpPass# > tank / zfs rw 0 0 > /dev/acd0 /cdrom cd9660 ro,noauto 0 0 > > > > any help is welcome... don't know where to go from here right now. > > BTW: I can't stop thanking the team for the incredible > pace at which bugs are fixed these days! > > > Regards, > > Lorenzo > > On 26.05.2009, at 18:42, George Hartzell wrote: > > Andriy Gapon writes: > >> on 26/05/2009 19:21 George Hartzell said the following: > >>> Dmitry Morozovsky writes: > On Tue, 26 May 2009, Mickael MAILLOT wrote: > > MM> Hi, > MM> > MM> i prefere use zfsboot boot sector, an example is better than > a long talk: > MM> > MM> $ zpool create tank mirror ad4 ad6 > MM> $ zpool export tank > MM> $ dd if=/boot/zfsboot of=/dev/ad4 bs=512 count=1 > MM> $ dd if=/boot/zfsboot of=/dev/ad6 bs=512 count=1 > MM> $ dd if=/boot/zfsboot of=/dev/ad4 bs=512 skeep=1 seek=1024 > MM> $ dd if=/boot/zfsboot of=/dev/ad6 bs=512 skeep=1 seek=1024 > > s/skeep/skip/ ? ;-) > >>> > >>> What is the reason for copying zfsboot one bit at a time, as opposed > >>> to > >>> > >>> dd if=/boot/zfsboot of=/dev/ad4 bs=512 count=2 > >> > >> seek=1024 for the second part? and no 'count=1' for it? :-) > >> > >> [Just guessing] Apparently the first block of zfsboot is some form > >> of MBR and the > >> rest is zfs-specific code that goes to magical sector 1024. > > > > Ok, I managed to read the argument to seek as "one block", apparently > > my coffee hasn't hit yet. > > > > I'm still confused about the two parts of zfsboot and what's magical > > about seeking to 1024. > > > > g. I obtained the same result with FreeBSD 7 stable. I installed first a new system in a scsi disk with ufs I put LOADER_ZFS_SU
Re: ZFS booting without partitions (was: ZFS boot on zfs mirror)
I encountered the same symptoms today on both a 32bit and 64bit brand new install using gptzfsboot. It works for me when I use a copy of loader from an 8-current box with zfs support compiled in. I haven't looked into it much yet but it might help you. If you want, you can try the loader I am using from: http://www.egr.msu.edu/~mcdouga9/loader On Thu, May 28, 2009 at 10:41:42PM +0200, Lorenzo Perone wrote: On 28.05.2009, at 21:46, Mickael MAILLOT wrote: > hi, > > did you erase gmirror meta ? (on the last sector) > with: gmirror clear ad6 ohps I had forgotten that. just did it (in single user mode), but it didn't help :( Shall I repeat any of the other steps after clearing gmirror meta? thanx a lot for your help... Lorenzo > 2009/5/28 Lorenzo Perone : >> Hi, >> >> I tried hard... but without success ;( >> >> the result is, when choosing the disk with the zfs boot >> sectors in it (in my case F5, which goes to ad6), the kernel >> is not found. the console shows: >> >> forth not found >> definitions not found >> only not found >> (the above repeated several times) >> >> can't load 'kernel' >> >> and I get thrown to the loader prompt. >> lsdev does not show any ZFS devices. >> >> Strange thing: if I boot from the other disk, F1, which is my >> ad4 containing the normal ufs system I used to make up the other >> one, and escape to the loader prompt, lsdev actually sees the >> zpool which is on the other disk, and shows: >> zfs0: tank >> >> I tried booting with boot zfs:tank or zfs:tank:/boot/kernel/kernel, >> but there I get the panic: free: guard1 fail message. >> (would boot zfs:tank:/boot/kernel/kernel be correct, anyways?) >> >> Sure I'm doing something wrong, but what...? Is it a problem that >> the pool is made out of the second disk only (ad6)? >> >> Here are my details (note: latest stable and biosdisk.c merged >> with changes shown in r185095. no problems in buildworld/kernel): >> () ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org" ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: ZFS booting without partitions (was: ZFS boot on zfs mirror)
On 28.05.2009, at 21:46, Mickael MAILLOT wrote: hi, did you erase gmirror meta ? (on the last sector) with: gmirror clear ad6 ohps I had forgotten that. just did it (in single user mode), but it didn't help :( Shall I repeat any of the other steps after clearing gmirror meta? thanx a lot for your help... Lorenzo 2009/5/28 Lorenzo Perone : Hi, I tried hard... but without success ;( the result is, when choosing the disk with the zfs boot sectors in it (in my case F5, which goes to ad6), the kernel is not found. the console shows: forth not found definitions not found only not found (the above repeated several times) can't load 'kernel' and I get thrown to the loader prompt. lsdev does not show any ZFS devices. Strange thing: if I boot from the other disk, F1, which is my ad4 containing the normal ufs system I used to make up the other one, and escape to the loader prompt, lsdev actually sees the zpool which is on the other disk, and shows: zfs0: tank I tried booting with boot zfs:tank or zfs:tank:/boot/kernel/kernel, but there I get the panic: free: guard1 fail message. (would boot zfs:tank:/boot/kernel/kernel be correct, anyways?) Sure I'm doing something wrong, but what...? Is it a problem that the pool is made out of the second disk only (ad6)? Here are my details (note: latest stable and biosdisk.c merged with changes shown in r185095. no problems in buildworld/kernel): () ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: ZFS booting without partitions (was: ZFS boot on zfs mirror)
hi, did you erase gmirror meta ? (on the last sector) with: gmirror clear ad6 2009/5/28 Lorenzo Perone : > Hi, > > I tried hard... but without success ;( > > the result is, when choosing the disk with the zfs boot > sectors in it (in my case F5, which goes to ad6), the kernel > is not found. the console shows: > > forth not found > definitions not found > only not found > (the above repeated several times) > > can't load 'kernel' > > and I get thrown to the loader prompt. > lsdev does not show any ZFS devices. > > Strange thing: if I boot from the other disk, F1, which is my > ad4 containing the normal ufs system I used to make up the other > one, and escape to the loader prompt, lsdev actually sees the > zpool which is on the other disk, and shows: > zfs0: tank > > I tried booting with boot zfs:tank or zfs:tank:/boot/kernel/kernel, > but there I get the panic: free: guard1 fail message. > (would boot zfs:tank:/boot/kernel/kernel be correct, anyways?) > > Sure I'm doing something wrong, but what...? Is it a problem that > the pool is made out of the second disk only (ad6)? > > Here are my details (note: latest stable and biosdisk.c merged > with changes shown in r185095. no problems in buildworld/kernel): > > > > Machine: p4 4GHz 4 GB RAM (i386) > > Note: the pool has actually a different name (heidi > instead of tank, if this can be of any relevance...), > just using tank here as it's one of the conventions... > > mount (just to show my starting situation) > > /dev/mirror/gm0s1a on / (ufs, local) > devfs on /dev (devfs, local) > /dev/mirror/gm0s1e on /tmp (ufs, local, soft-updates) > /dev/mirror/gm0s1f on /usr (ufs, local, soft-updates) > /dev/mirror/gm0s1d on /var (ufs, local, soft-updates) > > gmirror status > Name Status Components > mirror/gm0 DEGRADED ad4 > (ad6 used to be the second disk...) > > echo 'LOADER_ZFS_SUPPORT=yes' >> /etc/make.conf > > cd /usr/src > make buildworld && make buildkernel KERNCONF=HEIDI > make installkernel KERNCONF=HEIDI > mergemaster > make installworld > shutdown -r now > > dd if=/dev/zero of=/dev/ad6 bs=512 count=32 > > zpool create tank ad6 > zfs create tank/usr > zfs create tank/var > zfs create -V 4gb tank/swap > zfs set org.freebsd:swap=on tank/swap > zpool set bootfs=tank tank > > rsync -avx / /tank > rsync -avx /usr/ /tank/usr > rsync -avx /var/ /tank/var > cd /usr/src > make installkernel KERNCONF=HEIDI DESTDIR=/tank > > zpool export tank > > dd if=/boot/zfsboot of=/dev/ad6 bs=512 count=1 > dd if=/boot/zfsboot of=/dev/ad6 bs=512 skip=1 seek=1024 > > zpool import tank > > zfs set mountpoint=legacy tank > zfs set mountpoint=/usr tank/usr > zfs set mountpoint=/var tank/var > > shutdown -r now ... > > at the 'mbr prompt' I pressed F5 (the second disk, ad6) > .. as written above, loader gets loaded (at this stage > I suppose it's the stuff dd't after block 1024?), > but kernel not found. > > /usr/src/sys/i386/conf/HEIDI: > (among other things...): > options KVA_PAGES=512 > > (/tank)/boot/loader.conf: > vm.kmem_size="1024M" > vm.kmem_size_max="1024M" > vfs.zfs.arc_max="128M" > vfs.zfs.vdev.cache.size="8M" > vfs.root.mountfrom="zfs:tank" > > (/tank)/etc/fstab: > # Device Mountpoint FStype Options Dump > Pass# > tank / zfs rw 0 0 > /dev/acd0 /cdrom cd9660 ro,noauto 0 0 > > > > any help is welcome... don't know where to go from here right now. > > BTW: I can't stop thanking the team for the incredible > pace at which bugs are fixed these days! > > > Regards, > > Lorenzo > > > > On 26.05.2009, at 18:42, George Hartzell wrote: > >> Andriy Gapon writes: >>> >>> on 26/05/2009 19:21 George Hartzell said the following: Dmitry Morozovsky writes: > > On Tue, 26 May 2009, Mickael MAILLOT wrote: > > MM> Hi, > MM> > MM> i prefere use zfsboot boot sector, an example is better than a long > talk: > MM> > MM> $ zpool create tank mirror ad4 ad6 > MM> $ zpool export tank > MM> $ dd if=/boot/zfsboot of=/dev/ad4 bs=512 count=1 > MM> $ dd if=/boot/zfsboot of=/dev/ad6 bs=512 count=1 > MM> $ dd if=/boot/zfsboot of=/dev/ad4 bs=512 skeep=1 seek=1024 > MM> $ dd if=/boot/zfsboot of=/dev/ad6 bs=512 skeep=1 seek=1024 > > s/skeep/skip/ ? ;-) What is the reason for copying zfsboot one bit at a time, as opposed to dd if=/boot/zfsboot of=/dev/ad4 bs=512 count=2 >>> >>> seek=1024 for the second part? and no 'count=1' for it? :-) >>> >>> [Just guessing] Apparently the first block of zfsboot is some form of MBR >>> and the >>> rest is zfs-specific code that goes to magical sector 1024. >> >> Ok, I managed to read the argument to seek as "one block", apparently >> my coffee hasn't hit yet. >> >> I'm still confused about the two parts of zfsboot and what's magical >> about seeking to 1024. >> >> g. >> >> ___ >> freebsd-stable@freebsd.org m