From owner-freebsd-questions@freebsd.org Wed Sep 28 16:58:56 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8EF8C01E91 for ; Wed, 28 Sep 2016 16:58:56 +0000 (UTC) (envelope-from citrin+bsd@citrin.ru) Received: from hz.citrin.ru (hz.citrin.ru [IPv6:2a01:4f8:d16:10c3::2]) (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 907871121 for ; Wed, 28 Sep 2016 16:58:56 +0000 (UTC) (envelope-from citrin+bsd@citrin.ru) Received: from [192.168.0.144] (c-24-60-168-172.hsd1.ct.comcast.net [24.60.168.172]) (Authenticated sender: citrin@citrin.ru) by hz.citrin.ru (Postfix) with ESMTPSA id 7609B2869D2 for ; Wed, 28 Sep 2016 16:58:53 +0000 (UTC) Subject: Re: FreeBSD-10.3-RELEASE-i386-memstick.img installer changes contents of USB flash drive? To: "freebsd-questions@freebsd.org" References: <56532342-f2d4-377d-605b-2e1b5bfb2160@holgerdanske.com> From: Anton Yuzhaninov Message-ID: <028307a7-0771-6429-d72f-f85f9530f55d@citrin.ru> Date: Wed, 28 Sep 2016 12:58:43 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <56532342-f2d4-377d-605b-2e1b5bfb2160@holgerdanske.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrin.ru; s=s0; t=1475081933; bh=8b7x/ydeRfTOmYW/WhhdjJ92Ahkcrq6FOObk7mQg+kQ=; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=vHIVjpsRrHmBP3Qb9mbEJ+xmr8BnedObT1sazf4HroFh5S5Ipuo/W67aop4KE6yHJw/5DXK2mF/jPZyc+o0X4wcUIPssg8xBgqXw+/Z7DtT9HmNkA6ggKPmT5Ca4RBUhlfFttPNMeuMk12rDwrBtWyPFWe/weVlD2ADnLHFElRc= X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2016 16:58:56 -0000 On 2016-09-25 23:36, David Christensen wrote: > # time dd if=/dev/sdc count=1350917 | sha256sum -b > ab104a30627754bb8d39eeff3c5c5a4a15537d32c749e2b9841b34cb08e17eb0 *- ... > But after using the USB flash drive to install FreeBSD, the checksum has > changed: > > # dd if=/dev/sdc count=1350917 | sha256sum -b > bd159b85486322febe992226bbec9c86d96d70dd1e5a8b7c6f0bb9d29eb50df3 *- > 691669504 bytes (692 MB) copied, 42.989 s, 16.1 MB/s > > Therefore, the FreeBSD-10.3-RELEASE-i386-memstick.img installer has > changed the contents of the USB flash drive. AFIK UFS superblock is updated every time filesystem is mounted, even if FS is mounted in read-only mode (please correct me if I wrong). In struct for superblock I see: struct fs { ... u_char fs_fsmnt[MAXMNTLEN]; /* name mounted on */ ... ufs_time_t fs_mtime; /* Last mount or fsck time. */ ... } If you can mount this USB flash in FreeBSD before and after install you can use mtree to check that files was not changed: $ mtree -c -K sha256 -p /mnt/usb-flash > /tmp/mtree1 use USB flash to install FreeBSD $ mtree -c -K sha256 -p /mnt/usb-flash > /tmp/mtree2 $ diff -u /tmp/mtree[12] Only commented lines in mtree header should differ. And see if files was changed.