Re: ZFS booting without partitions (was: ZFS boot on zfs mirror)

2009-06-01 Thread Lorenzo Perone

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 (was: ZFS boot on zfs mirror)

2009-06-01 Thread Alberto Villa
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)

2009-05-31 Thread Enrico M.
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)

2009-05-31 Thread Adam McDougall
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)

2009-05-28 Thread Lorenzo Perone


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)

2009-05-28 Thread Mickael MAILLOT
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

ZFS booting without partitions (was: ZFS boot on zfs mirror)

2009-05-28 Thread 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
  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:
# DeviceMountpoint  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.

___
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 boot on zfs mirror

2009-05-26 Thread Doug Rabson

On Tue, 26 May 2009 19:57:03 +0300, Andriy Gapon  wrote:
> on 26/05/2009 19:42 George Hartzell said the following:
>> I'm still confused about the two parts of zfsboot and what's magical
>> about seeking to 1024.
> 
> Can't help with answer to this, but cc-ing the one who can (I think).
> I am interested too :-)

This is due to the primitive DOS boot sequence. Basically the BIOS loads
the first sector of the partition and executes it. For zfsboot, that is the
first 512 bytes of /boot/zfsboot. The next stage of the bootstrap is tucked
away in a convenient hole in the ZFS on-disk formwat which is located just
after the ZFS metadata - this is the seek=1024 part. The first 512 byte
part is a tiny assembler program that loads the rest into memory and
executes it. The second part is large enough and smart enough to understand
the ZFS filesystem format directly and it loads /boot/loader directly from
the filesystem and transfers control to that. The third stage
(/boot/loader) is what puts up the boot menu and loads the kernel etc.

___
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 boot on zfs mirror

2009-05-26 Thread Andriy Gapon
on 26/05/2009 19:42 George Hartzell said the following:
> I'm still confused about the two parts of zfsboot and what's magical
> about seeking to 1024.

Can't help with answer to this, but cc-ing the one who can (I think).
I am interested too :-)

-- 
Andriy Gapon
___
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 boot on zfs mirror

2009-05-26 Thread George Hartzell
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 boot on zfs mirror

2009-05-26 Thread Andriy Gapon
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.

-- 
Andriy Gapon
___
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 boot on zfs mirror

2009-05-26 Thread George Hartzell
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

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 boot on zfs mirror

2009-05-26 Thread Lorenzo Perone

Hi All,

Thanx for all the feedback!

Philipp: Your idea is really fine, with manageBE :)
Would surely be nice for a test/development machine,
I'll think about using it... (sounds a bit like
FreeBSD goin' the Nexenta way...)

Mickael: Your example looks much more like what I was
looking  for (and thank god UNIX still is mostly
ASCII so I can follow the link You posted).

But, just as a side question: how much of a risk of
creating an [ugly] race condition is it actually,
to use swap on a zvol?

Yet another question would be, how much is performance
impacted by the zfs overhead (ok, leaving aside that
a swapping system needs ram - wherever the swap is located...)?
But hey, snapshotting swap - isn't THAT funky? ;)

Thanx to all for the feedback, it's great to
be a FreeBSD user all the time!

I'll be trying to set this up ASAP.

Regards,

Lorenzo

On 26.05.2009, at 11:26, Mickael MAILLOT wrote:


Hi,

i prefere use zfsboot boot sector, an example is better than a long  
talk:


$ zpool create tank mirror ad4 ad6
$ zpool export tank
$ dd if=/boot/zfsboot of=/dev/ad4 bs=512 count=1
$ dd if=/boot/zfsboot of=/dev/ad6 bs=512 count=1
$ dd if=/boot/zfsboot of=/dev/ad4 bs=512 skeep=1  seek=1024
$ dd if=/boot/zfsboot of=/dev/ad6 bs=512 skeep=1  seek=1024
$ zpool import tank
$ zpool set bootfs=tank tank
$ zfs set mountpoint=legacy tank

add vfs.root.mountfrom="zfs:tank" to your loader.conf
now you can boot on ad4 or ad6

Source:
http://www.waishi.jp/~yosimoto/diary/?date=20080909

2009/5/25 Philipp Wuensche :

Lorenzo Perone wrote:


Hello to all,

Having licked blood now, and read the news from Kip Macy about


-  zfs boot for all types now works



I was wondering if anyone has some updated tutorial on how to  
achieve a

zfs-only bootable FreeBSD with a mirrored zpool.


My own howto and script to do the stuff automated:
http://outpost.h3q.com/patches/manageBE/create-FreeBSD-ZFS-bootfs.txt

But beware, it is meant to use with
http://anonsvn.h3q.com/projects/freebsd-patches/wiki/manageBE
afterwards. But the steps are the same.

Searching around I found this tutorial on how to set up a ZFS  
bootable

system, which is mostly straightforward:

http://blogs.freebsdish.org/lulf/2008/12/16/setting-up-a-zfs-only-system/

However it leaves a few questions open... How am I supposed to  
make a
zfs mirror out of it? Suppose I have ad4 and ad6, should I repeat  
the

exact same gpart-steps for both ad4 and ad6, and then make a zpool
create data mirror ad4p3 ad6p3?


Exactly.


How about swap? I suppose it will be on
one of the disks?


I keep swap in a seperate partition. You could either use two swap
partition, each on one disk or use gmirror to mirror a single swap
partition to be safe from disk crash.


And what if I start with one disk and add the second
one later with zpool attach?


This will work. Just do the same gpart commands on the second disk  
and

use zpool attach.

greetings,
philipp

___
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 
"


___
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 boot on zfs mirror

2009-05-26 Thread Dmitry Morozovsky
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/ ? ;-)

MM> $ zpool import tank
MM> $ zpool set bootfs=tank tank
MM> $ zfs set mountpoint=legacy tank
MM> 
MM> add vfs.root.mountfrom="zfs:tank" to your loader.conf
MM> now you can boot on ad4 or ad6
MM> 
MM> Source:
MM> http://www.waishi.jp/~yosimoto/diary/?date=20080909

[snip]

-- 
Sincerely,
D.Marck [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer: ma...@freebsd.org ]

*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- ma...@rinet.ru ***

___
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 boot on zfs mirror

2009-05-26 Thread Mickael MAILLOT
Hi,

i prefere use zfsboot boot sector, an example is better than a long talk:

$ zpool create tank mirror ad4 ad6
$ zpool export tank
$ dd if=/boot/zfsboot of=/dev/ad4 bs=512 count=1
$ dd if=/boot/zfsboot of=/dev/ad6 bs=512 count=1
$ dd if=/boot/zfsboot of=/dev/ad4 bs=512 skeep=1  seek=1024
$ dd if=/boot/zfsboot of=/dev/ad6 bs=512 skeep=1  seek=1024
$ zpool import tank
$ zpool set bootfs=tank tank
$ zfs set mountpoint=legacy tank

add vfs.root.mountfrom="zfs:tank" to your loader.conf
now you can boot on ad4 or ad6

Source:
http://www.waishi.jp/~yosimoto/diary/?date=20080909

2009/5/25 Philipp Wuensche :
> Lorenzo Perone wrote:
>>
>> Hello to all,
>>
>> Having licked blood now, and read the news from Kip Macy about
>>
>>> -  zfs boot for all types now works
>>
>>
>> I was wondering if anyone has some updated tutorial on how to achieve a
>> zfs-only bootable FreeBSD with a mirrored zpool.
>
> My own howto and script to do the stuff automated:
> http://outpost.h3q.com/patches/manageBE/create-FreeBSD-ZFS-bootfs.txt
>
> But beware, it is meant to use with
> http://anonsvn.h3q.com/projects/freebsd-patches/wiki/manageBE
> afterwards. But the steps are the same.
>
>> Searching around I found this tutorial on how to set up a ZFS bootable
>> system, which is mostly straightforward:
>>
>> http://blogs.freebsdish.org/lulf/2008/12/16/setting-up-a-zfs-only-system/
>>
>> However it leaves a few questions open... How am I supposed to make a
>> zfs mirror out of it? Suppose I have ad4 and ad6, should I repeat the
>> exact same gpart-steps for both ad4 and ad6, and then make a zpool
>> create data mirror ad4p3 ad6p3?
>
> Exactly.
>
>> How about swap? I suppose it will be on
>> one of the disks?
>
> I keep swap in a seperate partition. You could either use two swap
> partition, each on one disk or use gmirror to mirror a single swap
> partition to be safe from disk crash.
>
>> And what if I start with one disk and add the second
>> one later with zpool attach?
>
> This will work. Just do the same gpart commands on the second disk and
> use zpool attach.
>
> greetings,
> philipp
>
> ___
> 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 boot on zfs mirror

2009-05-25 Thread Philipp Wuensche
Lorenzo Perone wrote:
> 
> Hello to all,
> 
> Having licked blood now, and read the news from Kip Macy about
> 
>> -  zfs boot for all types now works
> 
> 
> I was wondering if anyone has some updated tutorial on how to achieve a
> zfs-only bootable FreeBSD with a mirrored zpool. 

My own howto and script to do the stuff automated:
http://outpost.h3q.com/patches/manageBE/create-FreeBSD-ZFS-bootfs.txt

But beware, it is meant to use with
http://anonsvn.h3q.com/projects/freebsd-patches/wiki/manageBE
afterwards. But the steps are the same.

> Searching around I found this tutorial on how to set up a ZFS bootable
> system, which is mostly straightforward:
> 
> http://blogs.freebsdish.org/lulf/2008/12/16/setting-up-a-zfs-only-system/
> 
> However it leaves a few questions open... How am I supposed to make a
> zfs mirror out of it? Suppose I have ad4 and ad6, should I repeat the
> exact same gpart-steps for both ad4 and ad6, and then make a zpool
> create data mirror ad4p3 ad6p3? 

Exactly.

> How about swap? I suppose it will be on
> one of the disks?

I keep swap in a seperate partition. You could either use two swap
partition, each on one disk or use gmirror to mirror a single swap
partition to be safe from disk crash.

> And what if I start with one disk and add the second
> one later with zpool attach?

This will work. Just do the same gpart commands on the second disk and
use zpool attach.

greetings,
philipp

___
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"


ZFS boot on zfs mirror

2009-05-25 Thread Lorenzo Perone


Hello to all,

Having licked blood now, and read the news from Kip Macy about


-  zfs boot for all types now works



I was wondering if anyone has some updated tutorial on how to achieve  
a zfs-only bootable FreeBSD with a mirrored zpool. While gmirror is a  
very nice thing, and I suppose it would be relatively easy to build a  
pool on top of a gmirror, I'd much more like the idea of a zfs mirror  
with the checksumming and recovery features zfs has (although I  
remember a post by pjd somewhere telling that gmirror actually has  
this feature too, except for the auto recovery, so given the  
possibility to activate it, it still could be an option...).


Searching around I found this tutorial on how to set up a ZFS bootable  
system, which is mostly straightforward:


http://blogs.freebsdish.org/lulf/2008/12/16/setting-up-a-zfs-only-system/

However it leaves a few questions open... How am I supposed to make a  
zfs mirror out of it? Suppose I have ad4 and ad6, should I repeat the  
exact same gpart-steps for both ad4 and ad6, and then make a zpool  
create data mirror ad4p3 ad6p3? How about swap? I suppose it will be  
on one of the disks? And what if I start with one disk and add the  
second one later with zpool attach?


Any suggestion/links for this (also other strategies if recommended)  
would be very welcome, and I'll be happy to share the results when and  
if I succeed...


BTW, is there any limitation for i386 for the boot/root features? The  
machine which would be free for this experiment is i386 (p4 4Ghz, 4GB  
Ram)


Regards,

Lorenzo


___
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"