From owner-freebsd-hackers@freebsd.org Mon Aug 26 01:32:33 2019 Return-Path: Delivered-To: freebsd-hackers@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 33975CB4F7 for ; Mon, 26 Aug 2019 01:32:33 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 46GvdD2Xxjz3Ddt for ; Mon, 26 Aug 2019 01:32:32 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id t16so13675851wra.6 for ; Sun, 25 Aug 2019 18:32:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yg5Ae5dD9OYQfPzLJexXhmsfWaF6CqY2r5UOKPETho0=; b=Hzzdx2em0da06CqUftSjVFcQBFZYY3BhYKh3oYvO0VYXWgE7LRly3u7SBk5ZCAkxvb XP+T5As3m4YNcBbJTHWJXBBDyV6hHUe58iNTNNNLrp3KyRdukZMwcFPScDfpFJD9VoJ6 Zn23Th4KBHW6a61L7BXa3o7ANSqqlwx+zCokWLPd2VvWNPo0/duRtDj+RUt8a1cfasCm kxxjGCxIqs6jl5RcDrDVmyRCf/Puml0LmS0L7F3ni5baBSeGlYlwy053LRtkhxAOE4FO gm0bT3w2POz8rCTvjMoJLl6/yc1XkNITsY8507mXS2UcfuPg/lYHv9m38Pfl8lMJvTkR 6W3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yg5Ae5dD9OYQfPzLJexXhmsfWaF6CqY2r5UOKPETho0=; b=OHhDa44Rec3Lb6TBfW2YZe52o2MRlbXmqQgZHYHJR+4mRTQ11I5KWcUwKgwZcRwGr7 iAW0ycVvgt1SZlc1uCI8eNWsoeBLYJRMGx08aHUYzo6ZEm87Db4qietQEt3ucoLLiTXo Mg6zh6DEYhlOhX/VRjVbQxIQSNusEnLrXk2l9G8/aZOtmCrkgxekkDmydMRPJf19zDZ3 eHLAZF2SraRA1pyqH40njLphCAd6grE5jxorW1ZymU+Gq1drCFm2ExME0dAnlzxn9FcI 1Lg+hqu62Aza1RAaOhuUzvtfUnOJhFGHPH2rkGS+H2YCPyt7d1o5pMqMD4T6QgBkkybS Gctw== X-Gm-Message-State: APjAAAX80XiqdlPK1AEKMLfZPzxfp9SJDKm2Z3eg04u1Z3twVcbup8+2 6wKhAYw88aHpiEYhDbFm6q+mXY0g X-Google-Smtp-Source: APXvYqzDOsr9YHRCHRErsxZ29TKSPnEQz8p/apvc1WrAQfbDCvzYXJKbECaAtcxDUE8FxR9Sa+0dGA== X-Received: by 2002:adf:fe08:: with SMTP id n8mr18344497wrr.60.1566783150395; Sun, 25 Aug 2019 18:32:30 -0700 (PDT) Received: from localhost ([188.252.244.188]) by smtp.gmail.com with ESMTPSA id c8sm11103886wrn.50.2019.08.25.18.32.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Aug 2019 18:32:30 -0700 (PDT) Date: Mon, 26 Aug 2019 03:31:17 +0200 From: Domagoj =?UTF-8?Q?Smol=C4=8Di=C4=87?= To: freebsd-hackers@freebsd.org Cc: Jean-Pierre =?UTF-8?Q?Andr=C3=A9?= , freebsd@dussan.org, ntfs-3g-devel@lists.sf.net Subject: Re: mkntfs doesn't install NTFS's bootcode during formatting Message-ID: <20190826033117.000003dc@gmail.com> In-Reply-To: <20190712144429.00000776@gmail.com> References: <20190710192048.00001ca2@gmail.com> <20190712144429.00000776@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 46GvdD2Xxjz3Ddt X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Hzzdx2em; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rank1seeker@gmail.com designates 2a00:1450:4864:20::442 as permitted sender) smtp.mailfrom=rank1seeker@gmail.com X-Spamd-Result: default: False [-3.98 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; RECEIVED_SPAMHAUS_PBL(0.00)[188.244.252.188.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (2.67), ipnet: 2a00:1450::/32(-3.00), asn: 15169(-2.33), country: US(-0.05)]; FREEMAIL_CC(0.00)[wanadoo.fr]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2019 01:32:33 -0000 On Fri, 12 Jul 2019 14:44:29 +0200 Domagoj Smol=C4=8Di=C4=87 wrote: > On Thu, 11 Jul 2019 12:11:32 +0200 > Jean-Pierre Andr=C3=A9 wrote: >=20 > > Domagoj Smol=C4=8Di=C4=87 wrote: =20 > > > FreeBSD 11.2-RELEASE-p9 > > > fusefs-ntfs-2017.3.23 > > > > > > When slice/partition is being formatted, bootcode('; =20 > > containsMicrosoft Windows XP/VISTA bootloader BOOTMGR') isn't > > applied, thus rendering it unbootable. =20 > > > Under Win, after 'bootsect /nt60 ...' has been used on NTFS > > > created =20 > > with mkntfs, THEN it becomes bootable. =20 >=20 > > This BOOTMGR bootcode is proprietary, and it depends on the > > targeted Windows version, hence mkntfs cannot insert it. > > However mkntfs creates the boot sector of the partition, which > > is part of the ntfs file system structure. =20 >=20 > I believe you talk about volume boot record (VBR) being installed. > Yes, but it doesn't install it's part: volume boot code(VBC) whic > targets BOOTMGR(stage 2) >=20 > > Nevertheless can you explain in what circumstances this would > > be useful. On several occasions, I have formatted an ntfs > > partition before installing Window 7 or Windows 10, and these > > installers insert the boot code they want without formatting > > the partition. I do not have XP or Vista any more, but I > > would be very surprised if they do not insert their own boot > > code as well (possibly while reformatting the partition). =20 >=20 > Installers are out of scope here. > Goal is to start installer itself, residing on NTFS > I'm talking about lowest level of boot procedure, JUST after BIOS > "hits" NTFS. >=20 > > > > > > When slice/partition is being formatted directly under Win, > > > bootcode =20 > > IS also being applied. =20 >=20 > > No, this is not done while formatting. The Windows formatting > > is limited, and the full formatting occurs when the partition > > is mounted the first time. So, when upgrading Windows, you can > > format with the old version before installing the new one. =20 >=20 > You are wrong. I've tested it's presence with hex. > After mkntfs, I copy files(install procedure for Win7) and device > won't boot. It does after after 'bootsect /nt60 ...' is executed > under Win7. (anoying part) >=20 > If I do ONLY formating under Win7, then plug it back into FreeBSD, > copy mentioned files and boot decvice, Win7 installation starts. >=20 > > > So, if you need a bootable NTFS, why to bother in a first place > > > with =20 > > mkntfs, then transferring device to Win machine and using command > > line under Win to run 'bootsect' tool, when you can simply click > > 'Format...' & Start?!? > > Can you explain what you want to boot into ? > >=20 > > Jean-Pierre =20 >=20 >=20 > I want to use ONLY FreeBSD to create custom bootable Win7 install > media. Only obstacle left is NTFS's stage 1 bootcode =3D> VBC. >=20 > I believe I've located it's position and size in slice (7k or 8k, > can't remember) So I'll attempt to extract it with dd tool and later > apply it just after mkntfs. But then again, I believe (searching at a > first glance) that this functionality exited and was removed because > of a "proprietary issues". So versions older than > ntfs-3g-2016.2.22-2, should be used. I believe it was about > "ntfsprogs/boot.c". Can anyone confirm this? >=20 > How about updating FreeBSD's license by keeping it BSD, but adding > EXCEPTIONS for Microsoft and other big corporations with same > "proprietary issues". In life, it is important to be equal in justice > to each other. If they claim it's ok and normal, just do the same to > them. If they complain ... everything is clear. ;) >=20 >=20 > Domagoj Smol=C4=8Di=C4=87 So ... I wondered why changelog doesn't have to say anything about "feature" removal, or to better say a degradation? https://www.tuxera.com/community/release-history/ Official note on 'STABLE Version 2016.2.22 (March 21, 2016)' is the last on= e listing 'Changes to mkntfs' and it says NOTHING about functionality removal. What is even worse, man pages are left to be misleading and here I mean on = mkntfs's flags: -p, -S & -H, which all and mkntfs itslef warns that NTFS won't be bootabl= e, if not, or improperly set! I've lost too much time "hanging" here, thinking that I'm blind and don't s= ee obvious! Somwhere "else", Jean-Pierre has pointed out that UNdocumented change has b= een done to boot.c file. And to use v2016.2.22 or below in order to be able to create bootable NTFS = with mkntfs. No one is going to convince me, that this uninforming act is simply acciden= tal! This is sneaky and subtle manipulation and reasons should be pretty much cl= ear to everyone. Well ..., let's take it into community's advantage ... =46rom legal point of view, if something isn't stated, it doesn't exist and d= oesn't apply, therefore, can't provoke any legal act. So ..., let's make NTFS-3G into accordance with it's official and currently= effective release history AND man pages! # cd /usr/ports/sysutils/fusefs-ntfs # make config Maintainer should add here another option to chose from, named: FETCH DA PATCH Hell it even rhymes! :D And it would do: # make extract # fetch -qo - 'https://download.tuxera.com/opensource/ntfs-3g_ntfsprogs-201= 6.2.22.tgz' | tar -xf - -q --include=3Dntfs-3g_ntfsprogs-2016.2.22/ntfsprog= s/boot.c --strip-components 2 -C work/ntfs-3g_ntfsprogs-2017.3.23/ntfsprogs # make install clean TEST: Created 2 NTFSs with mkntfs, with only -p flag specified (-S & -H wer= en't necessary). First on partition to boot win7's setup and second on partition of win7's f= resh installation. They BOTH booted! Voila! Resulting installation (functionality in accordance with official docs and = mans): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Origin: sysutils/fusefs-ntfs Name: fusefs-ntfs-2017.3.23 Mount NTFS partitions (read/write) and disk images Architecture: FreeBSD:11:i386 Maintainer's email: freebsd@dussan.org Home page: https://www.tuxera.com/community/open-source-ntfs-3g/ Installed at: 24-08(August)-2019 17h:11m:30s (UTC) License(s): GPLv2+ On install: NTFS-3G has been installed, for information, known issues and how to report bugs see the FreeBSD README: /usr/local/share/doc/ntfs-3g/README.FreeBSD Also see the official README (but has some Linux specific parts). Listing fusefs-ntfs-2017.3.23's installed files: Licence's dir: /usr/local/share/licenses/fusefs-ntfs-2017.3.23/ Shared objects: /usr/local/lib/libntfs-3g.so /usr/local/lib/libntfs-3g.so.88 /usr/local/lib/libntfs-3g.so.88.0.0 (s)bin: /usr/local/bin/lowntfs-3g /usr/local/bin/ntfs-3g /usr/local/bin/ntfs-3g.probe /usr/local/bin/ntfscat /usr/local/bin/ntfscluster /usr/local/bin/ntfscmp /usr/local/bin/ntfsfix /usr/local/bin/ntfsinfo /usr/local/bin/ntfsls /usr/local/sbin/mkntfs /usr/local/sbin/ntfsclone /usr/local/sbin/ntfscp /usr/local/sbin/ntfslabel /usr/local/sbin/ntfsrecover /usr/local/sbin/ntfsresize /usr/local/sbin/ntfsundelete man: (Section 3 excluded) # man 8 mkntfs # man 8 ntfs-3g # man 8 ntfs-3g.probe # man 8 ntfscat # man 8 ntfsclone # man 8 ntfscluster # man 8 ntfscmp # man 8 ntfscp # man 8 ntfsdecrypt # man 8 ntfsfallocate # man 8 ntfsfix # man 8 ntfsinfo # man 8 ntfslabel # man 8 ntfsls # man 8 ntfsprogs # man 8 ntfsrecover # man 8 ntfsresize # man 8 ntfssecaudit # man 8 ntfstruncate # man 8 ntfsundelete # man 8 ntfsusermap # man 8 ntfswipe Space consumption: 1.58MiB The ntfs-3g driver is an open source, freely available read/write NTFS driver, which provides safe and fast handling of the Windows XP, Windows Server 2003, Windows 2000, Windows Vista, Windows Server 2008, Windows 7 and Windows 8 NTFS file systems. Almost the full POSIX filesystem functionality is supported, the major exceptions are changing the file ownerships and the access rights. WWW: https://www.tuxera.com/community/open-source-ntfs-3g/ Other files: /usr/local/lib/libntfs-3g.a /usr/local/share/doc/ntfs-3g/README /usr/local/share/doc/ntfs-3g/README.FreeBSD ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Have a fun crew! ;) Domagoj Smol=C4=8Di=C4=87