From owner-freebsd-stable@freebsd.org Tue Dec 1 04:45:11 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48ADE46BB2B for ; Tue, 1 Dec 2020 04:45:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ClTzp18Yxz3lYl for ; Tue, 1 Dec 2020 04:45:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf33.google.com with SMTP id y11so258959qvu.10 for ; Mon, 30 Nov 2020 20:45:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EF9/iTdoLIfNkQk//ClR/CaaiYSaEf4KopoqyPVBPhw=; b=qNCGYujVQZtvme6SgtHPfTkHXw+hFykZ0bl933kTIZe/53WmAGAwQIHKuIhJOkNLyg HkhOCzxIdHb8ImhYyllQ0Dfk2Pk9wepE8l/S+QupcXl15nCA37tFuuIwYL22VUda0Pgc pKdGKiu0WpjuutQuZsRcK3/WQKeJ1z/KkokrEfTaKRIoQVrnhNJB/fSIn1m8dbmzBMBd 83BlNxkIWtnhXeoKAxbS97FM8OyTfb0kBCHvg3NeTI+hQGTkvd5sSEDWgKUhunOv83L9 /1FOGy8WSCOFvKIKcrsZpnWHRCiBWLlppVWgOkfIVtXTmlLeOnnSBp3/j+KQ4DJoTS2t uDLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EF9/iTdoLIfNkQk//ClR/CaaiYSaEf4KopoqyPVBPhw=; b=WruG7FbGbA+p53971Fy0EgV6lYvZBqsGCB7Y6CYWEJQq4VVwOj7vZ0L0ftFrH5LYcu wRVuyqsy4a8k3UtfnjPqw4Fxlc4NJxVXcR5upkvdb/cuG/GfZT6NZYBqOn30/UV9if5A H3l4+jUgbeP7YDApGn1/ydcG97GSK4FQIKn7qIUaOr1KaV6Zp7QnKoa1tWnXB3o3XTM3 MpB13zr0cghFZDGN+gJRjH4I8QTcQSVQ4brSZBgPGZfZkt/pE5phrzLGA3i3Fw23dq0M Yj/v/F9RamJxzTJx+ALSnGAFNG/HKDVRaRe3YhHlFfMNmDdPJmIZm98MVY9rtm9ITq4W IxEQ== X-Gm-Message-State: AOAM532+5cJrj1K1Wwta8YqptnGVQyhJHn2fpiEeigqgxANHiR/0LAs9 RE3QDUdJ3evdrxSmYPRavTv/QQa63elCTRbyQs8lqx2CocA63A== X-Google-Smtp-Source: ABdhPJx/IfE+hTmEeAp+0OUDOLSyQDzE01WpsBZnbk8W0pjqBw0ChF//t8ODqMIyYZP48TEvhx9JNUQZVsPK5J/U/YY= X-Received: by 2002:ad4:4e13:: with SMTP id dl19mr1291528qvb.24.1606797908849; Mon, 30 Nov 2020 20:45:08 -0800 (PST) MIME-Version: 1.0 References: <20201201.093330.2020884495412351031.yasu@utahime.org> In-Reply-To: <20201201.093330.2020884495412351031.yasu@utahime.org> From: Warner Losh Date: Mon, 30 Nov 2020 21:44:58 -0700 Message-ID: Subject: Re: Size of EFI system partition is much smaller when it is mounted To: Yasuhiro KIMURA Cc: FreeBSD-STABLE Mailing List X-Rspamd-Queue-Id: 4ClTzp18Yxz3lYl X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=qNCGYujV; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f33) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::f33:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f33:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::f33:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[freebsd-stable]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2020 04:45:11 -0000 On Mon, Nov 30, 2020 at 5:35 PM Yasuhiro KIMURA wrote: > I made clean install of 11.4-RELEASE amd64 with ZFS root and UEFI boot > mode. 'Auto (ZFS)' was used at disk setup phase and disk was > partitioned as following. > > ---------------------------------------------------------------------- > root@rolling-vm-freebsd3[80]# uname -a > FreeBSD rolling-vm-freebsd3.home.utahime.org 11.4-RELEASE-p3 FreeBSD > 11.4-RELEASE-p3 #0: Tue Sep 1 08:22:33 UTC 2020 > root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 > root@rolling-vm-freebsd3[81]# gpart show ada0 > => 40 209715120 ada0 GPT (100G) > 40 409600 1 efi (200M) > 409640 2008 - free - (1.0M) > 411648 16777216 2 freebsd-swap (8.0G) > 17188864 192524288 3 freebsd-zfs (92G) > 209713152 2008 - free - (1.0M) > ---------------------------------------------------------------------- > > According to it the size of EFI system partition is 200MB. But if I > mount it to filesystem and check its size with df(1), then it is much > smaller than 200MB. > > ---------------------------------------------------------------------- > root@rolling-vm-freebsd3[82]# mount -t msdosfs /dev/ada0p1 /mnt > root@rolling-vm-freebsd3[83]# df -k /mnt > Filesystem 1024-blocks Used Avail Capacity Mounted on > /dev/ada0p1 779 384 395 49% /mnt > ---------------------------------------------------------------------- > > And if I try to copy large file to /mnt then it fails. > > ---------------------------------------------------------------------- > root@rolling-vm-freebsd3[94]# ls -l dummy.1MB.date > -rw-r--r-- 1 root wheel 1048576 Nov 29 10:39 dummy.1MB.date > root@rolling-vm-freebsd3[95]# cp dummy.1MB.date /mnt > cp: /mnt/dummy.1MB.date: No space left on device > ---------------------------------------------------------------------- > > So it seems kernel(?) really regards the size of mounted EFI system > part as only 779KB. > > I also tried it with 12.2-RELEASE and df(1) reported correctly. > > ---------------------------------------------------------------------- > root@eastasia[1002]# uname -a > FreeBSD eastasia.home.utahime.org 12.2-RELEASE FreeBSD 12.2-RELEASE > r366954 GENERIC amd64 > root@eastasia[1003]# gpart show ada0 > => 40 1953525088 ada0 GPT (932G) > 40 409600 1 efi (200M) > 409640 2008 - free - (1.0M) > 411648 16777216 2 freebsd-swap (8.0G) > 17188864 1936334848 3 freebsd-zfs (923G) > 1953523712 1416 - free - (708K) > > root@eastasia[1004]# mount -t msdosfs /dev/ada0p1 /mnt > root@eastasia[1005]# df -k /mnt > Filesystem 1024-blocks Used Avail Capacity Mounted on > /dev/ada0p1 204696 976 203720 0% /mnt > ---------------------------------------------------------------------- > > Is there any bug fix about it that is merged to 12.x but not 11.x? > 11.x puts a pre-canned image into the ESP that's tiny, regardless of the size, while 12.x does a newfs_msdos and sizes it properly. It's kinda hard to fix in 11.x since there's a number of changes in a number of places. You can, though, on 11.x, newfs_msdos the filesystem and copy boot1.efi from FreeBSD's /boot to the ESP's \efi\boot\bootx64.efi if you need more space on the ESP for some reason. Warner