From owner-freebsd-current@freebsd.org Sat Sep 29 17:34:34 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 46FD710A5E3B for ; Sat, 29 Sep 2018 17:34:34 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6F0D81769 for ; Sat, 29 Sep 2018 17:34:33 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from [80.187.81.74] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1g6J8K-0001iv-VI for freebsd-current@freebsd.org; Sat, 29 Sep 2018 19:34:25 +0200 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.15.2/8.14.9) with ESMTPS id w8THYORC002373 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 29 Sep 2018 19:34:24 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.15.2/8.14.9/Submit) id w8THYOCv002372 for freebsd-current@freebsd.org; Sat, 29 Sep 2018 19:34:24 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Sat, 29 Sep 2018 19:34:24 +0200 From: Matthias Apitz To: freebsd-current@freebsd.org Subject: mkimg(1) creates a file in TMPDIR until no space left Message-ID: <20180929173424.GA2270@c720-r314251> Reply-To: Matthias Apitz Mail-Followup-To: freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: FreeBSD 12.0-CURRENT r314251 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.8.0 (2017-02-23) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 80.187.81.74 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: Sat, 29 Sep 2018 17:34:34 -0000 Hello, I'm using a copy of src/release/amd64/make-memstick.sh to build from a complete root in /usr/local/r338641/root.r338641 (result of make installworld and installkernel to this dir) for testing purpose a memstick image and write this with dd(1) to an USB key of ~32 GByte. I'm using a copy of this script because I want to define the size of the UFS in the image to have there enough free space to install later after boot as well packages to test them. The modification is only setting '-M 50331648b -m 50331648b' for the file system created with mkfs(8). Here is what is running exactly: # TMPDIR=/usr/tmp export TMPDIR # ./make-memstick.sh /usr/local/r338641/root.r338641 /usr/local/r338641/memstick.im + makefs -B little -M 50331648b -m 50331648b -o 'label=FreeBSD_Install' -o 'version=2' /usr/local/r338641/memstick.im.part /usr/local/r338641/root.r338641 Calculated size of `/usr/local/r338641/memstick.im.part': 25769803776 bytes, 24530 inodes Extent size set to 32768 /usr/local/r338641/memstick.im.part: 24576.0MB (50331648 sectors) block size 32768, fragment size 4096 using 28 cylinder groups of 901.44MB, 28846 blks, 1024 inodes. super-block backups (for fsck -b #) at: 192, 1846336, 3692480, 5538624, 7384768, 9230912, 11077056, 12923200, 14769344, 16615488, 18461632, 20307776, 22153920, 24000064, 25846208, 27692352, 29538496, 31384640, 33230784, 35076928, 36923072, 38769216, 40615360, 42461504, 44307648, 46153792, 47999936, 49846080, Populating `/usr/local/r338641/memstick.im.part' Image `/usr/local/r338641/memstick.im.part' complete + rm /usr/local/r338641/root.r338641/etc/fstab + rm /usr/local/r338641/root.r338641/etc/rc.conf.local + mkimg -C 28G -s mbr -b /usr/local/r338641/root.r338641/boot/mbr -p 'efi:=/usr/local/r338641/root.r338641/boot/boot1.efifat' -p 'freebsd:-mkimg -C 28G -s bsd -b /usr/local/r338641/root.r338641/boot/boot -p freebsd-ufs:=/usr/local/r338641/memstick.im.part' -a 2 -o /usr/local/r338641/memstick.im ... While the cascade of mkimg(1) is running a *big* temp file is created, which at the end eats up all memory of the disk: # ls -lh /usr/local/r338641 /usr/tmp /usr/local/r338641: total 25172008 -rwxr-xr-x 1 root wheel 1.3K Sep 29 16:41 make-memstick.sh -rw-r--r-- 1 root wheel 0B Sep 29 16:50 memstick.im -rw-r--r-- 1 root wheel 24G Sep 29 16:50 memstick.im.part drwxr-xr-x 18 root wheel 512B Sep 24 07:11 root.r338641 /usr/tmp: total 11307168 -rw------- 1 root wheel 456G Sep 29 17:01 mkimg-LmntlL <<<******** 456G !!! -rw------- 1 root wheel 0B Sep 29 16:50 mkimg-yfU8Lr /: write failed, filesystem is full /: write failed, filesystem is full But the 'memstick.im' is created fine at the end: # ls -lh /usr/local/r338641 /usr/tmp /usr/local/r338641: total 2591752 -rwxr-xr-x 1 root wheel 1.3K Sep 29 16:41 make-memstick.sh -rw-r--r-- 1 root wheel 24G Sep 29 17:22 memstick.im drwxr-xr-x 18 root wheel 512B Sep 24 07:11 root.r338641 /usr/tmp: total 0 And the UBS stick produced from 'memstick.im' with dd(1) boots fine and the root file system has around 20 GB free space. Why it is mkimg(1) creating such a big temp. file? matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub