Date: Fri, 29 Nov 2024 15:46:29 +0100 (CET) From: Ronald Klop <ronald-lists@klop.ws> To: Dennis Clarke <dclarke@blastwave.org> Cc: Alan Somers <asomers@freebsd.org>, Current FreeBSD <freebsd-current@freebsd.org> Subject: Re: zpools no longer exist after boot Message-ID: <1565006767.9193.1732891589527@localhost> In-Reply-To: <54808a60-a25c-4a26-915f-1ca69387db2a@blastwave.org> References: <5798b0db-bc73-476a-908a-dd1f071bfe43@blastwave.org> <CAOtMX2hKCYrx92SBLQOtekKiBWMgBy_n93ZGQ_NVLq=6puRhOg@mail.gmail.com> <22187e59-b6e9-4f2e-ba9b-f43944d1a37b@blastwave.org> <CAOtMX2gdGWRfOa%2Bm9FctMNCVwDQ9GUE=vhxaEY_gorDFOU0fHg@mail.gmail.com> <722a3644-3af6-4ff9-b1ee-022c32872001@blastwave.org> <CAOtMX2i1dFXdyTXK-18cs48uJi2u6LwTDDz8kMPdpEXQbzg7dA@mail.gmail.com> <54808a60-a25c-4a26-915f-1ca69387db2a@blastwave.org>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_9192_1958593303.1732891589524 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Van: Dennis Clarke <dclarke@blastwave.org> Datum: vrijdag, 29 november 2024 01:55 Aan: Alan Somers <asomers@freebsd.org> CC: Current FreeBSD <freebsd-current@freebsd.org> Onderwerp: Re: zpools no longer exist after boot > > On 11/28/24 10:55, Alan Somers wrote: > > On Thu, Nov 28, 2024, 9:47AM Dennis Clarke <dclarke@blastwave.org> wrote: > > > >> On 11/28/24 09:52, Alan Somers wrote: > >>> On Thu, Nov 28, 2024, 8:45AM Dennis Clarke <dclarke@blastwave.org> > >> wrote: > >>> > >> ... > >>> > >>> For "zpool import", the "-c" argument instructs zfs which cachefile to > >>> search for importable pools. "-O", on the other hand, specifies how the > >>> cachefile property should be set after the pool is imported. > >>> > >> > >> I have to wonder what value there is in NOT having the cachefile > >> property set in a zpool ? Certainly given that the zpool RC script > >> really wants to check in a few places and then use those cache files. > >> > >> -- > >> -- > >> Dennis Clarke > >> RISC-V/SPARC/PPC/ARM/CISC > >> UNIX and Linux spoken > >> > > > > Usually the default value for cachefile is sufficient. In fact, the only > > time I've ever needed to set cachefile has been when I DON'T want the pool > > to import at boot. I wonder if there was some other reason, since resolved, > > why your pools didn't import the first time. And subsequently they didn't > > import because you set the cachefile to a non default value? > > > > I am at a loss. Really. > > Getting the iSCSI stuff working was a real treat and this just makes > things even more strange. I really do not know. > > > > > -- > -- > Dennis Clarke > RISC-V/SPARC/PPC/ARM/CISC > UNIX and Linux spoken > > > > > Hi, I hope I can clarify a bit for you. See 'man zpoolprops' and search for: cachefile=path|none. The property 'cachefile' is not stored on disk. It is only used at the moment of import or creation of a pool to tell the 'zpool import' command (or kernel) where to store the information about imported zpools. So as the property is not stored on disk, after a reboot the zpool property 'cachefile' is always empty. It is more like a pseudo-property. Maybe it would be more clear if it had its own command line option in zpool import. If you don't pass the zpool cachefile property to zpool import it will default to /etc/zfs/zpool.cache. What happend on boot: 1. the boot loader looks at the boot-disk what pool to start from. This does not use any cachefile, it just looks at the disk blocks (because the cachefile is not available yet, as the FS is not mounted yet). 2. the init process /etc/rc.d/zpool looks in /etc/zfs/zpool.cache for extra pools to import. (as shown in a previous mail) 3. the init process /etc/rc.d/zfs mounts the zfs filesystems. There is not much more to it for local disks. As you are using iscsi also, I think you have a little bit more configuration as the iscsi device appears after /etc/rc.d/zpool & /etc/rc.d/zfs is up and running. I will answer on the iscsi part in another email. NB: I also have systems with multiple pools. I have never changed the cachefile property. If this doesn't clarify the process to you, would you be able to tell more about what you mean with 'I am at a loss'? Regards, Ronald. PS: I might have some details wrong here, other might be more knowledgeable about this, but I think this is the bigger picture. ------=_Part_9192_1958593303.1732891589524 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <html><head></head><body><br> <p><strong>Van:</strong> Dennis Clarke <dclarke@blastwave.org><br> <strong>Datum:</strong> vrijdag, 29 november 2024 01:55<br> <strong>Aan:</strong> Alan Somers <asomers@freebsd.org><br> <strong>CC:</strong> Current FreeBSD <freebsd-current@freebsd.org><br> <strong>Onderwerp:</strong> Re: zpools no longer exist after boot</p> <blockquote style="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left: #000000 2px solid; margin-right: 0px"> <div class="MessageRFC822Viewer" id="P"> <div class="TextPlainViewer" id="P.P">On 11/28/24 10:55, Alan Somers wrote:<br> > On Thu, Nov 28, 2024, 9:47AM Dennis Clarke <dclarke@blastwave.org> wrote:<br> ><br> >> On 11/28/24 09:52, Alan Somers wrote:<br> >>> On Thu, Nov 28, 2024, 8:45AM Dennis Clarke <dclarke@blastwave.org><br> >> wrote:<br> >>><br> >> ...<br> >>><br> >>> For "zpool import", the "-c" argument instructs zfs which cachefile to<br> >>> search for importable pools. "-O", on the other hand, specifies how the<br> >>> cachefile property should be set after the pool is imported.<br> >>><br> >><br> >> I have to wonder what value there is in NOT having the cachefile<br> >> property set in a zpool ? Certainly given that the zpool RC script<br> >> really wants to check in a few places and then use those cache files.<br> >><br> >> --<br> >> --<br> >> Dennis Clarke<br> >> RISC-V/SPARC/PPC/ARM/CISC<br> >> UNIX and Linux spoken<br> >><br> ><br> > Usually the default value for cachefile is sufficient. In fact, the only<br> > time I've ever needed to set cachefile has been when I DON'T want the pool<br> > to import at boot. I wonder if there was some other reason, since resolved,<br> > why your pools didn't import the first time. And subsequently they didn't<br> > import because you set the cachefile to a non default value?<br> ><br> <br> I am at a loss. Really.<br> <br> Getting the iSCSI stuff working was a real treat and this just makes<br> things even more strange. I really do not know.<br> <br> <br> <br> <br> -- <br> --<br> Dennis Clarke<br> RISC-V/SPARC/PPC/ARM/CISC<br> UNIX and Linux spoken<br> <br> </div> <hr></div> </blockquote> <br> <br> Hi,<br> <br> I hope I can clarify a bit for you.<br> <br> See 'man zpoolprops' and search for: cachefile=path|none.<br> <br> The property 'cachefile' is not stored on disk. It is only used at the moment of import or creation of a pool to tell the 'zpool import' command (or kernel) where to store the information about imported zpools.<br> So as the property is not stored on disk, after a reboot the zpool property 'cachefile' is always empty. It is more like a pseudo-property. Maybe it would be more clear if it had its own command line option in zpool import.<br> If you don't pass the zpool cachefile property to zpool import it will default to /etc/zfs/zpool.cache.<br> <br> What happend on boot:<br> 1. the boot loader looks at the boot-disk what pool to start from. This does not use any cachefile, it just looks at the disk blocks (because the cachefile is not available yet, as the FS is not mounted yet).<br> 2. the init process /etc/rc.d/zpool looks in /etc/zfs/zpool.cache for extra pools to import. (as shown in a previous mail)<br> 3. the init process /etc/rc.d/zfs mounts the zfs filesystems.<br> <br> There is not much more to it for local disks. As you are using iscsi also, I think you have a little bit more configuration as the iscsi device appears after /etc/rc.d/zpool & /etc/rc.d/zfs is up and running. I will answer on the iscsi part in another email.<br> <br> NB: I also have systems with multiple pools. I have never changed the cachefile property.<br> <br> If this doesn't clarify the process to you, would you be able to tell more about what you mean with 'I am at a loss'?<br> <br> Regards,<br> Ronald.<br> <br> PS: I might have some details wrong here, other might be more knowledgeable about this, but I think this is the bigger picture.</body></html> ------=_Part_9192_1958593303.1732891589524--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1565006767.9193.1732891589527>