From owner-freebsd-current@freebsd.org Tue Sep 4 20:46:07 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 C39A5FFB512; Tue, 4 Sep 2018 20:46:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62AB180901; Tue, 4 Sep 2018 20:46:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f44.google.com with SMTP id h23-v6so6620215ita.5; Tue, 04 Sep 2018 13:46:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=UzeyLKnZo9N56ajtMvjP5A8BmYfJptEP9kxmENU0ajA=; b=bD3NvAPHo0dDVotaT+Epx/6sqnFwSjJg5xWDpWbqP/zih0HuYa97ZmSccFnterlABW GwC8goutPFENBfRPwn9gfie2HSvJMpW72OJ2GArpH5G0X7G4WCQhH422RriZqiT17MfZ ttjYYLhoAE2keg5RvPn9XO9uef2/JBG5byyxids97R7zvfJzM7sc9iE3HxrovF8ziEND KmhZBz14rpLVyS3oAG2TMuzkZFRHNJSmbBA3h9MYuKHW057jphEw2c8EwcIzr2ZgYIOS 63/eNWKLndhr0ZOcbPmPWFRPcDjeFTIZyyeA1RENEt8roBps2jcUd8wk8V+ijBVppH/r Pysg== X-Gm-Message-State: APzg51Ba1Nw7mrinp3UkIPAWyn3LDOVAeeXte1p7IzFw2u+x/vkw3FNP YUd7pYyf1QsbVShTNfPakonU3IAb X-Google-Smtp-Source: ANB0VdaIsCyEzY7Wo/aFxyfut9c6cFba1QbQ5dVW7ipzBy1zUSt4UArQ95aalmb1snLA24kIpBADfg== X-Received: by 2002:a24:17c7:: with SMTP id 190-v6mr8490839ith.99.1536093480490; Tue, 04 Sep 2018 13:38:00 -0700 (PDT) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by smtp.gmail.com with ESMTPSA id d65-v6sm9847857iof.46.2018.09.04.13.38.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Sep 2018 13:38:00 -0700 (PDT) Received: by mail-io0-f181.google.com with SMTP id v14-v6so4175094iob.4; Tue, 04 Sep 2018 13:38:00 -0700 (PDT) X-Received: by 2002:a6b:97c6:: with SMTP id z189-v6mr24320774iod.120.1536093480015; Tue, 04 Sep 2018 13:38:00 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:9542:0:0:0:0:0 with HTTP; Tue, 4 Sep 2018 13:37:59 -0700 (PDT) In-Reply-To: <609400979.20180904230820@serebryakov.spb.ru> References: <609400979.20180904230820@serebryakov.spb.ru> From: Conrad Meyer Date: Tue, 4 Sep 2018 13:37:59 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: newfs silently fails if random is not ready (?) To: lev@freebsd.org Cc: FreeBSD Current , freebsd-fs , Xin LI Content-Type: text/plain; charset="UTF-8" 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:46:08 -0000 Hi Lev, 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)? Is your program that runs newfs checking for non-zero exit status? Do you see any newfs cores when this happens? 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"