From owner-freebsd-hackers@freebsd.org Mon Jan 30 09:10:46 2017 Return-Path: Delivered-To: freebsd-hackers@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 C7BC3CC7E44 for ; Mon, 30 Jan 2017 09:10:46 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from know-smtprelay-omc-1.server.virginmedia.net (know-smtprelay-omc-1.server.virginmedia.net [80.0.253.65]) by mx1.freebsd.org (Postfix) with ESMTP id 461BA11D5 for ; Mon, 30 Jan 2017 09:10:45 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from [192.168.1.100] ([86.10.211.13]) by know-smtprelay-1-imp with bizsmtp id eZ9b1u0080HtmFq01Z9b2y; Mon, 30 Jan 2017 09:09:35 +0000 X-Originating-IP: [86.10.211.13] X-Spam: 0 X-Authority: v=2.1 cv=c6JWOkJl c=1 sm=1 tr=0 a=SB7hr1IvJSWWr45F2gQiKw==:117 a=SB7hr1IvJSWWr45F2gQiKw==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IkcTkHD0fZMA:10 a=SBKgAyYTOTQA:10 a=2rVjqWD_AAAA:8 a=6I5d2MoRAAAA:8 a=itly7gIdAAAA:8 a=THAlScAi7DSrRSYQ3uwA:9 a=QEXdDO2ut3YA:10 a=ZUGwP7LCt9cA:10 a=FSu5OgGmP5kA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=ULaUcM2Ibn9MdPUUwucP:22 a=IjZwj45LgO3ly-622nXo:22 a=1RpNR2E4bTkVPcsa2RFZ:22 Subject: nosh version 1.32 To: FreeBSD Hackers , Debian users , Supervision References: <54430B41.3010301@NTLWorld.com> <76c00c13-4cc9-ed9c-f48f-81a3f050b80b@NTLWorld.com> <0d6afc48-3465-3509-ff46-494da45022bc@NTLWorld.com> From: Jonathan de Boyne Pollard Message-ID: Date: Mon, 30 Jan 2017 09:09:24 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <0d6afc48-3465-3509-ff46-494da45022bc@NTLWorld.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 09:10:46 -0000 The nosh package is now up to version 1.32 . * http://jdebp.eu./Softwares/nosh/ * https://www.freebsd.org/news/status/report-2015-07-2015-09.html#The-nosh-Project * http://jdebp.info./Softwares/nosh/ This release fixes two problems with Gentoo Linux (control group version detection and a problem with mounting API filesystems) that we hashed out on the Supervision mailing list. It furthermore contains a change to the way that convert-systemd-units generates service bundles that fixes problems with control group setup when the service unit defines a "slice" for the service or when the service unit is a template. In furtherance of that there's a new create-control-group command. Other things in this release include improvements to the (unpackaged) Z Shell command-line completions, which now display option completion menus properly; some improvements to the Terminals chapter in the Guide; fixes to various service bundles that were using shell reserved words and operators such as "for" and "&&" without explicitly invoking the shell; additions to userenv for setting DBus and XDG Runtime variables; and a fix that prevents "system-control reset" from looping indefinitely when run by an unprivileged user such as "messagebus" that lacks access to the control/status API. The major improvement in this release, though, is to console-fb-realizer on TrueOS. FreeBSD gives console-fb-realizer uhid device files to use for input devices, which speak the USB HID report protocol and which console-fb-realizer has been happy with for a long time. TrueOS provides either ums/ukbd devices, which lack various features because they speak the old sysmouse and atkbd protocols, or ugen devices. There are no uhid devices available. console-fb-realizer can now use the ugen devices. Moreover, it will detach the ums/ukbd drivers from the ugen devices using the new detach-kernel-usb-driver command, so that there aren't two things both attempting to read HID reports. console-fb-realizer also now correctly sets the keyboard LEDs on both FreeBSD and TrueOS. There have been several minor adjustments to the kernel VT sharing parts of console-fb-realizer, preparatory to splitting the program up into separate parts for input and output devices, permitting things such as multiple keyboards each with its own keyboard map and numlock semantics, in a future release. From owner-freebsd-hackers@freebsd.org Mon Jan 30 10:14:36 2017 Return-Path: Delivered-To: freebsd-hackers@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 6D558CC757B; Mon, 30 Jan 2017 10:14:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 760601924; Mon, 30 Jan 2017 10:14:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA12197; Mon, 30 Jan 2017 12:14:30 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1cY8yk-000HMV-DX; Mon, 30 Jan 2017 12:14:30 +0200 Subject: Re: firefox crashes during pkg upgrade To: freebsd-gecko@FreeBSD.org References: <567BF197.10908@FreeBSD.org> Cc: FreeBSD Hackers From: Andriy Gapon Message-ID: <2a4cad57-ddbf-6ef0-13e6-c2d24280fd24@FreeBSD.org> Date: Mon, 30 Jan 2017 12:13:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <567BF197.10908@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 10:14:36 -0000 On 24/12/2015 15:22, Andriy Gapon wrote: > I've got a strange problem: sometime when I do pkg upgrade a firefox process > crashes with SIGBUS. And that happens rather often. I am still seeing this problem. Sometimes it's firefox, sometimes thunderbird, sometimes none, sometimes both. In all cases the crashes involve libgio. Here is the latest example. Thunderbird aborted after hitting an assertion: GLib-GIO:ERROR:glocalfilemonitor.c:344:g_file_monitor_source_handle_event: assertion failed: (!child || is_basename (child)) Redirecting call to abort() to mozalloc_abort (gdb) bt #0 0x0000000802093d7a in thr_kill () from /lib/libc.so.7 #1 0x0000000802093d4b in __raise (s=11) at /usr/src/lib/libc/gen/raise.c:52 #2 0x0000000805e5ab13 in nsProfileLock::FatalSignalHandler(int, __siginfo*, void*) () from /usr/local/lib/thunderbird/libxul.so #3 0x0000000801db863a in handle_signal (actp=0x7fffffffd248, sig=11, info=0x7fffffffd620, ucp=0x7fffffffd2b0) at /usr/src/lib/libthr/thread/thr_sig.c:244 #4 0x0000000801db7d1f in thr_sighandler (sig=11, info=0x7fffffffd620, _ucp=0x7fffffffd2b0) at /usr/src/lib/libthr/thread/thr_sig.c:189 #5 #6 0x0000000001029a3d in mozalloc_abort(char const*) () #7 0x0000000001029a5d in abort () #8 0x000000080d22f08c in g_assertion_message () from /usr/local/lib/libglib-2.0.so.0 #9 0x000000080d22f0ee in g_assertion_message_expr () from /usr/local/lib/libglib-2.0.so.0 #10 0x000000080df5ea9b in g_file_monitor_source_handle_event () from /usr/local/lib/libgio-2.0.so.0 #11 0x000000080df65a3d in ?? () from /usr/local/lib/libgio-2.0.so.0 #12 0x000000080df63c3e in ?? () from /usr/local/lib/libgio-2.0.so.0 #13 0x000000080df644af in ?? () from /usr/local/lib/libgio-2.0.so.0 #14 0x000000080d20ab75 in g_main_context_dispatch () from /usr/local/lib/libglib-2.0.so.0 #15 0x000000080d20aea4 in ?? () from /usr/local/lib/libglib-2.0.so.0 #16 0x000000080d20af34 in g_main_context_iteration () from /usr/local/lib/libglib-2.0.so.0 #17 0x0000000805619ecc in nsAppShell::ProcessNextNativeEvent(bool) () from /usr/local/lib/thunderbird/libxul.so #18 0x00000008055eda96 in nsBaseAppShell::OnProcessNextEvent(nsIThreadInternal*, bool) () from /usr/local/lib/thunderbird/libxul.so #19 0x00000008055edb5d in non-virtual thunk to nsBaseAppShell::OnProcessNextEvent(nsIThreadInternal*, bool) () from /usr/local/lib/thunderbird/libxul.so #20 0x0000000803ce7ec0 in nsThread::ProcessNextEvent(bool, bool*) () from /usr/local/lib/thunderbird/libxul.so #21 0x0000000803d0d143 in NS_ProcessNextEvent(nsIThread*, bool) () from /usr/local/lib/thunderbird/libxul.so #22 0x0000000803f930de in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) () from /usr/local/lib/thunderbird/libxul.so #23 0x0000000803f76618 in MessageLoop::Run() () from /usr/local/lib/thunderbird/libxul.so #24 0x00000008055ed7ab in nsBaseAppShell::Run() () from /usr/local/lib/thunderbird/libxul.so #25 0x0000000805e1f2ce in nsAppStartup::Run() () from /usr/local/lib/thunderbird/libxul.so #26 0x0000000805e64c22 in XREMain::XRE_mainRun() () from /usr/local/lib/thunderbird/libxul.so #27 0x0000000805e64f0d in XREMain::XRE_main(int, char**, nsXREAppData const*) () from /usr/local/lib/thunderbird/libxul.so #28 0x0000000805e652d1 in XRE_main () from /usr/local/lib/thunderbird/libxul.so #29 0x00000000010294c0 in main () (gdb) fr 10 #10 0x000000080df5ea9b in g_file_monitor_source_handle_event () from /usr/local/lib/libgio-2.0.so.0 (gdb) x/s $r15 0x82032ae40: 'Z' , "/usr/local/share/gnome" The above string is the value of 'child' parameter. It seems like it points to some invalid memory. Given that 'Z' is 0x5a it seems like freed memory. -- Andriy Gapon From owner-freebsd-hackers@freebsd.org Mon Jan 30 10:40:49 2017 Return-Path: Delivered-To: freebsd-hackers@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 5D2D8CC7E5F; Mon, 30 Jan 2017 10:40:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E12588F0; Mon, 30 Jan 2017 10:40:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v0UAefUl068674 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Jan 2017 12:40:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v0UAefUl068674 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v0UAefS7068673; Mon, 30 Jan 2017 12:40:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 30 Jan 2017 12:40:41 +0200 From: Konstantin Belousov To: Andriy Gapon Cc: freebsd-gecko@FreeBSD.org, FreeBSD Hackers Subject: Re: firefox crashes during pkg upgrade Message-ID: <20170130104041.GK3018@kib.kiev.ua> References: <567BF197.10908@FreeBSD.org> <2a4cad57-ddbf-6ef0-13e6-c2d24280fd24@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2a4cad57-ddbf-6ef0-13e6-c2d24280fd24@FreeBSD.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 10:40:49 -0000 On Mon, Jan 30, 2017 at 12:13:34PM +0200, Andriy Gapon wrote: > On 24/12/2015 15:22, Andriy Gapon wrote: > > I've got a strange problem: sometime when I do pkg upgrade a firefox process > > crashes with SIGBUS. And that happens rather often. > > I am still seeing this problem. Sometimes it's firefox, sometimes thunderbird, > sometimes none, sometimes both. > > In all cases the crashes involve libgio. > > Here is the latest example. > Thunderbird aborted after hitting an assertion: > GLib-GIO:ERROR:glocalfilemonitor.c:344:g_file_monitor_source_handle_event: > assertion failed: (!child || is_basename (child)) > Redirecting call to abort() to mozalloc_abort > > (gdb) bt > #0 0x0000000802093d7a in thr_kill () from /lib/libc.so.7 > #1 0x0000000802093d4b in __raise (s=11) at /usr/src/lib/libc/gen/raise.c:52 > #2 0x0000000805e5ab13 in nsProfileLock::FatalSignalHandler(int, __siginfo*, > void*) () from /usr/local/lib/thunderbird/libxul.so > #3 0x0000000801db863a in handle_signal (actp=0x7fffffffd248, sig=11, > info=0x7fffffffd620, ucp=0x7fffffffd2b0) at /usr/src/lib/libthr/thread/thr_sig.c:244 > #4 0x0000000801db7d1f in thr_sighandler (sig=11, info=0x7fffffffd620, > _ucp=0x7fffffffd2b0) at /usr/src/lib/libthr/thread/thr_sig.c:189 > #5 > #6 0x0000000001029a3d in mozalloc_abort(char const*) () > #7 0x0000000001029a5d in abort () > #8 0x000000080d22f08c in g_assertion_message () from > /usr/local/lib/libglib-2.0.so.0 > #9 0x000000080d22f0ee in g_assertion_message_expr () from > /usr/local/lib/libglib-2.0.so.0 > #10 0x000000080df5ea9b in g_file_monitor_source_handle_event () from > /usr/local/lib/libgio-2.0.so.0 > #11 0x000000080df65a3d in ?? () from /usr/local/lib/libgio-2.0.so.0 > #12 0x000000080df63c3e in ?? () from /usr/local/lib/libgio-2.0.so.0 > #13 0x000000080df644af in ?? () from /usr/local/lib/libgio-2.0.so.0 > #14 0x000000080d20ab75 in g_main_context_dispatch () from > /usr/local/lib/libglib-2.0.so.0 > #15 0x000000080d20aea4 in ?? () from /usr/local/lib/libglib-2.0.so.0 > #16 0x000000080d20af34 in g_main_context_iteration () from > /usr/local/lib/libglib-2.0.so.0 > #17 0x0000000805619ecc in nsAppShell::ProcessNextNativeEvent(bool) () from > /usr/local/lib/thunderbird/libxul.so > #18 0x00000008055eda96 in nsBaseAppShell::OnProcessNextEvent(nsIThreadInternal*, > bool) () from /usr/local/lib/thunderbird/libxul.so > #19 0x00000008055edb5d in non-virtual thunk to > nsBaseAppShell::OnProcessNextEvent(nsIThreadInternal*, bool) () from > /usr/local/lib/thunderbird/libxul.so > #20 0x0000000803ce7ec0 in nsThread::ProcessNextEvent(bool, bool*) () from > /usr/local/lib/thunderbird/libxul.so > #21 0x0000000803d0d143 in NS_ProcessNextEvent(nsIThread*, bool) () from > /usr/local/lib/thunderbird/libxul.so > #22 0x0000000803f930de in > mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) () from > /usr/local/lib/thunderbird/libxul.so > #23 0x0000000803f76618 in MessageLoop::Run() () from > /usr/local/lib/thunderbird/libxul.so > #24 0x00000008055ed7ab in nsBaseAppShell::Run() () from > /usr/local/lib/thunderbird/libxul.so > #25 0x0000000805e1f2ce in nsAppStartup::Run() () from > /usr/local/lib/thunderbird/libxul.so > #26 0x0000000805e64c22 in XREMain::XRE_mainRun() () from > /usr/local/lib/thunderbird/libxul.so > #27 0x0000000805e64f0d in XREMain::XRE_main(int, char**, nsXREAppData const*) () > from /usr/local/lib/thunderbird/libxul.so > #28 0x0000000805e652d1 in XRE_main () from /usr/local/lib/thunderbird/libxul.so > #29 0x00000000010294c0 in main () > > (gdb) fr 10 > #10 0x000000080df5ea9b in g_file_monitor_source_handle_event () from > /usr/local/lib/libgio-2.0.so.0 > (gdb) x/s $r15 > 0x82032ae40: 'Z' , "/usr/local/share/gnome" > > The above string is the value of 'child' parameter. > It seems like it points to some invalid memory. > Given that 'Z' is 0x5a it seems like freed memory. I am not sure that my issue is same as your issue, but I also see gtk applications sometimes faulting during the packages updates. If you take a look into firefox address map, there are the following interesting items: 1356 0x8023a1000 0x8023c1000 r-- 32 32 4 0 ---- vn /var/db/fontconfig/a2bfc4e431963a28dd6df8adc7776b96-le64.cache-7 1356 0x80797a000 0x8079b9000 r-- 39 44 2 0 CN-- vn /usr/sfw/local8/share/fonts/webfonts/tahoma.ttf 1356 0x80eeb0000 0x80eecf000 r-- 16 16 1 0 ---- vn /usr/sfw/local8/share/mime/mime.cache 1356 0x80eecf000 0x80eedd000 r-- 14 14 2 0 CN-- vn /usr/sfw/local8/share/icons/Adwaita/icon-theme.cache 1356 0x80ee1e000 0x80ee4a000 r-- 44 44 1 0 CN-- vn /usr/home/kostik/.mozilla/firefox/q3eu9l5y.default/extensions/compatibility@addons.mozilla.org.xpi 1356 0x815800000 0x817100000 r-- 256 260 1 0 ---- vn /usr/sfw/local8/share/icu/58.2/icudt58l.dat They are many different things I picked, e.g. the fontconfig cache files, ttf fonts, some icons pointers, xpi extentions, probably there are more things to list. The common between them is the fact that they are mapped into the target process, but they are not ELF shared objects. More, I know that at least fontconfig and icons caches are rebuilt at the package install or upgrade time. The problem with them is that the files are filled with the new data live. This means that the previous mapping potentially shrinked, and previously read data, in particular, internal pointers in the process inside the mapped data, also invalidated. For shared objects, pkg ensures that the existing mappings are not affected, by removing and then recreating the files. No such procedure exists or can be applied to the caches. I discussed this once with bapt, no good solution seems to exist. From owner-freebsd-hackers@freebsd.org Mon Jan 30 15:55:41 2017 Return-Path: Delivered-To: freebsd-hackers@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 404D1CC855B for ; Mon, 30 Jan 2017 15:55:41 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 11F1112D; Mon, 30 Jan 2017 15:55:40 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id v0UFtdGg096595 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Jan 2017 08:55:39 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id v0UFtc9E096592; Mon, 30 Jan 2017 08:55:38 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Mon, 30 Jan 2017 08:55:38 -0700 (MST) From: Warren Block To: "Andrey V. Elsukov" cc: Slawa Olhovchenkov , freebsd-hackers@freebsd.org Subject: Re: How to safely remove rest of GTP? In-Reply-To: Message-ID: References: <20161230124407.GN37118@zxy.spb.ru> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (wonkity.com [127.0.0.1]); Mon, 30 Jan 2017 08:55:40 -0700 (MST) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 15:55:41 -0000 On Fri, 30 Dec 2016, Andrey V. Elsukov wrote: > On 30.12.2016 15:44, Slawa Olhovchenkov wrote: >> How to safely remove rest of GPT? >> Disk have actual data (part of ZFS), I am don't need to destroy this >> data. >> >> GEOM: da6: the primary GPT table is corrupt or invalid. >> GEOM: da6: using the secondary instead -- recovery strongly advised. >> GEOM: da22: the primary GPT table is corrupt or invalid. >> GEOM: da22: using the secondary instead -- recovery strongly advised. >> GEOM: da6: the primary GPT table is corrupt or invalid. >> GEOM: da6: using the secondary instead -- recovery strongly advised. >> GEOM: da22: the primary GPT table is corrupt or invalid. >> GEOM: da22: using the secondary instead -- recovery strongly advised. > > You may try attached patch, I did only basic tests, so first try somewhere :) I really like the idea of gpart being able to remove the secondary GPT, but combining it with the existing destroy command is ambiguous. It's hard for the user to tell what will happen, and the command itself implies that it will destroy all partitioning. A different command or option name, maybe, but it's hard to think of a good name on a Monday morning. Certainly the problem of stale secondary GPTs comes up a lot. From owner-freebsd-hackers@freebsd.org Mon Jan 30 16:10:58 2017 Return-Path: Delivered-To: freebsd-hackers@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 17450CC88B2 for ; Mon, 30 Jan 2017 16:10:58 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward2j.cmail.yandex.net (forward2j.cmail.yandex.net [IPv6:2a02:6b8:0:1630::15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB30DA1B for ; Mon, 30 Jan 2017 16:10:57 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp3h.mail.yandex.net (smtp3h.mail.yandex.net [84.201.186.20]) by forward2j.cmail.yandex.net (Yandex) with ESMTP id 35D7520C11; Mon, 30 Jan 2017 19:10:54 +0300 (MSK) Received: from smtp3h.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3h.mail.yandex.net (Yandex) with ESMTP id 028D5440DCA; Mon, 30 Jan 2017 19:10:52 +0300 (MSK) Received: by smtp3h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tivjaz2in1-ApjG3RqA; Mon, 30 Jan 2017 19:10:51 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1485792651; bh=i2hk030CGY83NqOxXGt3ClLMmrACf9oYdlf2vNfse9c=; h=Subject:To:References:Cc:From:Message-ID:Date:In-Reply-To; b=hdWygElKG1V4WzTiPGH1wjC95VWa2ACH0sb865363BbgrmZ51YgGZE8nsE2Xa3srv pZBnHjesWIfNN7qXgdwyQF4OEC/7a1OOfuWYSEpLrQEGMRGlLaI9k1IsAh8rT0QtfQ sRxr9fCAwwqFdeEBeh+LcLSEUYD4LFNwnNcoJ5qE= Authentication-Results: smtp3h.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0 Subject: Re: How to safely remove rest of GTP? To: Warren Block References: <20161230124407.GN37118@zxy.spb.ru> Cc: Slawa Olhovchenkov , freebsd-hackers@freebsd.org From: "Andrey V. Elsukov" Message-ID: <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> Date: Mon, 30 Jan 2017 19:09:39 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 16:10:58 -0000 On 30.01.2017 18:55, Warren Block wrote: >>> GEOM: da6: the primary GPT table is corrupt or invalid. >>> GEOM: da6: using the secondary instead -- recovery strongly advised. >>> GEOM: da22: the primary GPT table is corrupt or invalid. >>> GEOM: da22: using the secondary instead -- recovery strongly advised. >>> GEOM: da6: the primary GPT table is corrupt or invalid. >>> GEOM: da6: using the secondary instead -- recovery strongly advised. >>> GEOM: da22: the primary GPT table is corrupt or invalid. >>> GEOM: da22: using the secondary instead -- recovery strongly advised. >> >> You may try attached patch, I did only basic tests, so first try >> somewhere :) > > I really like the idea of gpart being able to remove the secondary GPT, > but combining it with the existing destroy command is ambiguous. It's > hard for the user to tell what will happen, and the command itself > implies that it will destroy all partitioning. I don't see any ambiguity here. A user sees corrupted GPT, it can only destroy or recover it. It is impossible to have a corrupted GPT and some other type of partition table in the same time. So, if you use 'gpart destroy' - you want to explicitly destroy it. -- WBR, Andrey V. Elsukov From owner-freebsd-hackers@freebsd.org Mon Jan 30 17:23:29 2017 Return-Path: Delivered-To: freebsd-hackers@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 0904ACC7033 for ; Mon, 30 Jan 2017 17:23:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDFD319CE for ; Mon, 30 Jan 2017 17:23:28 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: cbe324e6-e710-11e6-b3c1-c9f38144898e X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id cbe324e6-e710-11e6-b3c1-c9f38144898e; Mon, 30 Jan 2017 17:23:21 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v0UHNK4S013906; Mon, 30 Jan 2017 10:23:20 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1485796999.3017.7.camel@freebsd.org> Subject: Re: How to safely remove rest of GTP? From: Ian Lepore To: "Andrey V. Elsukov" , Warren Block Cc: freebsd-hackers@freebsd.org, Slawa Olhovchenkov Date: Mon, 30 Jan 2017 10:23:19 -0700 In-Reply-To: <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> References: <20161230124407.GN37118@zxy.spb.ru> <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 17:23:29 -0000 On Mon, 2017-01-30 at 19:09 +0300, Andrey V. Elsukov wrote: > On 30.01.2017 18:55, Warren Block wrote: > > > > > > > > > > > > > GEOM: da6: the primary GPT table is corrupt or invalid. > > > > GEOM: da6: using the secondary instead -- recovery strongly > > > > advised. > > > > GEOM: da22: the primary GPT table is corrupt or invalid. > > > > GEOM: da22: using the secondary instead -- recovery strongly > > > > advised. > > > > GEOM: da6: the primary GPT table is corrupt or invalid. > > > > GEOM: da6: using the secondary instead -- recovery strongly > > > > advised. > > > > GEOM: da22: the primary GPT table is corrupt or invalid. > > > > GEOM: da22: using the secondary instead -- recovery strongly > > > > advised. > > > You may try attached patch, I did only basic tests, so first try > > > somewhere :) > > I really like the idea of gpart being able to remove the secondary > > GPT, > > but combining it with the existing destroy command is > > ambiguous.  It's > > hard for the user to tell what will happen, and the command itself > > implies that it will destroy all partitioning. > I don't see any ambiguity here. A user sees corrupted GPT, it can > only  > destroy or recover it. It is impossible to have a corrupted GPT and > some  > other type of partition table in the same time. So, if you use > 'gpart  > destroy' - you want to explicitly destroy it. > The question to ask here is why are you the only one who can't see or understand that a user is NOT going to use a "destroy" command on a  disk containing live data?  Especially given the confusing vagueness of the gpart docs. -- Ian From owner-freebsd-hackers@freebsd.org Mon Jan 30 17:36:15 2017 Return-Path: Delivered-To: freebsd-hackers@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 C8C61CC74AE for ; Mon, 30 Jan 2017 17:36:15 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8332495 for ; Mon, 30 Jan 2017 17:36:14 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id ED01E13C9D for ; Mon, 30 Jan 2017 17:36:12 +0000 (UTC) Subject: Re: How to safely remove rest of GTP? To: freebsd-hackers@freebsd.org References: <20161230124407.GN37118@zxy.spb.ru> <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> <1485796999.3017.7.camel@freebsd.org> From: Allan Jude Message-ID: <010b109f-1c24-486b-ef3e-6198294731e4@freebsd.org> Date: Mon, 30 Jan 2017 12:36:04 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1485796999.3017.7.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CNh8nGCR4uUmDbBV7JuBAUnG4XVm6ludS" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 17:36:15 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CNh8nGCR4uUmDbBV7JuBAUnG4XVm6ludS Content-Type: multipart/mixed; boundary="GX73V1xkNs2VHbgegK4TvcCh2D1higGvu"; protected-headers="v1" From: Allan Jude To: freebsd-hackers@freebsd.org Message-ID: <010b109f-1c24-486b-ef3e-6198294731e4@freebsd.org> Subject: Re: How to safely remove rest of GTP? References: <20161230124407.GN37118@zxy.spb.ru> <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> <1485796999.3017.7.camel@freebsd.org> In-Reply-To: <1485796999.3017.7.camel@freebsd.org> --GX73V1xkNs2VHbgegK4TvcCh2D1higGvu Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2017-01-30 12:23, Ian Lepore wrote: > On Mon, 2017-01-30 at 19:09 +0300, Andrey V. Elsukov wrote: >> On 30.01.2017 18:55, Warren Block wrote: >>> >>>> >>>>> >>>>> GEOM: da6: the primary GPT table is corrupt or invalid. >>>>> GEOM: da6: using the secondary instead -- recovery strongly >>>>> advised. >>>>> GEOM: da22: the primary GPT table is corrupt or invalid. >>>>> GEOM: da22: using the secondary instead -- recovery strongly >>>>> advised. >>>>> GEOM: da6: the primary GPT table is corrupt or invalid. >>>>> GEOM: da6: using the secondary instead -- recovery strongly >>>>> advised. >>>>> GEOM: da22: the primary GPT table is corrupt or invalid. >>>>> GEOM: da22: using the secondary instead -- recovery strongly >>>>> advised. >>>> You may try attached patch, I did only basic tests, so first try >>>> somewhere :) >>> I really like the idea of gpart being able to remove the secondary >>> GPT, >>> but combining it with the existing destroy command is >>> ambiguous. It's >>> hard for the user to tell what will happen, and the command itself >>> implies that it will destroy all partitioning. >> I don't see any ambiguity here. A user sees corrupted GPT, it can >> only=20 >> destroy or recover it. It is impossible to have a corrupted GPT and >> some=20 >> other type of partition table in the same time. So, if you use >> 'gpart=20 >> destroy' - you want to explicitly destroy it. >> >=20 > The question to ask here is why are you the only one who can't see or > understand that a user is NOT going to use a "destroy" command on a > disk containing live data? Especially given the confusing vagueness > of the gpart docs. >=20 > -- Ian >=20 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.o= rg" >=20 On my todo list for a while, has been a gpart command to clear the first and last 1MB of a disk. To remove whatever happens to be there: MBR, GPT, ZFS Labels, whatever. Just 'nuke it from orbit'. gpart zero ada0 or gpart clear ada0 something to that affect. --=20 Allan Jude --GX73V1xkNs2VHbgegK4TvcCh2D1higGvu-- --CNh8nGCR4uUmDbBV7JuBAUnG4XVm6ludS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJYj3mIAAoJEBmVNT4SmAt+d7oP/1XzFN11xZAjJEb0ADBjwK/Y 8MVRaE0DJaQS2axEmCSfQm3SExktLI8Gd4gC2MRcvGxlP40irRkaYLfIsN9OxwX4 t2YnrKZz4vccFDvaoPR5GWWbioUU1hiWB83siZ83qm27FofOMPyypIxs+gqxSPjh OMF2KyMZqMNgxqgiPEzpSlIOvHFRKEJAani5i+AfK7kd8KIk8xzY5yeymKdPbBXB q/7lYfmGxvhKlpqJflINHe2oxeInrUBoA6s3FNIBsKWFLMD7FKNHR2p/0dduDgTt QmQW+abxrpm7UrsAUScppSSy7ekCJpLpboS4RvjlnaRmFSczdRsuNBKRx196lKwt DV02+TvmbjPzqmWd/jwajZnD6+DXZBcf13DCsxfZzsc+YG076IDSywraAGkw02Uy EFyprZShcPdHSNJwUab+7y2EAf17QzRzMF5EzfbL3y4rEdLjowRHp4zxOkzVyfIJ LtZSIhvzOmePIn+bVzGUZTHV04sXV/gd8kQNVUlXhUD970slvgoY4ml1TrpQWuIp l5ptlCoeLThdz/YRW367hRe0eFzdk5U9tpv3yS0zA1k0nEK1elRYVqefHq9CaU/C xYNLFwtFFnjfOyF6gdF+ds82i1THYiMYgewxCzn8vBs/3M7G0u4AMkq7EsmvdEYz cLfcIXPoK6Jb5rxkduTM =gZgL -----END PGP SIGNATURE----- --CNh8nGCR4uUmDbBV7JuBAUnG4XVm6ludS-- From owner-freebsd-hackers@freebsd.org Mon Jan 30 21:34:35 2017 Return-Path: Delivered-To: freebsd-hackers@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 951ADCC85C1 for ; Mon, 30 Jan 2017 21:34:35 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward3h.cmail.yandex.net (forward3h.cmail.yandex.net [IPv6:2a02:6b8:0:f35::13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CAAD1A33; Mon, 30 Jan 2017 21:34:35 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp1m.mail.yandex.net (smtp1m.mail.yandex.net [IPv6:2a02:6b8:0:2519::121]) by forward3h.cmail.yandex.net (Yandex) with ESMTP id 08546206B5; Tue, 31 Jan 2017 00:34:22 +0300 (MSK) Received: from smtp1m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1m.mail.yandex.net (Yandex) with ESMTP id 902A363C0D4A; Tue, 31 Jan 2017 00:34:20 +0300 (MSK) Received: by smtp1m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7dLh64nddJ-YJ6mbHkx; Tue, 31 Jan 2017 00:34:19 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1485812059; bh=P5olG3iuCvyGTidDHqvYw//U+Trph3M6Zb4Vr8tYaF8=; h=Subject:To:References:Cc:From:Message-ID:Date:In-Reply-To; b=MZa3KNdNdosz9I8NUIFouxyXG1JMUxIvH+S9OreI2Gm3Xcq0H5v4UdzYhQntfnkMJ i7Y771apPIi62S8RY0S5hVjwBt9K6G5Rv5IWu7Vdejeq1Eo7Uf5Y6wRqKu3se9kBkS rGnlHCthf/PZ0GD7KGvFHEXYxRjuqIGIihjvZ8zw= Authentication-Results: smtp1m.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: How to safely remove rest of GTP? To: Ian Lepore , Warren Block References: <20161230124407.GN37118@zxy.spb.ru> <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> <1485796999.3017.7.camel@freebsd.org> Cc: freebsd-hackers@freebsd.org, Slawa Olhovchenkov From: "Andrey V. Elsukov" Message-ID: <91788d86-c85b-a893-0185-5d6efd8bca7e@yandex.ru> Date: Tue, 31 Jan 2017 00:33:07 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1485796999.3017.7.camel@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 21:34:35 -0000 On 30.01.2017 20:23, Ian Lepore wrote: >> other type of partition table in the same time. So, if you use >> 'gpart >> destroy' - you want to explicitly destroy it. >> > > The question to ask here is why are you the only one who can't see or > understand that a user is NOT going to use a "destroy" command on a > disk containing live data? Especially given the confusing vagueness > of the gpart docs. Because I have read the docs and understood them? Did you tried do that instead of attacking me each time, when geom/gpart is discussed? I'm even not an author of this. If you don't like the existing documentation, the sources are open, read them and write better documentation. -- WBR, Andrey V. Elsukov From owner-freebsd-hackers@freebsd.org Mon Jan 30 21:37:21 2017 Return-Path: Delivered-To: freebsd-hackers@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 97B63CC8731 for ; Mon, 30 Jan 2017 21:37:21 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 345B31CF8 for ; Mon, 30 Jan 2017 21:37:20 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 42ed4be3-e734-11e6-95b5-6dfd7dbb0ee5 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 42ed4be3-e734-11e6-95b5-6dfd7dbb0ee5; Mon, 30 Jan 2017 21:37:14 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v0ULb7h7014277; Mon, 30 Jan 2017 14:37:07 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1485812227.3017.19.camel@freebsd.org> Subject: Re: How to safely remove rest of GTP? From: Ian Lepore To: "Andrey V. Elsukov" , Warren Block Cc: freebsd-hackers@freebsd.org, Slawa Olhovchenkov Date: Mon, 30 Jan 2017 14:37:07 -0700 In-Reply-To: <91788d86-c85b-a893-0185-5d6efd8bca7e@yandex.ru> References: <20161230124407.GN37118@zxy.spb.ru> <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> <1485796999.3017.7.camel@freebsd.org> <91788d86-c85b-a893-0185-5d6efd8bca7e@yandex.ru> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 21:37:21 -0000 On Tue, 2017-01-31 at 00:33 +0300, Andrey V. Elsukov wrote: > On 30.01.2017 20:23, Ian Lepore wrote: > > > > > > > > other type of partition table in the same time. So, if you use > > > 'gpart > > > destroy' - you want to explicitly destroy it. > > > > > The question to ask here is why are you the only one who can't see > > or > > understand that a user is NOT going to use a "destroy" command on a > >  disk containing live data?  Especially given the confusing > > vagueness > > of the gpart docs. > Because I have read the docs and understood them? Did you tried do > that  > instead of attacking me each time, when geom/gpart is discussed? I'm  > even not an author  of this. If you don't like the existing  > documentation, the sources are open, read them and write better  > documentation. > Every time someone says they can't understand how to do something with gpart, you imply that the problem is all theirs, because the documentation is clear.  The documentation is NOT clear, and every time you say so, I'm going to point out it is not. -- Ian From owner-freebsd-hackers@freebsd.org Mon Jan 30 22:01:36 2017 Return-Path: Delivered-To: freebsd-hackers@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 856DBCC88EA for ; Mon, 30 Jan 2017 22:01:36 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward1o.cmail.yandex.net (forward1o.cmail.yandex.net [IPv6:2a02:6b8:0:1a72::2a1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CF0592; Mon, 30 Jan 2017 22:01:36 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [37.140.190.26]) by forward1o.cmail.yandex.net (Yandex) with ESMTP id A9D9821162; Tue, 31 Jan 2017 01:01:23 +0300 (MSK) Received: from smtp1o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1o.mail.yandex.net (Yandex) with ESMTP id 1E6721300EE1; Tue, 31 Jan 2017 01:01:21 +0300 (MSK) Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Uj8ZtYklmO-1LreBTuI; Tue, 31 Jan 2017 01:01:21 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1485813681; bh=25yHF5aSVZ6AWJdCuwIrKFITiab0g2wCVO40Oc7bG0Q=; h=Subject:To:References:Cc:From:Message-ID:Date:In-Reply-To; b=Ktf7Z8XJcsbMSWob1qnt7s3ozsM0jQVGkuYt3cBd2NC+OXJPSBr3MdlyzhnU3dObK RhO/e2P2swLE6WIf+a16LQpSGiVmyujm350BST9YjNfK9bW2KuPrLfTWnYdC3PrAkQ frICgrvKdHQ0bYUMVosMNPMvEUfNvOgSEvyY3rIQ= Authentication-Results: smtp1o.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: How to safely remove rest of GTP? To: Ian Lepore , Warren Block References: <20161230124407.GN37118@zxy.spb.ru> <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> <1485796999.3017.7.camel@freebsd.org> <91788d86-c85b-a893-0185-5d6efd8bca7e@yandex.ru> <1485812227.3017.19.camel@freebsd.org> Cc: freebsd-hackers@freebsd.org, Slawa Olhovchenkov From: "Andrey V. Elsukov" Message-ID: Date: Tue, 31 Jan 2017 01:00:08 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1485812227.3017.19.camel@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 22:01:36 -0000 On 31.01.2017 00:37, Ian Lepore wrote: >> instead of attacking me each time, when geom/gpart is discussed? I'm >> even not an author of this. If you don't like the existing >> documentation, the sources are open, read them and write better >> documentation. >> > > Every time someone says they can't understand how to do something with > gpart, you imply that the problem is all theirs, because the > documentation is clear. The documentation is NOT clear, and every time > you say so, I'm going to point out it is not. Of course, it is very useful action. Instead of fixing the documentation you say to me that is not clear. To me, who understand it and doesn't see what is not clear. -- WBR, Andrey V. Elsukov From owner-freebsd-hackers@freebsd.org Mon Jan 30 22:09:25 2017 Return-Path: Delivered-To: freebsd-hackers@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 AB3D1CC8BC9 for ; Mon, 30 Jan 2017 22:09:25 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D6D1885 for ; Mon, 30 Jan 2017 22:09:25 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: c1020efa-e738-11e6-b3c1-c9f38144898e X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id c1020efa-e738-11e6-b3c1-c9f38144898e; Mon, 30 Jan 2017 22:09:22 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v0UM9Mcv014391; Mon, 30 Jan 2017 15:09:22 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1485814162.3017.24.camel@freebsd.org> Subject: Re: How to safely remove rest of GTP? From: Ian Lepore To: "Andrey V. Elsukov" , Warren Block Cc: freebsd-hackers@freebsd.org, Slawa Olhovchenkov Date: Mon, 30 Jan 2017 15:09:22 -0700 In-Reply-To: References: <20161230124407.GN37118@zxy.spb.ru> <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> <1485796999.3017.7.camel@freebsd.org> <91788d86-c85b-a893-0185-5d6efd8bca7e@yandex.ru> <1485812227.3017.19.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 22:09:25 -0000 On Tue, 2017-01-31 at 01:00 +0300, Andrey V. Elsukov wrote: > On 31.01.2017 00:37, Ian Lepore wrote: > > > > > > instead of attacking me each time, when geom/gpart is discussed? > > > I'm > > > even not an author  of this. If you don't like the existing > > > documentation, the sources are open, read them and write better > > > documentation. > > > > > Every time someone says they can't understand how to do something > > with > > gpart, you imply that the problem is all theirs, because the > > documentation is clear.  The documentation is NOT clear, and every > > time > > you say so, I'm going to point out it is not. > Of course, it is very useful action. Instead of fixing the > documentation  > you say to me that is not clear. To me, who understand it and > doesn't  > see what is not clear. > It's really not rocket science:  as long as you keep telling people that they are the problem, I'm going to keep pointing out that they are not the problem, and that their confusion is the same as other people are having. -- Ian From owner-freebsd-hackers@freebsd.org Mon Jan 30 22:16:37 2017 Return-Path: Delivered-To: freebsd-hackers@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 35BDACC8F1A for ; Mon, 30 Jan 2017 22:16:37 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward3m.cmail.yandex.net (forward3m.cmail.yandex.net [IPv6:2a02:6b8:b030::1a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1A04F57; Mon, 30 Jan 2017 22:16:36 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [95.108.130.59]) by forward3m.cmail.yandex.net (Yandex) with ESMTP id 2800C20FCE; Tue, 31 Jan 2017 01:16:33 +0300 (MSK) Received: from smtp1j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1j.mail.yandex.net (Yandex) with ESMTP id 8CDC83C80AAC; Tue, 31 Jan 2017 01:16:31 +0300 (MSK) Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id HTap8YbzMR-GUSWJvr9; Tue, 31 Jan 2017 01:16:30 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1485814590; bh=8of2JaqhbmO7ty7uj7y13RlKlx8ff/Fv2aGL2/1HDIY=; h=Subject:To:References:Cc:From:Message-ID:Date:In-Reply-To; b=TZlw/XMHzqynDWYHVRWx87CpiaErhRoQ+2Q8BqAlhFGUh7Y2ziAH3GzIShBiZCBxW BdGfOD6g28qBbzLMli3+bEQ43ie3/xZ2Y3gx1kmCZDGWbBI/FepW76dOPnE1OC9puD zC1uNTaxlNS6mG/xrXKh8vv3aBiOyWMa72Hvs/7Q= Authentication-Results: smtp1j.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: How to safely remove rest of GTP? To: Ian Lepore , Warren Block References: <20161230124407.GN37118@zxy.spb.ru> <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> <1485796999.3017.7.camel@freebsd.org> <91788d86-c85b-a893-0185-5d6efd8bca7e@yandex.ru> <1485812227.3017.19.camel@freebsd.org> <1485814162.3017.24.camel@freebsd.org> Cc: freebsd-hackers@freebsd.org, Slawa Olhovchenkov From: "Andrey V. Elsukov" Message-ID: <79fd0b09-33a6-519b-ece3-88e4087c527e@yandex.ru> Date: Tue, 31 Jan 2017 01:15:17 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1485814162.3017.24.camel@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 22:16:37 -0000 On 31.01.2017 01:09, Ian Lepore wrote: >> Of course, it is very useful action. Instead of fixing the >> documentation >> you say to me that is not clear. To me, who understand it and >> doesn't >> see what is not clear. >> > > It's really not rocket science: as long as you keep telling people > that they are the problem, I'm going to keep pointing out that they are > not the problem, and that their confusion is the same as other people > are having. Ok, I can just ignore such questions and don't answer. You will continue suggest to use dd(1). Documentation will remain the same. All will be happy. Is it right? -- WBR, Andrey V. Elsukov From owner-freebsd-hackers@freebsd.org Mon Jan 30 23:21:40 2017 Return-Path: Delivered-To: freebsd-hackers@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 255E9CC8891 for ; Mon, 30 Jan 2017 23:21:40 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E09668CA for ; Mon, 30 Jan 2017 23:21:39 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id v0UNLbbW009473 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Jan 2017 16:21:37 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id v0UNLbJI009470; Mon, 30 Jan 2017 16:21:37 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Mon, 30 Jan 2017 16:21:37 -0700 (MST) From: Warren Block To: "Andrey V. Elsukov" cc: Slawa Olhovchenkov , freebsd-hackers@freebsd.org Subject: Re: How to safely remove rest of GTP? In-Reply-To: <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> Message-ID: References: <20161230124407.GN37118@zxy.spb.ru> <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (wonkity.com [127.0.0.1]); Mon, 30 Jan 2017 16:21:37 -0700 (MST) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 23:21:40 -0000 On Mon, 30 Jan 2017, Andrey V. Elsukov wrote: > On 30.01.2017 18:55, Warren Block wrote: >>>> GEOM: da6: the primary GPT table is corrupt or invalid. >>>> GEOM: da6: using the secondary instead -- recovery strongly advised. >>>> GEOM: da22: the primary GPT table is corrupt or invalid. >>>> GEOM: da22: using the secondary instead -- recovery strongly advised. >>>> GEOM: da6: the primary GPT table is corrupt or invalid. >>>> GEOM: da6: using the secondary instead -- recovery strongly advised. >>>> GEOM: da22: the primary GPT table is corrupt or invalid. >>>> GEOM: da22: using the secondary instead -- recovery strongly advised. >>> >>> You may try attached patch, I did only basic tests, so first try >>> somewhere :) >> >> I really like the idea of gpart being able to remove the secondary GPT, >> but combining it with the existing destroy command is ambiguous. It's >> hard for the user to tell what will happen, and the command itself >> implies that it will destroy all partitioning. > > I don't see any ambiguity here. A user sees corrupted GPT, it can only > destroy or recover it. Ah, but the user might not even see it. "I wrote an MBR to my disk (with some other software) and now FreeBSD says it has a corrupted GPT." In this case, it can have a valid MBR which the user does not want to destroy. So re-using the gpart destroy command for this is ambiguous. It's also kind of dangerous, in that when the user finally does understand that "destroy" doesn't really destroy all partitioning, they might use it expecting to only destroy the "bad" partitioning and be surprised because things were not like they thought and it wiped out the "good" partitioning. Put another way: `gpart destroy -F` means "destroy the GEOM unconditionally". Adding this additional function to it makes it "destroy the GEOM, unless some specific condition, and then it means only destroy a part of it." As I think I said before, the function is really needed. It is just making the user interface unambiguous that is my concern. zfs has "labelclear". If gpart did that, along with a set amount of space to clear at the beginning and end of the drive, I'd be happy with it. It does not need to detect the type of geom. gpart labelclear -F -s1m da22 to clear the first and last 1M of da22. Maybe force the user to give the -F flag. (Yes, this can be done with dd, but slowly because of oseeking to the end of a big drive. And it requires math, which is both scary and beyond the capacity of many people to calculate.) > It is impossible to have a corrupted GPT and some > other type of partition table in the same time. Maybe when only using FreeBSD and gpart, but I'm pretty sure I've seen forum users who have tried some crappy other formatting tool and have overwritten the primary GPT with a valid MBR and left the secondary GPT untouched. This only becomes obvious when they bring the disk back to a FreeBSD system. From owner-freebsd-hackers@freebsd.org Tue Jan 31 00:06:31 2017 Return-Path: Delivered-To: freebsd-hackers@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 0861DCC7DD6 for ; Tue, 31 Jan 2017 00:06:31 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward5h.cmail.yandex.net (forward5h.cmail.yandex.net [IPv6:2a02:6b8:0:f35::15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9858E1B84 for ; Tue, 31 Jan 2017 00:06:30 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [IPv6:2a02:6b8:0:801::ab]) by forward5h.cmail.yandex.net (Yandex) with ESMTP id B03E9211C0; Tue, 31 Jan 2017 03:06:27 +0300 (MSK) Received: from smtp1j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1j.mail.yandex.net (Yandex) with ESMTP id 6C58A3C80D2E; Tue, 31 Jan 2017 03:06:25 +0300 (MSK) Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Lo2psWsH40-6P6us2Zg; Tue, 31 Jan 2017 03:06:25 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1485821185; bh=hr3i/yNPznrzlZxX58ZZeCM4Sf2sOkdUcVURLw85h0k=; h=Subject:To:References:Cc:From:Message-ID:Date:In-Reply-To; b=APb8iI6ybpOXk9ETO1JZfqFXjCVsa9ryXDevYx/6tuA4+twf5xdg3IpVtn3e7PNyr 0beQNR3jzDBGBBeXWiIF2SUC1pSXlbMCrNH8KshGgjRNrBwZrw+jzmOpJDx0sB3Gdv NDLyA99+hfTOIFkV5/+nEoRpY6JmWYi9PUmHtNvA= Authentication-Results: smtp1j.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0 Subject: Re: How to safely remove rest of GTP? To: Warren Block References: <20161230124407.GN37118@zxy.spb.ru> <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> Cc: Slawa Olhovchenkov , freebsd-hackers@freebsd.org From: "Andrey V. Elsukov" Message-ID: <37c200a6-e2b3-6f5e-792d-4464d2e5ecae@yandex.ru> Date: Tue, 31 Jan 2017 03:05:12 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 00:06:31 -0000 On 31.01.2017 02:21, Warren Block wrote: > On Mon, 30 Jan 2017, Andrey V. Elsukov wrote: > >> On 30.01.2017 18:55, Warren Block wrote: >>>>> GEOM: da6: the primary GPT table is corrupt or invalid. >>>>> GEOM: da6: using the secondary instead -- recovery strongly advised. >>>>> GEOM: da22: the primary GPT table is corrupt or invalid. >>>>> GEOM: da22: using the secondary instead -- recovery strongly advised. >>>>> GEOM: da6: the primary GPT table is corrupt or invalid. >>>>> GEOM: da6: using the secondary instead -- recovery strongly advised. >>>>> GEOM: da22: the primary GPT table is corrupt or invalid. >>>>> GEOM: da22: using the secondary instead -- recovery strongly advised. >>>> >>>> You may try attached patch, I did only basic tests, so first try >>>> somewhere :) >>> >>> I really like the idea of gpart being able to remove the secondary GPT, >>> but combining it with the existing destroy command is ambiguous. It's >>> hard for the user to tell what will happen, and the command itself >>> implies that it will destroy all partitioning. >> >> I don't see any ambiguity here. A user sees corrupted GPT, it can only >> destroy or recover it. > > Ah, but the user might not even see it. "I wrote an MBR to my disk > (with some other software) and now FreeBSD says it has a corrupted GPT." I'm sure this is not true. GEOM_PART has several probe priorities. If there is valid MBR, GPT will not have a chance to print messages about corrupted tables. Look at this example: # truncate -s 100m disk # mdconfig -f disk md0 # gpart create -s gpt md0 md0 created # gpart add -t freebsd-boot -s 128k md0 md0p1 added # gpart show md0 => 40 204720 md0 GPT (100M) 40 256 1 freebsd-boot (128K) 296 204464 - free - (100M) # dd if=/dev/zero of=/dev/md0 count=2 2+0 records in 2+0 records out 1024 bytes transferred in 0.304545 secs (3362 bytes/sec) # gpart show md0 => 40 204720 md0 GPT (100M) [CORRUPT] 40 256 1 freebsd-boot (128K) 296 204464 - free - (100M) # dmesg | grep GEOM GEOM: md0: the primary GPT table is corrupt or invalid. GEOM: md0: using the secondary instead -- recovery strongly advised. Now let's write the MBR: # dd if=/boot/mbr of=/dev/md0 1+0 records in 1+0 records out 512 bytes transferred in 0.033823 secs (15138 bytes/sec) # gpart show md0 => 9 204791 md0 MBR (100M) 9 204791 - free - (100M) # mdconfig -du 0 # mdconfig -f disk md0 # dmesg | grep GEOM # gpart show md0 => 9 204791 md0 MBR (100M) 9 204791 - free - (100M) > In this case, it can have a valid MBR which the user does not want to > destroy. So re-using the gpart destroy command for this is ambiguous. > It's also kind of dangerous, in that when the user finally does > understand that "destroy" doesn't really destroy all partitioning, they > might use it expecting to only destroy the "bad" partitioning and be > surprised because things were not like they thought and it wiped out the > "good" partitioning. It is impossible to have two GEOM_PART's geoms on the same provider. > Put another way: > > `gpart destroy -F` means "destroy the GEOM unconditionally". > > Adding this additional function to it makes it "destroy the GEOM, unless > some specific condition, and then it means only destroy a part of it." There is no need to add such "partial destroy", it still always destroys GEOM. It always destroys partition table metadata. The proposed patch only adds additional check. Since GPT has two parts of metadata, it checks, that each part of metadata is valid before wipe them. > As I think I said before, the function is really needed. It is just > making the user interface unambiguous that is my concern. > > zfs has "labelclear". If gpart did that, along with a set amount of > space to clear at the beginning and end of the drive, I'd be happy with > it. It does not need to detect the type of geom. > > gpart labelclear -F -s1m da22 > > to clear the first and last 1M of da22. Maybe force the user to give > the -F flag. (Yes, this can be done with dd, but slowly because of > oseeking to the end of a big drive. And it requires math, which is both > scary and beyond the capacity of many people to calculate.) > >> It is impossible to have a corrupted GPT and some other type of >> partition table in the same time. > > Maybe when only using FreeBSD and gpart, but I'm pretty sure I've seen > forum users who have tried some crappy other formatting tool and have > overwritten the primary GPT with a valid MBR and left the secondary GPT > untouched. This only becomes obvious when they bring the disk back to a > FreeBSD system. As I said, in this case MBR will have higher priority and there will no GPT, until you destroy MBR. After that GPT will appear. And you will be able correctly destroy GPT using 'gpart destroy -F'. -- WBR, Andrey V. Elsukov From owner-freebsd-hackers@freebsd.org Tue Jan 31 00:12:40 2017 Return-Path: Delivered-To: freebsd-hackers@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 1BB62CC8BB1 for ; Tue, 31 Jan 2017 00:12:40 +0000 (UTC) (envelope-from heisenbug.bala@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC982E6D for ; Tue, 31 Jan 2017 00:12:39 +0000 (UTC) (envelope-from heisenbug.bala@gmail.com) Received: by mail-it0-x234.google.com with SMTP id c7so114002578itd.1 for ; Mon, 30 Jan 2017 16:12:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=rusjDnaySdl8x+8/wwC/A1y6FB5gJcFYi/vQm+fNeJU=; b=qnSPEi1sf6Pb2GwY0u+SQWKdfDK3p0NW2PXe13J+s1/s61CKs4mYpxfPsC6lKr95yC OGVJbXD7sxJSZ8BvVbEwumGYmtRNtnE92Oje6bfBpBDPFbxbEG5yyUifmtdYQ+D6RxAc Y+jDHtkTsL6EtE4kF2F5QOTz68Q2ZpQX19OQkwwV5Mwud1rK5Cb2X3g7JiohBHjTSJql FFhnZxQeV3+oEUx9DMcbO5PFGhOwxQkpXACXwzUj8qxrMEXJFMTsrRnWZFYfuO6Rt4Qu fnsJAs9lEJoXCf5AXXHdFVQ+4BGaMYS1Qb98hvw7akm66jY651Q2RsRTwOaMwEaTotxb UY0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=rusjDnaySdl8x+8/wwC/A1y6FB5gJcFYi/vQm+fNeJU=; b=qyL8Zv2pcT0kDin3fDd2sQJguESnmh7c8ZWT2xuEKaDX/hNc+W8FwjrGBE/b0FZU+k zJ9rFu0RzoT2BVJi9DGvYHhly69PE1FbgfGdp6XDGhT7gt1D/f1RVh3GP+ssT1nuMqUA TFC1/3nKFsgLjkl3zcSRIHOGxvUulqH719QF3L2VkAUIqIBgnYvRL6Fbm8DdNw7hyEa+ k3jHKKx3HaFJM/ePMjZem6Nph7dnKW3aPpwj4NO5rrn0ZgDg0rbDWXK26U0quKAuEaTI kpTPaDep1App079uHMTOC/TJIfTzgWkVA6P0eYu6E9dDrSroU/9JEIQYJTyeqJ7cIQVY 9JJA== X-Gm-Message-State: AIkVDXLlPZnyawQxqWyB5tIlMgR26ezq1Et4M1NJe8zqdATX4JdnWx3SLCAmjY0/jiHUyodk7qC0ladxNY73TQ== X-Received: by 10.36.108.15 with SMTP id w15mr17591176itb.73.1485821559218; Mon, 30 Jan 2017 16:12:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.70.84 with HTTP; Mon, 30 Jan 2017 16:12:38 -0800 (PST) From: Balaji Palaniswami Date: Mon, 30 Jan 2017 16:12:38 -0800 Message-ID: Subject: How to delete read only files. To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 00:12:40 -0000 Hi, I am trying to delete read only files. # pwd /usr/home/bp/nfsroot/lib # whoami root # ls libc.so.7 libcrypt.so.5 libthr.so.3 # ls -ltr total 3264 -r--r--r-- 1 root wheel 1460592 Jan 29 12:07 libc.so.7 -r--r--r-- 1 root wheel 51640 Jan 29 12:07 libcrypt.so.5 -r--r--r-- 1 root wheel 109568 Jan 29 12:08 libthr.so.3 # rm -rf libc.so.7 rm: libc.so.7: Operation not permitted # chmod 777 libc.so.7 chmod: libc.so.7: Operation not permitted Please suggest me some ways to delete these files. Thanks, Balaji From owner-freebsd-hackers@freebsd.org Tue Jan 31 00:19:29 2017 Return-Path: Delivered-To: freebsd-hackers@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 EF6BDCC704F for ; Tue, 31 Jan 2017 00:19:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C10912E1 for ; Tue, 31 Jan 2017 00:19:29 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ed3ab5fd-e74a-11e6-95b5-6dfd7dbb0ee5 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id ed3ab5fd-e74a-11e6-95b5-6dfd7dbb0ee5; Tue, 31 Jan 2017 00:19:28 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v0V0JMvx014675; Mon, 30 Jan 2017 17:19:22 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1485821962.3017.32.camel@freebsd.org> Subject: Re: How to delete read only files. From: Ian Lepore To: Balaji Palaniswami , freebsd-hackers@freebsd.org Date: Mon, 30 Jan 2017 17:19:22 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 00:19:30 -0000 On Mon, 2017-01-30 at 16:12 -0800, Balaji Palaniswami wrote: > Hi, > > I am trying to delete read only files. > > # pwd > /usr/home/bp/nfsroot/lib > # whoami > root > # ls > libc.so.7       libcrypt.so.5   libthr.so.3 > # ls -ltr > total 3264 > -r--r--r--  1 root  wheel  1460592 Jan 29 12:07 libc.so.7 > -r--r--r--  1 root  wheel    51640 Jan 29 12:07 libcrypt.so.5 > -r--r--r--  1 root  wheel   109568 Jan 29 12:08 libthr.so.3 > # rm -rf libc.so.7 > rm: libc.so.7: Operation not permitted > > # chmod 777 libc.so.7 > chmod: libc.so.7: Operation not permitted > > Please suggest me some ways to delete these files. > > Thanks, > Balaji Those libraries typically have the 'schg' flag set on them, as do some others in the tree.  If you need to wipe everything under nfsroot, the typical incantation is   rm -rf nfsroot/ ; chflags -R noschg nfsroot/; rm -rf nfsroot/ that deletes everything it can first, then changes the flags on what's left, then deletes them too.  (Doing the noschg first requires examining/changing 145,000 files.) -- Ian From owner-freebsd-hackers@freebsd.org Tue Jan 31 00:30:58 2017 Return-Path: Delivered-To: freebsd-hackers@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 61DB6CC75FA for ; Tue, 31 Jan 2017 00:30:58 +0000 (UTC) (envelope-from heisenbug.bala@gmail.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C3B11914; Tue, 31 Jan 2017 00:30:58 +0000 (UTC) (envelope-from heisenbug.bala@gmail.com) Received: by mail-it0-x22a.google.com with SMTP id k200so25224526itb.1; Mon, 30 Jan 2017 16:30:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XmhuB0lBiKFaecSLTEtziNWG3E+A+LiRrYhjIqwEEJA=; b=UgUz7TxnIlcMKzcNRkLedX595Ubk1wlXavboTXMWQpYRmwL4UFHBFo++LHd2AjD317 a4mUw1G6OnmjhxhWvTBG2OLgHkaxvIpKdB4VXYk8A/XbnM1erSn99WI1E6WFqTN6sxkn W9LJgc8WVjPrkVgraPcR7wBcDmTAsyf1YDKqNlZmxKEOjLloaf/cgwEZN+GHXBrP+R/r XS3JFTfSoeFnjYWd7y+mZOH13/9ycOWLPc1arQiGJFgdf6bcuKHR9BzribRRl/wdtSPu tmpD/zXWR3KaJWpy9VZkZIXbmkN6kPrYQ0qaHfO1+/WunDAWGmJMbxxpMHsAEMLssD+4 F1fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XmhuB0lBiKFaecSLTEtziNWG3E+A+LiRrYhjIqwEEJA=; b=ddjCYCIGM2z27v5rOy8UV3PLYLAVusEQxMu51lKx+54DrTCLe9ncSDTiGyv8ZdeNVu ghtwcKBZN9ud/bME03rG0fec3K2Di6QloqASvg1iERs2SV8nMhVU02jK1YGjDSq+jG5x oQRPimbhrsx2Ctie0DKb7FhVzrv+tiTe3c9I8vsweOVIoGSHDUnb2eq6XO8KPI8xOXVH phEdvQZcjUlp9BH4a6Na5LUdeqD4EusfJp4ZV9kvbjuVZW1pJzFXSSYXlcU7RABiGlaX D4k0cMJqu74Kmz1sRBvCFvc3HF2ja/7P8kJaZifYv+WCkzP1lGBhfjegDKvcGHg/HST4 eotw== X-Gm-Message-State: AIkVDXKNOIQJAhN1UzEZQjZHAqsfF2vO19Qq6PpWc7h/JVE5gY+8Paf4rFgN325Dm1iPumvx6ZQhYb454QENZg== X-Received: by 10.36.246.1 with SMTP id u1mr18816078ith.107.1485822657433; Mon, 30 Jan 2017 16:30:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.70.84 with HTTP; Mon, 30 Jan 2017 16:30:57 -0800 (PST) In-Reply-To: <1485821962.3017.32.camel@freebsd.org> References: <1485821962.3017.32.camel@freebsd.org> From: Balaji Palaniswami Date: Mon, 30 Jan 2017 16:30:57 -0800 Message-ID: Subject: Re: How to delete read only files. To: Ian Lepore Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 00:30:58 -0000 On Mon, Jan 30, 2017 at 4:19 PM, Ian Lepore wrote: > On Mon, 2017-01-30 at 16:12 -0800, Balaji Palaniswami wrote: > > Hi, > > > > I am trying to delete read only files. > > > > # pwd > > /usr/home/bp/nfsroot/lib > > # whoami > > root > > # ls > > libc.so.7 libcrypt.so.5 libthr.so.3 > > # ls -ltr > > total 3264 > > -r--r--r-- 1 root wheel 1460592 Jan 29 12:07 libc.so.7 > > -r--r--r-- 1 root wheel 51640 Jan 29 12:07 libcrypt.so.5 > > -r--r--r-- 1 root wheel 109568 Jan 29 12:08 libthr.so.3 > > # rm -rf libc.so.7 > > rm: libc.so.7: Operation not permitted > > > > # chmod 777 libc.so.7 > > chmod: libc.so.7: Operation not permitted > > > > Please suggest me some ways to delete these files. > > > > Thanks, > > Balaji > > Those libraries typically have the 'schg' flag set on them, as do some > others in the tree. If you need to wipe everything under nfsroot, the > typical incantation is > > rm -rf nfsroot/ ; chflags -R noschg nfsroot/; rm -rf nfsroot/ > > that deletes everything it can first, then changes the flags on what's > left, then deletes them too. (Doing the noschg first requires > examining/changing 145,000 files.) > > -- Ian > It wiped off all files under nfsroot. Thank you so much for your quick help. From owner-freebsd-hackers@freebsd.org Tue Jan 31 00:32:52 2017 Return-Path: Delivered-To: freebsd-hackers@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 639BACC76EE for ; Tue, 31 Jan 2017 00:32:52 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 168D91CAD; Tue, 31 Jan 2017 00:32:51 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id v0V0Wn7L027929 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Jan 2017 17:32:49 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id v0V0Wnk3027926; Mon, 30 Jan 2017 17:32:49 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Mon, 30 Jan 2017 17:32:49 -0700 (MST) From: Warren Block To: Ian Lepore cc: "Andrey V. Elsukov" , freebsd-hackers@freebsd.org, Slawa Olhovchenkov Subject: Re: How to safely remove rest of GTP? In-Reply-To: <1485812227.3017.19.camel@freebsd.org> Message-ID: References: <20161230124407.GN37118@zxy.spb.ru> <1793b0ec-3a86-5c9a-b275-aa93cd9d230e@yandex.ru> <1485796999.3017.7.camel@freebsd.org> <91788d86-c85b-a893-0185-5d6efd8bca7e@yandex.ru> <1485812227.3017.19.camel@freebsd.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-ID: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (wonkity.com [127.0.0.1]); Mon, 30 Jan 2017 17:32:49 -0700 (MST) Content-Type: text/plain; CHARSET=ISO-8859-15; FORMAT=flowed Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 00:32:52 -0000 On Mon, 30 Jan 2017, Ian Lepore wrote: > On Tue, 2017-01-31 at 00:33 +0300, Andrey V. Elsukov wrote: >> On 30.01.2017 20:23, Ian Lepore wrote: >>> >>>> >>>> other type of partition table in the same time. So, if you use >>>> 'gpart >>>> destroy' - you want to explicitly destroy it. >>>> >>> The question to ask here is why are you the only one who can't see >>> or >>> understand that a user is NOT going to use a "destroy" command on a >>>  disk containing live data?  Especially given the confusing >>> vagueness >>> of the gpart docs. >> Because I have read the docs and understood them? Did you tried do >> that  >> instead of attacking me each time, when geom/gpart is discussed? I'm  >> even not an author  of this. If you don't like the existing  >> documentation, the sources are open, read them and write better  >> documentation. >> > > Every time someone says they can't understand how to do something with > gpart, you imply that the problem is all theirs, because the > documentation is clear.  The documentation is NOT clear, and every time > you say so, I'm going to point out it is not. I am interested in improving gpart documentation, if you have specific suggestions. Beyond that, these responses seem unnecessarily harsh and personal. From owner-freebsd-hackers@freebsd.org Tue Jan 31 01:53:54 2017 Return-Path: Delivered-To: freebsd-hackers@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 E276CCC7FEF for ; Tue, 31 Jan 2017 01:53:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC50AFD2; Tue, 31 Jan 2017 01:53:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id 19so25005625pfo.3; Mon, 30 Jan 2017 17:53:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=kbGn7Gzb2/bEzGdWwz484+5feTa9qwyvlsHLGP3+WV4=; b=th4pu1ue3ozb8PGtWfj8ettEF/PMNZX9xg1YKbQGQkz/fcYaiZEmlRtMus/88WYBrf dGkKyI4ZJyU4sTNLgzWBo8qWQx9L3wHlaR4y85gGR19Bulyd7cCPBhejJZItomYzH5Tj sBgBcpFXBm3udEj7OFlbxrLaWg9adsmz12nKUKXS0Va26AoxYz7HT1wJNMJQgJfXMJLu k4kaGQs5cUXlRkJ8i8R3aKfgg2KaiO+mwbOcaz5lnBX1axgWGqomiYbVATRN8OOexGrd M6nS0vOJk96cWDW2YO7CQrgm25bs7UtTmdvgXa1BoHCVkE7ea4EcNoDSupw8DEVETJO+ 7v3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=kbGn7Gzb2/bEzGdWwz484+5feTa9qwyvlsHLGP3+WV4=; b=VCQsRDEjtvls+q4fnYz314XJsSCjm4ipoJwVXvMSTazr2Ij6hUk1EIO5ymkqDoq7+p bf4n1/VBMQlQ4uRsUx/HN77/3baUkgCblk414jDhixZ88czCwTQcY7SSJnrd0WBNcULp EqA/LqtpKWB4FBT2OxFHauoPp16Qq9kcMn/J2jtda/M5WVhH9WKEreasTVhNK4USDvv0 3ffJzIy6EbVR/6M62EnugconGSL0GTBKaO4UlOAD7YybJ0RTc33T0HEhr4g5W6syr43K nmJzOyjtlzSkx+RXiqtkvKXu7GQAEiHcicFNXV9RZ0evtJMw7FaF4RyEMW0ttCoK4Epp g0aQ== X-Gm-Message-State: AIkVDXLJ/4HRAuf4FK8TnXpMEPB3pb54+XhZWGLevp5thCXQWNCu3exFUMUi2Km4Oopvmw== X-Received: by 10.99.117.90 with SMTP id f26mr27379177pgn.62.1485827634239; Mon, 30 Jan 2017 17:53:54 -0800 (PST) Received: from ?IPv6:2607:fb90:f41:fefa:d47f:9ef9:7da8:eb97? ([2607:fb90:f41:fefa:d47f:9ef9:7da8:eb97]) by smtp.gmail.com with ESMTPSA id p15sm35550982pfk.58.2017.01.30.17.53.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 17:53:53 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: How to delete read only files. From: Ngie Cooper X-Mailer: iPhone Mail (14D27) In-Reply-To: <1485821962.3017.32.camel@freebsd.org> Date: Mon, 30 Jan 2017 17:53:52 -0800 Cc: Balaji Palaniswami , freebsd-hackers@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <81EF95CB-126E-401B-B293-177D74804703@gmail.com> References: <1485821962.3017.32.camel@freebsd.org> To: Ian Lepore X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 01:53:55 -0000 > On Jan 30, 2017, at 16:19, Ian Lepore wrote: > >> On Mon, 2017-01-30 at 16:12 -0800, Balaji Palaniswami wrote: >> Hi, >> >> I am trying to delete read only files. >> >> # pwd >> /usr/home/bp/nfsroot/lib >> # whoami >> root >> # ls >> libc.so.7 libcrypt.so.5 libthr.so.3 >> # ls -ltr >> total 3264 >> -r--r--r-- 1 root wheel 1460592 Jan 29 12:07 libc.so.7 >> -r--r--r-- 1 root wheel 51640 Jan 29 12:07 libcrypt.so.5 >> -r--r--r-- 1 root wheel 109568 Jan 29 12:08 libthr.so.3 >> # rm -rf libc.so.7 >> rm: libc.so.7: Operation not permitted >> >> # chmod 777 libc.so.7 >> chmod: libc.so.7: Operation not permitted >> >> Please suggest me some ways to delete these files. >> >> Thanks, >> Balaji > > Those libraries typically have the 'schg' flag set on them, as do some > others in the tree. If you need to wipe everything under nfsroot, the > typical incantation is > > rm -rf nfsroot/ ; chflags -R noschg nfsroot/; rm -rf nfsroot/ > > that deletes everything it can first, then changes the flags on what's > left, then deletes them too. (Doing the noschg first requires > examining/changing 145,000 files.) chflags -R 0 covers the nouchg case as well. Cheers, -Ngie From owner-freebsd-hackers@freebsd.org Tue Jan 31 16:21:58 2017 Return-Path: Delivered-To: freebsd-hackers@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 5ADE0CCA0AD for ; Tue, 31 Jan 2017 16:21:58 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward4p.cmail.yandex.net (forward4p.cmail.yandex.net [IPv6:2a02:6b8:0:1465::14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 159B51DB5 for ; Tue, 31 Jan 2017 16:21:58 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp2h.mail.yandex.net (smtp2h.mail.yandex.net [84.201.187.145]) by forward4p.cmail.yandex.net (Yandex) with ESMTP id D706920C9C; Tue, 31 Jan 2017 19:21:54 +0300 (MSK) Received: from smtp2h.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2h.mail.yandex.net (Yandex) with ESMTP id 7FB387809DB; Tue, 31 Jan 2017 19:21:51 +0300 (MSK) Received: by smtp2h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id CJEGG6GHcK-LpjWlSqO; Tue, 31 Jan 2017 19:21:51 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1485879711; bh=uA86gC+Hyf1bZAyq4Rouz8/zXCm4D7w6srDLuQrplMs=; h=Subject:To:References:Cc:From:Message-ID:Date:In-Reply-To; b=Uu3ZOOP4n447WBxjSRnhrKq2MEB7Ei8dzGLdVUgpexkCJt04YYmdGZtypD+WTIRQS jPMmP/vuEWV5Ueh1BEQMPXkPQPfdlWC5JHC+B7q3hmISN7JVim7jWGSg2UtHyyDYLq uENxhZj9P4CO70CB1KQ4FZz2aIwmxRGfv/kmHKuc= Authentication-Results: smtp2h.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: How to safely remove rest of GTP? To: "Rodney W. Grimes" , Warren Block References: <201701311543.v0VFh0Bl044986@pdx.rh.CN85.dnsmgr.net> Cc: freebsd-hackers@freebsd.org, Slawa Olhovchenkov From: "Andrey V. Elsukov" Message-ID: <515e709a-5c34-0bc1-bc3b-7cff99f6dd97@yandex.ru> Date: Tue, 31 Jan 2017 19:20:36 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <201701311543.v0VFh0Bl044986@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 16:21:58 -0000 On 31.01.2017 18:43, Rodney W. Grimes wrote: > ... much deleted ... >> >>> It is impossible to have a corrupted GPT and some >>> other type of partition table in the same time. > > I believe that statement is in error. > dd if=/boot/boot0 of=/dev/ada0 > Would not that lead to this very situation if done > to a GPT parted disk drive? No, it will not lead to this situation. /boot/boot0 is similar to /boot/mbr in the example, and with /dev/ada0 all will behaves like with /dev/md0. >> Maybe when only using FreeBSD and gpart, but I'm pretty sure I've seen >> forum users who have tried some crappy other formatting tool and have >> overwritten the primary GPT with a valid MBR and left the secondary GPT >> untouched. This only becomes obvious when they bring the disk back to a >> FreeBSD system. > > As almost all MBR tools are un aware of GPT so well not do anything to > destroy the secondary GPT, so this is infact very likely to occur. Please, give me some working example, when or where you have a problem, and not some theoretical, based on previous negative experience or memories. -- WBR, Andrey V. Elsukov From owner-freebsd-hackers@freebsd.org Tue Jan 31 15:43:20 2017 Return-Path: Delivered-To: freebsd-hackers@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 45984CC8655 for ; Tue, 31 Jan 2017 15:43:20 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B101941 for ; Tue, 31 Jan 2017 15:43:19 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v0VFhCZo044987; Tue, 31 Jan 2017 07:43:17 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v0VFh0Bl044986; Tue, 31 Jan 2017 07:43:00 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201701311543.v0VFh0Bl044986@pdx.rh.CN85.dnsmgr.net> Subject: Re: How to safely remove rest of GTP? In-Reply-To: To: Warren Block Date: Tue, 31 Jan 2017 07:43:00 -0800 (PST) CC: "Andrey V. Elsukov" , freebsd-hackers@freebsd.org, Slawa Olhovchenkov X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Mailman-Approved-At: Tue, 31 Jan 2017 16:38:44 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 15:43:20 -0000 ... much deleted ... > > > It is impossible to have a corrupted GPT and some > > other type of partition table in the same time. I believe that statement is in error. dd if=/boot/boot0 of=/dev/ada0 Would not that lead to this very situation if done to a GPT parted disk drive? > Maybe when only using FreeBSD and gpart, but I'm pretty sure I've seen > forum users who have tried some crappy other formatting tool and have > overwritten the primary GPT with a valid MBR and left the secondary GPT > untouched. This only becomes obvious when they bring the disk back to a > FreeBSD system. As almost all MBR tools are un aware of GPT so well not do anything to destroy the secondary GPT, so this is infact very likely to occur. -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Tue Jan 31 21:08:18 2017 Return-Path: Delivered-To: freebsd-hackers@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 75EC2CCA2A0 for ; Tue, 31 Jan 2017 21:08:18 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward5h.cmail.yandex.net (forward5h.cmail.yandex.net [IPv6:2a02:6b8:0:f35::15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 307A7373 for ; Tue, 31 Jan 2017 21:08:18 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp2h.mail.yandex.net (smtp2h.mail.yandex.net [IPv6:2a02:6b8:0:f05::116]) by forward5h.cmail.yandex.net (Yandex) with ESMTP id 86E0A20FA8; Wed, 1 Feb 2017 00:08:06 +0300 (MSK) Received: from smtp2h.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2h.mail.yandex.net (Yandex) with ESMTP id 1DD98780BA2; Wed, 1 Feb 2017 00:08:03 +0300 (MSK) Received: by smtp2h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 86GpUdRPUH-83j8583S; Wed, 01 Feb 2017 00:08:03 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1485896883; bh=jq7/oix1sKGpZETZvJH1ih3053NZ1ZkPbq7MEuxIyDU=; h=Subject:To:References:Cc:From:Message-ID:Date:In-Reply-To; b=D4MvnuOwsv2P4aVnaMPmcfP9pm/6EWKKh05i2im/zKJR2oQOTtpX6PngwKdh9IxIY T422ZhRXSrprBQedmvg7PfDxqveiMpO78CQaNabtlHK/UGCcGJj/+ftFe26FGIY69k SIkpvu/iRxPYg5vdhISHJDGf2qukb4RQjk9Kl1I0= Authentication-Results: smtp2h.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: How to safely remove rest of GTP? To: "Rodney W. Grimes" References: <201701312058.v0VKwlut046163@pdx.rh.CN85.dnsmgr.net> Cc: Warren Block , freebsd-hackers@freebsd.org, Slawa Olhovchenkov From: "Andrey V. Elsukov" Message-ID: Date: Wed, 1 Feb 2017 00:06:47 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <201701312058.v0VKwlut046163@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 21:08:18 -0000 On 31.01.2017 23:58, Rodney W. Grimes wrote: >> No, it will not lead to this situation. >> /boot/boot0 is similar to /boot/mbr in the example, and with /dev/ada0 >> all will behaves like with /dev/md0. > > Well if that is the case then the GPT backup copy is... well useless as > I just clobbered the MBR of a drive and now gpart is gona just take that > as fine and dandy? > > Doesnt that defeat the purpose of the backup GPT? When you overwrite PMBR with MBR, you get MBR, but the GPT is still here. If you need to recover your GPT, you need to put PMBR back (or just destroy MBR with `gpart destroy`), and GPT will be detected again. Even if you have overwritten GPT primary header and GPT primary table, backup header and table give a chance for recovery to you. -- WBR, Andrey V. Elsukov From owner-freebsd-hackers@freebsd.org Tue Jan 31 20:59:02 2017 Return-Path: Delivered-To: freebsd-hackers@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 4BE27CCAEF8 for ; Tue, 31 Jan 2017 20:59:02 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02CB21C2F for ; Tue, 31 Jan 2017 20:59:01 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v0VKwsFb046164; Tue, 31 Jan 2017 12:58:54 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v0VKwlut046163; Tue, 31 Jan 2017 12:58:47 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201701312058.v0VKwlut046163@pdx.rh.CN85.dnsmgr.net> Subject: Re: How to safely remove rest of GTP? In-Reply-To: <515e709a-5c34-0bc1-bc3b-7cff99f6dd97@yandex.ru> To: "Andrey V. Elsukov" Date: Tue, 31 Jan 2017 12:58:47 -0800 (PST) CC: Warren Block , freebsd-hackers@freebsd.org, Slawa Olhovchenkov X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Mailman-Approved-At: Tue, 31 Jan 2017 21:53:56 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 20:59:02 -0000 > On 31.01.2017 18:43, Rodney W. Grimes wrote: > > ... much deleted ... > >> > >>> It is impossible to have a corrupted GPT and some > >>> other type of partition table in the same time. > > > > I believe that statement is in error. > > dd if=/boot/boot0 of=/dev/ada0 > > Would not that lead to this very situation if done > > to a GPT parted disk drive? > > No, it will not lead to this situation. > /boot/boot0 is similar to /boot/mbr in the example, and with /dev/ada0 > all will behaves like with /dev/md0. Well if that is the case then the GPT backup copy is... well useless as I just clobbered the MBR of a drive and now gpart is gona just take that as fine and dandy? Doesnt that defeat the purpose of the backup GPT? > >> Maybe when only using FreeBSD and gpart, but I'm pretty sure I've seen > >> forum users who have tried some crappy other formatting tool and have > >> overwritten the primary GPT with a valid MBR and left the secondary GPT > >> untouched. This only becomes obvious when they bring the disk back to a > >> FreeBSD system. > > > > As almost all MBR tools are un aware of GPT so well not do anything to > > destroy the secondary GPT, so this is infact very likely to occur. > > Please, give me some working example, when or where you have a problem, > and not some theoretical, based on previous negative experience or memories. Next time I see one I well be sure to preserve it, but I have seen problems with bad interactions between GPT and MBR. -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Thu Feb 2 15:05:11 2017 Return-Path: Delivered-To: freebsd-hackers@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 75182CCDA92 for ; Thu, 2 Feb 2017 15:05:11 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id 40697FB5 for ; Thu, 2 Feb 2017 15:05:10 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id 058399D19F for ; Thu, 2 Feb 2017 14:59:49 +0000 (UTC) Received: from [10.1.1.206] (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA id CB7019D19D for ; Thu, 2 Feb 2017 14:59:48 +0000 (UTC) To: freebsd-hackers@freebsd.org From: Giulio Ferro Subject: Leak in file backed swap Message-ID: <2ba8c327-56c9-e0ff-e449-a583b6106540@zirakzigil.org> Date: Thu, 2 Feb 2017 15:59:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Mailman-Approved-At: Thu, 02 Feb 2017 15:40:10 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 15:05:11 -0000 Hi folks, FreeBSD 11-Stable recent build. I've set up a FreeBSD instance in AWS with 1GB RAM. Since I needed some more, I decided to create a swap partition (there are none by default on AWS) and I created a 1GB file under /usr on the instance FS and proceeded to mount it as swap. Even if the machine isn't doing anything, after one day or less the machine becomes unresponsive and must be rebooted. I solved this by buying a 2GB instance, but maybe this issue may be insteresting for someone to look into? Giulio From owner-freebsd-hackers@freebsd.org Thu Feb 2 22:43:41 2017 Return-Path: Delivered-To: freebsd-hackers@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 CBAC2CCE699 for ; Thu, 2 Feb 2017 22:43:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95DE89BC for ; Thu, 2 Feb 2017 22:43:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x235.google.com with SMTP id j18so4943618ioe.2 for ; Thu, 02 Feb 2017 14:43:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0v2APWrB2ggRM7H30hoV1+IXAnZv1VlqXXOWuZEpGZM=; b=dlm6NAve6r/xImyGwviqIs6qP2rjwRgaFHE7FXZx1I2no7rgD0EgSBUqi7zU4D5lTE 35lAwrNVUJtL01qJ9gVq4L072CZ8QGJsbOpmjUGGanU1MNYA8zFRwtaBUH40h2bg8nlC 5sMSe7Ois7b3nXnajqxVyvbrLYcgSd/RfYxrIRXU08YrJXQrzacyTnkvkoyAbcYt6rPS 7C0w65nFfunTGD/2DFR+QUVn2NBBn/Mk9UR1EK3xPgzeglqBsD5fhYGHuXlAwzEpfMVV d9xWFGNfS5fq6q1najVAs3k2lW7ye5xmncMwpxgC5FbCvFERn2jiDbKpnlh8+SD7XJyQ jI7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0v2APWrB2ggRM7H30hoV1+IXAnZv1VlqXXOWuZEpGZM=; b=LxamOuu7ukwDEFHsonpNdukK7w0GdnIYWj58hcQTUDGetSBQ5YQR3FPzQi1wp2Cjye CWj4289Lw6Gvz8Axr0kBxwDl/CtJpuaAa82WaghYBXKRy2c+njIno2MXMAFFGq7eWBqo SA3trAug48voxJEahOTch6r9BrjegU9xJ5+8i7sQOWVur7I5C4TFGNjP+9Lrf12c6cIV Rxkf4uZuFol/r1Do2puIDcAo3qTInHnE3/WrJ9MMaIJmTmr9oOX9p43xCD1+Tao5xl9A cjsm094o0Fdg+4/mJdvxmrCNn0cuMs8b99lIiteQMwcPjLZ9w3zXteQsyGFQrxZ5sp6g ajUA== X-Gm-Message-State: AIkVDXKbxNXGsBbodzv10aaD7VcBPq++07ga1SN+QzqEnzVBHwTWGU5TYOlNKHReNE6J62+JCh8+WjaZcFR7fg== X-Received: by 10.107.11.27 with SMTP id v27mr8437889ioi.145.1486075420913; Thu, 02 Feb 2017 14:43:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.15.90 with HTTP; Thu, 2 Feb 2017 14:43:40 -0800 (PST) In-Reply-To: References: <201701312058.v0VKwlut046163@pdx.rh.CN85.dnsmgr.net> From: Ngie Cooper Date: Thu, 2 Feb 2017 14:43:40 -0800 Message-ID: Subject: Re: How to safely remove rest of GTP? To: "Andrey V. Elsukov" Cc: "Rodney W. Grimes" , "freebsd-hackers@freebsd.org" , Slawa Olhovchenkov Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2017 22:43:41 -0000 *snort* I completely forgot I had scripted this back 1.5 years ago: https://github.com/yaneurabeya/scratch/blob/master/bayonetta/scratch/scripts/freebsd/wipe-gpt-partitions.sh . This basically napalms all of the blocks at the beginning and end that count per GPT (and MBR as well). If someone wants, I can check this into FreeBSD somewhere under tools... Thanks, -Ngie From owner-freebsd-hackers@freebsd.org Fri Feb 3 04:09:41 2017 Return-Path: Delivered-To: freebsd-hackers@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 0CF3DCCEE52 for ; Fri, 3 Feb 2017 04:09:41 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D1B19B5B for ; Fri, 3 Feb 2017 04:09:40 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id v1349dVA002903 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Feb 2017 21:09:39 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id v1349be3002897; Thu, 2 Feb 2017 21:09:37 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Thu, 2 Feb 2017 21:09:37 -0700 (MST) From: Warren Block To: Ngie Cooper cc: "Andrey V. Elsukov" , "freebsd-hackers@freebsd.org" , "Rodney W. Grimes" , Slawa Olhovchenkov Subject: Re: How to safely remove rest of GTP? In-Reply-To: Message-ID: References: <201701312058.v0VKwlut046163@pdx.rh.CN85.dnsmgr.net> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (wonkity.com [127.0.0.1]); Thu, 02 Feb 2017 21:09:39 -0700 (MST) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 04:09:41 -0000 On Thu, 2 Feb 2017, Ngie Cooper wrote: > *snort* I completely forgot I had scripted this back 1.5 years ago: > https://github.com/yaneurabeya/scratch/blob/master/bayonetta/scratch/scripts/freebsd/wipe-gpt-partitions.sh > . This basically napalms all of the blocks at the beginning and end > that count per GPT (and MBR as well). > > If someone wants, I can check this into FreeBSD somewhere under tools... dd is the standard solution, but the oseek to the end of the drive is relatively slow. Or at least it seemed like it the last time I tried it on a big drive. And thematically, the function goes with gpart. From owner-freebsd-hackers@freebsd.org Fri Feb 3 05:31:22 2017 Return-Path: Delivered-To: freebsd-hackers@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 54E06CCE36F for ; Fri, 3 Feb 2017 05:31:22 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C909AED5 for ; Fri, 3 Feb 2017 05:31:20 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vps.rulingia.com (8.15.2/8.15.2) with ESMTPS id v135UxaS024859 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 3 Feb 2017 16:31:10 +1100 (AEDT) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id v135UrHf090529 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Feb 2017 16:30:53 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id v135Upm7090528; Fri, 3 Feb 2017 16:30:51 +1100 (AEDT) (envelope-from peter) Date: Fri, 3 Feb 2017 16:30:51 +1100 From: Peter Jeremy To: Giulio Ferro Cc: freebsd-hackers@freebsd.org Subject: Re: Leak in file backed swap Message-ID: <20170203053051.GA90481@server.rulingia.com> References: <2ba8c327-56c9-e0ff-e449-a583b6106540@zirakzigil.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <2ba8c327-56c9-e0ff-e449-a583b6106540@zirakzigil.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 05:31:22 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2017-Feb-02 15:59:36 +0100, Giulio Ferro wrote: >FreeBSD 11-Stable recent build. > >I've set up a FreeBSD instance in AWS with 1GB RAM. > >and I created a 1GB file under /usr on the instance FS and proceeded to=20 >mount it as swap. > >Even if the machine isn't doing anything, after one day or less the=20 >machine becomes unresponsive I've used swap to UFS and swap to NFS on a number of hosts without problem. If your /usr was on ZFS then this is a known issue (ZFS is CoW and there are known problems dealing with RAM shortage). If not, can you please give more precise details of your configuration. --=20 Peter Jeremy --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJYlBWLXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFRUIyOTg2QzMwNjcxRTc0RTY1QzIyN0Ux NkE1OTdBMEU0QTIwQjM0AAoJEBall6Dkogs0X3YP/25WpdRA7CRl7VvnjSUDgof6 s+tgOrEyUxnxCzOLgDihFciyR3uDZR5rjRBXNjQyDKVRePkOU8V7nOa0yWnz7gsD t1Vj9hL2j1aVlfuRG1yPAtmYdPgqb2rRI1OwltWgh+7dBjyA4U03XWPsnuw+yYTd WwUhEFdlYV/jCiQE6nzsg6cljECvDU72l3sfyqYUwacieZd0boJapE83CLqUgs3s GZucrqHmQlnsjo+7I9JZGJFz4VG9qlLF5EgJv9jvMzHTj0SFuHvUn1HieTJQX6xU IBxwYgsDL2mfr2qFoHG+tZ04QeXM3XihtmA2ZxxEucbAGgHFxOhJnvw8c2KHRxyI JRW75nbXiHIgXRWvyw9VRvApiOecY35nPfpnqemQuIXD/2IhFBA9sbflvfO3iA4j 2qjtlK8S2fk4Er2DMVv6tihQZODbk1JkLm6dTpU1PbEGZjH4B5sjmT+dpYUIs8vP BIYPMgMNmFHJjNPlZjeTcC1OsbzMfAKtAm4UKXnj8nGZcAjEJLrw5PapDtMnKLe5 jcCyqgXR2ot4EePzxYZ5VH38AiWyzZxpp9Kx/9e18WaERXfNLIz7hq4jl3gkpZFl hOqZWpJIRBrGZSZIvABCwFcKGlMLwQJPgVWTEFpgg23l7S2IQuPkd/UYWSGfpgZ3 yD2Bk/r5eLGTwz1OS0Zo =uhXn -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf-- From owner-freebsd-hackers@freebsd.org Fri Feb 3 08:09:31 2017 Return-Path: Delivered-To: freebsd-hackers@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 58BC5CCD98F for ; Fri, 3 Feb 2017 08:09:31 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (mx1.etoilesoft.fr [52.57.51.18]) by mx1.freebsd.org (Postfix) with ESMTP id 2256A19AB for ; Fri, 3 Feb 2017 08:09:30 +0000 (UTC) (envelope-from auryn@zirakzigil.org) Received: from mx1.etoilesoft.fr (localhost [127.0.0.1]) by mx1.etoilesoft.fr (Postfix) with ESMTP id B0DA49D19F for ; Fri, 3 Feb 2017 08:09:42 +0000 (UTC) Received: from [10.1.1.206] (localhost [127.0.0.1]) (Authenticated sender: auryn@zirakzigil.org) by mx1.etoilesoft.fr (Postfix) with ESMTPA id 8385B9D19D for ; Fri, 3 Feb 2017 08:09:42 +0000 (UTC) Subject: Re: Leak in file backed swap To: freebsd-hackers@freebsd.org References: <2ba8c327-56c9-e0ff-e449-a583b6106540@zirakzigil.org> <20170203053051.GA90481@server.rulingia.com> From: Giulio Ferro Message-ID: Date: Fri, 3 Feb 2017 09:09:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170203053051.GA90481@server.rulingia.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Mailman-Approved-At: Fri, 03 Feb 2017 12:22:33 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2017 08:09:31 -0000 On 03/02/2017 06:30, Peter Jeremy wrote: > On 2017-Feb-02 15:59:36 +0100, Giulio Ferro wrote: >> FreeBSD 11-Stable recent build. >> >> I've set up a FreeBSD instance in AWS with 1GB RAM. >> >> and I created a 1GB file under /usr on the instance FS and proceeded to >> mount it as swap. >> >> Even if the machine isn't doing anything, after one day or less the >> machine becomes unresponsive > I've used swap to UFS and swap to NFS on a number of hosts without > problem. If your /usr was on ZFS then this is a known issue (ZFS > is CoW and there are known problems dealing with RAM shortage). If > not, can you please give more precise details of your configuration. > Nope, it's standard UFS: /etc/fstab # Custom /etc/fstab for FreeBSD VM images /dev/gpt/rootfs / ufs rw 1 1 I suspect it may be something related to AWS images... Anyway I actually think that it should be quite easy to replicate: you just need to create an AWS instance from the images in the community section of AWS (FreeBSD 11-stable something), create a 1GB file /usr/swap0 on the file system and mount it /etc/fstab ... md99 none swap sw,file=/usr/swap0,late 0 0 After one day or less the instance will become unresponsive... Giulio From owner-freebsd-hackers@freebsd.org Sat Feb 4 18:57:17 2017 Return-Path: Delivered-To: freebsd-hackers@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 5F00DCD0590 for ; Sat, 4 Feb 2017 18:57:17 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 31AABE49 for ; Sat, 4 Feb 2017 18:57:17 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id v14IvAl1092848 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 4 Feb 2017 11:57:10 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id v14Iv8YB092845; Sat, 4 Feb 2017 11:57:09 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Sat, 4 Feb 2017 11:57:08 -0700 (MST) From: Warren Block To: "Andrey V. Elsukov" cc: "Rodney W. Grimes" , freebsd-hackers@freebsd.org, Slawa Olhovchenkov Subject: Re: How to safely remove rest of GTP? In-Reply-To: <515e709a-5c34-0bc1-bc3b-7cff99f6dd97@yandex.ru> Message-ID: References: <201701311543.v0VFh0Bl044986@pdx.rh.CN85.dnsmgr.net> <515e709a-5c34-0bc1-bc3b-7cff99f6dd97@yandex.ru> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (wonkity.com [127.0.0.1]); Sat, 04 Feb 2017 11:57:10 -0700 (MST) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 18:57:17 -0000 On Tue, 31 Jan 2017, Andrey V. Elsukov wrote: > On 31.01.2017 18:43, Rodney W. Grimes wrote: >> ... much deleted ... >>> >>>> It is impossible to have a corrupted GPT and some >>>> other type of partition table in the same time. >> >> I believe that statement is in error. >> dd if=/boot/boot0 of=/dev/ada0 >> Would not that lead to this very situation if done >> to a GPT parted disk drive? > > No, it will not lead to this situation. > /boot/boot0 is similar to /boot/mbr in the example, and with /dev/ada0 all > will behaves like with /dev/md0. > >>> Maybe when only using FreeBSD and gpart, but I'm pretty sure I've seen >>> forum users who have tried some crappy other formatting tool and have >>> overwritten the primary GPT with a valid MBR and left the secondary GPT >>> untouched. This only becomes obvious when they bring the disk back to a >>> FreeBSD system. >> >> As almost all MBR tools are un aware of GPT so well not do anything to >> destroy the secondary GPT, so this is infact very likely to occur. > > Please, give me some working example, when or where you have a problem, and > not some theoretical, based on previous negative experience or memories. I just encountered something similar with a Windows 7 install on a disk that previously had a FreeBSD GPT layout. Clonezilla reported a conflicting GPT/MBR layout on the disk. In gpart, it showed a valid GPT (not corrupt) with no partitions. After all the cursing, I ran 'sudo sgdisk -z /dev/sda' as instructed by Clonezilla. It was only after that I realized I should have saved at least the partition tables. From owner-freebsd-hackers@freebsd.org Sat Feb 4 21:30:10 2017 Return-Path: Delivered-To: freebsd-hackers@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 C3B2FCD00F4 for ; Sat, 4 Feb 2017 21:30:10 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward1p.cmail.yandex.net (forward1p.cmail.yandex.net [IPv6:2a02:6b8:0:1465::11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A17B1E0D for ; Sat, 4 Feb 2017 21:30:10 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp3m.mail.yandex.net (smtp3m.mail.yandex.net [IPv6:2a02:6b8:0:2519::125]) by forward1p.cmail.yandex.net (Yandex) with ESMTP id 3E82520739; Sun, 5 Feb 2017 00:29:58 +0300 (MSK) Received: from smtp3m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3m.mail.yandex.net (Yandex) with ESMTP id 8516D2840C3C; Sun, 5 Feb 2017 00:29:56 +0300 (MSK) Received: by smtp3m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Ymd0qNbxp2-Tteqc1sS; Sun, 05 Feb 2017 00:29:55 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1486243795; bh=CV5Z67ipK0CO9a3qshJ2TV7MukQYhCwsmaYVvGic3vQ=; h=Subject:To:References:Cc:From:Message-ID:Date:In-Reply-To; b=brs7c9noU3s8FbjaVzu9HFIcsUxR8lxu7XOz3kk0njBLly8yYv+oMoD3xck71z8Qc UG4KOeEmIhxSbojyBV6lomADSW5pJAW/rcQUPAXxVi0A57KS49MFdawc/AXawBcEDE E42guZx/qCny/TGBoFaaCGT1DbNJ4W6Q967NI8nY= Authentication-Results: smtp3m.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: How to safely remove rest of GTP? To: Warren Block References: <201701311543.v0VFh0Bl044986@pdx.rh.CN85.dnsmgr.net> <515e709a-5c34-0bc1-bc3b-7cff99f6dd97@yandex.ru> Cc: "Rodney W. Grimes" , freebsd-hackers@freebsd.org, Slawa Olhovchenkov From: "Andrey V. Elsukov" Message-ID: Date: Sun, 5 Feb 2017 00:28:46 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 21:30:10 -0000 On 04.02.2017 21:57, Warren Block wrote: >> Please, give me some working example, when or where you have a >> problem, and not some theoretical, based on previous negative >> experience or memories. > > I just encountered something similar with a Windows 7 install on a disk > that previously had a FreeBSD GPT layout. > > Clonezilla reported a conflicting GPT/MBR layout on the disk. In gpart, > it showed a valid GPT (not corrupt) with no partitions. After all the > cursing, I ran 'sudo sgdisk -z /dev/sda' as instructed by Clonezilla. > > It was only after that I realized I should have saved at least the > partition tables. Hi, so, what is wrong here from your point of view? I can imagine a way how to reproduce it. Create two partition tables MBR and GPT. # truncate -s 100m disk0 # truncate -s 100m disk1 # mdconfig -f disk0 md0 # mdconfig -f disk1 md1 # gpart create -s gpt md0 md0 created # gpart create -s mbr md1 md1 created # gpart add -t fat32 -s 25m md1 md1s1 added # gpart add -t ntfs -s 25m md1 md1s2 added # gpart add -t \!238 md1 md1s3 added # gpart show md0 md1 => 40 204720 md0 GPT (100M) 40 204720 - free - (100M) => 9 204791 md1 MBR (100M) 9 51200 1 fat32 (25M) 51209 51200 2 ntfs (25M) 102409 102391 3 !238 (50M) Copy MBR from md1 to md0: # dd if=/dev/md1 of=/dev/md0 count=1 1+0 records in 1+0 records out 512 bytes transferred in 0.285149 secs (1796 bytes/sec) # gpart show md0 md1 => 40 204720 md0 GPT (100M) 40 204720 - free - (100M) => 9 204791 md1 MBR (100M) 9 51200 1 fat32 (25M) 51209 51200 2 ntfs (25M) 102409 102391 3 !238 (50M) Now md0 has correct MBR and GPT (not corrupt). GPT has higher priority, due to MBR has partition with type 0xee (PMBR). https://svnweb.freebsd.org/base?view=revision&revision=258448 Remove "PMBR" partition and overwrite MBR on md0 again: # gpart delete -i 3 md1 md1s3 deleted # dd if=/dev/md1 of=/dev/md0 count=1 1+0 records in 1+0 records out 512 bytes transferred in 0.289039 secs (1771 bytes/sec) # gpart show md0 md1 => 9 204791 md0 MBR (100M) 9 51200 1 fat32 (25M) 51209 51200 2 ntfs (25M) 102409 102391 - free - (50M) => 9 204791 md1 MBR (100M) 9 51200 1 fat32 (25M) 51209 51200 2 ntfs (25M) 102409 102391 - free - (50M) md0 still has both GPT and MBR, but GPT has lower priority, because there is no PMBR partition. Destroy MBR on the md0: # gpart destroy -F md0 md0 destroyed # gpart show md0 md1 gpart: No such geom: md0. And force retaste: # true > /dev/md0 # gpart show md0 md1 => 40 204720 md0 GPT (100M) 40 204720 - free - (100M) => 9 204791 md1 MBR (100M) 9 51200 1 fat32 (25M) 51209 51200 2 ntfs (25M) 102409 102391 - free - (50M) -- WBR, Andrey V. Elsukov