Date: Sun, 12 Jul 2015 22:03:29 +0530 From: Prasad Joshi <prasadjoshi.linux@gmail.com> To: soc-status@freebsd.org Cc: Xin LI <d@delphij.net> Subject: Re: [gsoc15] dynamically discover bes Message-ID: <CALJbWepoKqX4z6033oLKju%2BpE3sTnoEWZJUa1AWnfhLR_dNEvA@mail.gmail.com> In-Reply-To: <CALJbWerDVXCi0K4nv7%2BZNUbUQ=GmgOag9mbk0dBTU8nV3XaMBA@mail.gmail.com> References: <CALJbWeobZj9BqDoYW5Si9NWFFxd2q=w1EsBPVOxcNML-vZF3aQ@mail.gmail.com> <CALJbWerHWL8=P-hJ57V8SfZTyJ5uV9g-=a2x%2B3epGLuit0vn3w@mail.gmail.com> <CALJbWert-6-0fa6_%2BdK0N8zcU053GyRSQ8hRoQ5DGfBxeGGu4g@mail.gmail.com> <CALJbWerDVXCi0K4nv7%2BZNUbUQ=GmgOag9mbk0dBTU8nV3XaMBA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Status report for past two weeks ========================= - Last two weeks I struggled to get non-active BE to boot completely - after zfs mount -a all files in /dev/ used to disappear. Finally disabling canmount property on each dataset helped me boot non-active BEs. - I added code to pass mountpoint information from gptzfsboot to zfsloader, then from zfsloader I could set vfs.root.mountfrom env variable. - Added code to find timestamp of each BE clone, with this change BEs could now be sorted on either timestamp, BE name, or object number Tasks For coming week ================== 1. start the initial implementation of menu functionality. On Tue, Jun 30, 2015 at 7:26 PM, Prasad Joshi <prasadjoshi.linux@gmail.com> wrote: > Week 5 Update > > - I did not work on GSoC for 3 days in this week. Had to attend full > day sessions in the University. > - Last week I was faced with a problem with booting alternate > (non-active) BE. Plan in this week was to locate the problem. It seems > like, during bootup zfsloader needs to initialize libzfs library. The > libzfs library initialization fails because '/dev/zfs' cannot be > opened. I verified the zfs kernel modules, which create the device are > loaded. I think, and as suggested by mentor, I will have to set > vfs.root.mountfrom environment variable during bootup. > > Thanks and Regards, > Prasad > > On Mon, Jun 22, 2015 at 11:42 PM, Prasad Joshi > <prasadjoshi.linux@gmail.com> wrote: >> Week 4 update >> >> - I have been able to discover BEs on console. I could detect active BE. >> Created list of BEs. Code to sort BEs on object number, name, or timestamp >> is added. >> >> - I am able to boot from nonactive BE to some extent. At the moment, code >> requires me to enter BE number to boot from. >> >> Tasks next week >> 1. Identify a problem with be bootup. >> 2. Pass mount point info through env variable to loader. >> 3. Start with console based menu. >> >> Thanks and Regards, >> Prasad >> >> On Jun 15, 2015 7:48 PM, "Prasad Joshi" <prasadjoshi.linux@gmail.com> wrote: >>> >>> Week 3 status >>> ========== >>> After understanding on disk representation of snapshots and clones, I >>> have been able to find names of the BEs created using beadm command. I >>> could print the BE names on console. >>> >>> The next task would be to convert BE names to object numbers, create >>> list of BEs. >>> >>> Thanks and Regards, >>> Prasad >>> >>> On Tue, Jun 9, 2015 at 6:36 AM, Prasad Joshi >>> <prasadjoshi.linux@gmail.com> wrote: >>> > Last week I mostly worked on understanding beadm and gptzfsboot code >>> > >>> > beadm create prepares new BE by creating a snapshot and clone of that >>> > snapshot. beadm activate command sets bootfs property of the POOL. >>> > bootfs property contains object number of active dataset object. >>> > During bootup gptzfsboot probes all the disks, creating SPA for any >>> > valid pool. gptzfsboot assumes the first pool it finds as a primary >>> > pool, it then reads meta object set, then tries to find object nunber >>> > of active dataset object either through >>> > a. bootfs - it would be set if BE was already created >>> > b. mos->properties_zap->root_dataset->dd_head_dataset_obj (through >>> > root_datasets bonus buffer) >>> > Once the object number is obtaind gptzfsboot mounts the dataset. >>> > >>> > After mounting, few files are looked up like /boot/config or >>> > /boot.config for presense of boot command (did not went into details >>> > of this). Then (if keyboard is not hit), gptzfsboot execs >>> > /boot/zfsloader. If gptzfsboot is interrupted by keyboard, then it >>> > displays default BE or POOL it is trying to boot from (using >>> > zfs_rlookup() to map active dataset object to string BE name). Though >>> > I haven't checked this but through serial console user would be >>> > allowed to enter other pool or BE to boot from. >>> > >>> > I could not go into details of how gptzfsboot reads /boot/zfsloader from >>> > disk. >>> > >>> > Pending Tasks >>> > ============= >>> > 1. Understand upon keyboard interruption, how user entered zfs paths >>> > (format [zfs:pool/filesystem:][/path/to/loader]) are converted in >>> > object numbers? >>> > 2. Learn ZFS on disk format in more details so as to identify active >>> > dataset object numbers of all BEs. Once the object numbers are >>> > available, I can use zfs_rlookup() function to map object number to >>> > printable pool name. >>> > 3. Prepare library for console based menu. >>> > >>> > Plan for next week >>> > ================== >>> > Pending task 2 above
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALJbWepoKqX4z6033oLKju%2BpE3sTnoEWZJUa1AWnfhLR_dNEvA>