From owner-freebsd-current@freebsd.org Tue Sep 4 20:55:16 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 584A0FFBA6D; Tue, 4 Sep 2018 20:55:16 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.not-for.work (onlyone.not-for.work [148.251.9.81]) by mx1.freebsd.org (Postfix) with ESMTP id E8BE481000; Tue, 4 Sep 2018 20:55:15 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from lion.home.serebryakov.spb.ru (unknown [IPv6:2001:470:923f:1:88d0:b252:4399:906d]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.not-for.work (Postfix) with ESMTPSA id CD42ABCC; Tue, 4 Sep 2018 23:55:14 +0300 (MSK) Date: Tue, 4 Sep 2018 23:55:14 +0300 From: Lev Serebryakov Reply-To: Lev Serebryakov Organization: FreeBSD Message-ID: <1942661439.20180904235514@serebryakov.spb.ru> To: Conrad Meyer CC: FreeBSD Current , freebsd-fs , Xin LI Subject: Re: newfs silently fails if random is not ready (?) In-Reply-To: References: <609400979.20180904230820@serebryakov.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2018 20:55:16 -0000 Hello Conrad, Tuesday, September 4, 2018, 11:37:59 PM, you wrote: > Newfs just uses arc4random(3) to generate its FSID and generation > numbers. arc4random(3) is seeded from getentropy(3) -> getrandom(2) ->> read_random_uio(9), which is what produces the "random: > read_random_uio unblock wait" messages. > Is newfs tripping on a raise()/abort() in arc4random(3) / > getentropy(3)? Nope, it is silently does nothing > Is your program that runs newfs checking for non-zero > exit status? It is not "my" program, it is system mdmfs(8), and it checks exit statuses, as far as I can see from source code. > Do you see any newfs cores when this happens? It is very first step in diskless boot, so no cores are possible, but I don't see "core dumped" messages too. > Thanks, > Conrad > On Tue, Sep 4, 2018 at 1:08 PM, Lev Serebryakov wrote: >> Hello FreeBSD, >> >> I have problems with diskless install when kernel doesn't have tmpfs and >> random device takes long time to unlock. >> >> Looks like newfs used to create in-memory /etc (on /dev/md0) silently fail >> to create FS. >> >> I've added '-XL' options to mdmfs and it looks like this: >> >> da0: quirks=0x2 >> arc4random: no preloaded entropy cache >> arc4random: no preloaded entropy cache >> *** Figure out our NFS root path *** >> *** handle_remount /conf *** >> *** templates are base default *** >> *** handle_remount /conf/base/etc *** >> *** handle_remount /conf/base/var *** >> *** handle_remount /conf/default/etc *** >> *** handle_remount /conf/default/var *** >> *** create_md etc with size 20480 *** >> DEBUG: running: /sbin/mdconfig -a -t swap -s 10485760B >> DEBUG: running: /sbin/newfs -U /dev/md0 >> random: read_random_uio unblock wait >> random: read_random_uio unblock wait >> random: unblocking device. >> DEBUG: running: /sbin/mount /dev/md0 /etc >> mount: /dev/md0: No such file or directory >> mdmfs: mount exited with error code 1 >> >> "/dev/md0" is here, but it is empty, without any FS. >> >> I could run "/sbin/newfs -U /dev/md0" later by hands and it works. >> >> -- >> Best regards, >> Lev mailto:lev@FreeBSD.org >> >> _______________________________________________ >> freebsd-fs@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-fs >> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" -- Best regards, Lev mailto:lev@FreeBSD.org