From owner-freebsd-hackers@freebsd.org Mon Nov 26 01:05:11 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55DF11148F9F for ; Mon, 26 Nov 2018 01:05:11 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-7.mit.edu (dmz-mailsec-scanner-7.mit.edu [18.7.68.36]) (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 EA2697F05D for ; Mon, 26 Nov 2018 01:05:09 +0000 (UTC) (envelope-from kaduk@mit.edu) X-AuditID: 12074424-a89ff70000005c55-57-5bfb458e40ec Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 72.6F.23637.F854BFB5; Sun, 25 Nov 2018 20:00:00 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH-1.MIT.EDU [18.9.28.11]) by mailhub-auth-4.mit.edu (8.14.7/8.9.2) with ESMTP id wAQ0xtdJ023623; Sun, 25 Nov 2018 19:59:56 -0500 Received: from kduck.kaduk.org (24-107-191-124.dhcp.stls.mo.charter.com [24.107.191.124]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) œby outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id wAQ0xppY014272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 25 Nov 2018 19:59:54 -0500 Date: Sun, 25 Nov 2018 18:59:51 -0600 From: Benjamin Kaduk To: soralx@cydem.org Cc: freebsd-hackers@freebsd.org Subject: Re: [bug] fsck refuses to repair damaged UFS using backup superblock Message-ID: <20181126005951.GI70217@kduck.kaduk.org> References: <20181120053000.56fbee6b@mscad14> <20181124011948.GD68416@kduck.kaduk.org> <20181123233000.51f2af51@mscad14> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181123233000.51f2af51@mscad14> User-Agent: Mutt/1.9.1 (2017-09-22) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrKIsWRmVeSWpSXmKPExsUixG6nrjvB9Xe0wZN9ShbbN/9jtHj49ACj A5PHm3nzmD1mfJrPEsAUxWWTkpqTWZZapG+XwJWx/CpvQQdHxY5HH9kaGDeydTFyckgImEis ezOPCcQWEljDJNGxJqiLkQvI3sgo8amrmxXCucsk8evVH7AqFgFVieauWywgNpuAikRD92Vm EFtEQETiy5qnYFOZBeQlHm4/A1YjLOAr8eDHP7A4L9C2izveskNsq5E48uE9K0RcUOLkzCcs EL1aEjf+vQTaxQFkS0ss/8cBEuYU0JNY9X0XWImogLLE3r5D7BMYBWYh6Z6FpHsWQvcCRuZV jLIpuVW6uYmZOcWpybrFyYl5ealFuuZ6uZkleqkppZsYwSHqorKDsbvH+xCjAAejEg/vxF+/ ooVYE8uKK3MPMUpyMCmJ8s53BArxJeWnVGYkFmfEF5XmpBYfYpTgYFYS4f1o9DtaiDclsbIq tSgfJiXNwaIkzvtH5HG0kEB6YklqdmpqQWoRTFaGg0NJgjfdBahRsCg1PbUiLTOnBCHNxMEJ MpwHaHg/SA1vcUFibnFmOkT+FKMux7sF/6czC7Hk5eelSonz/nQGKhIAKcoozYObA0otEtn7 a14xigO9Jcy7B2QUDzAtwU16BbSECWiJ/PzvIEtKEhFSUg2MxRsq1hrzCi8WC8q6331SKOmR zE6JVaZBxbFfb27+YeOhOMlr3W3N6XJ7Zlnqla+9kacuFe24tjjSuqWxJue49TUL88mvA+fo 9a9R8pP+sX8XQ4+mWWH3Ry3vD/uN34ksCVN7eW+NV6SWnRKP8vKwlPV+a603aT+tPvf5ZbO+ 943T0QePBsYosRRnJBpqMRcVJwIA9asPtggDAAA= X-Rspamd-Queue-Id: EA2697F05D X-Spamd-Result: default: False [1.35 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.97)[-0.967,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:18.7.68.0/24]; NEURAL_HAM_LONG(-0.96)[-0.962,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[mit.edu]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[36.68.7.18.list.dnswl.org : 127.0.11.2]; MX_GOOD(-0.01)[cached: dmz-mailsec-scanner-4.mit.edu]; RCPT_COUNT_TWO(0.00)[2]; RCVD_ILLEGAL_CHARS(4.00)[]; NEURAL_HAM_SHORT(-0.11)[-0.109,0]; RECEIVED_SPAMHAUS_PBL(0.00)[124.191.107.24.zen.spamhaus.org : 127.0.0.10]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:3, ipnet:18.7.0.0/16, country:US]; IP_SCORE(-0.10)[asn: 3(-0.42), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 01:05:11 -0000 On Fri, Nov 23, 2018 at 11:30:00PM -0800, soralx@cydem.org wrote: > > Ben, > > > > Since send-pr(1) is now gone, I guess the next option is to send a > > > message directly to the developers... > > I'm not sure where one would get that impression, given that > > https://www.freebsd.org/support/bugreports.html links to > > https://bugs.freebsd.org/bugzilla/enter_bug.cgi . > > I have tried the web-based bugzilla, but was greeted with > a log-in page when I went to the bug report address & no > form to report bugs. I quote from the first linked page: % An account will need to be created before a bug can be submitted. Please % note that messages sent to a mailing list are not tracked as official % problem reports, and may get lost in the noise! The system is behaving as expected. The old system (that allowed unauthenticated bug submission) was a spam magnet, and I'm given to understand that dealing with that spam inflow essentially causes burnout for all humans subjected to it. -Ben From owner-freebsd-hackers@freebsd.org Tue Nov 27 11:08:11 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13BBA1145D66; Tue, 27 Nov 2018 11:08:11 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5757671AA0; Tue, 27 Nov 2018 11:08:10 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: by mail-wm1-x343.google.com with SMTP id c126so21650815wmh.0; Tue, 27 Nov 2018 03:08:10 -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=pTOI4uxkm8PbZSHbiFzvlHtN2oBUtqapNAPLpy1x6Vs=; b=m/mx6Npds/kzR/waYIUYPvTOQZTXqOTio8YKSC6G0ytyV3dKMlnrFcyku2wgbuOryo MHbIu0Z/IUWNOL8z3kVyoaIakWXOrgia5I99D4wkIuOoAPuco42rI43MkZ9IWc0/r8Cu oKSLlFvLgdZ1LvLXre6786iohSO05ijRy6BB9C2URx0Jl/QV/Omf4tp7Z+Lu+CS7Z4/e aO+q2AY3e1W0G96MIIDCtBz6uQXoLOMQalkamTpQQCrKBfyCggABkm/kKAioxZKIDO8O fmh/qd+Fk+e2IRS5/NsKXfMh3ocqBeXtsenBIrHrrVDEGeyEhGlQbSXNEX5WMnDTdNwc 9qvw== 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=pTOI4uxkm8PbZSHbiFzvlHtN2oBUtqapNAPLpy1x6Vs=; b=gLpSTiG+HbZe9aVCGUFCkh87kewaSqHXO9pWqzVr0kvNrX7Afkh99F6a24g6VWMJ8K lE+bhgjOZHOaEminVkaPuZ2DihCRJhfproCA2DnJ2HfS0hn59HeOIzQJJjUE7CzSjioL 5dye2Jc7uwFvaTiCQHPPcZMrERAZG6bPfXZ0cDwksDovomezXEn0oxB/9TP7EcqSY/td nJdRgMqu5MavR3JGgXeeTv3UskJd1YBlC37abJdLUpY1VGK5pUma0iW0MGMSES4NMcfx Lx/PhRBVYVPIuZRGbIxgIdjqENQLJmItk88GmmmoCkhW9dT6tqKAyrVhSI8jyzaIQFYx PsSg== X-Gm-Message-State: AA+aEWa200UsX4VIn4UZTb0zRQCsqiqKa/ZBF44kb5dOCGnvaGVljG7/ W7aaib1gO3Ll0rVAhN13Jf5blqfwB+XR59mQs0b8Nbkk X-Google-Smtp-Source: AFSGD/UCTe/WcuND6T3UCTxmOOLUov3nW2rxakJxJgo/yXADtsk3SMMTy7j8nnPo+bcc5NUdyOOEvm8GjQPZFulqYUQ= X-Received: by 2002:a1c:5702:: with SMTP id l2mr25051423wmb.31.1543316888911; Tue, 27 Nov 2018 03:08:08 -0800 (PST) MIME-Version: 1.0 From: Rajesh Kumar Date: Tue, 27 Nov 2018 16:37:57 +0530 Message-ID: Subject: bus_dmamem_alloc doesn't follow alignment specified To: freebsd-drivers@freebsd.org, freebsd-hackers@freebsd.org X-Rspamd-Queue-Id: 5757671AA0 X-Spamd-Result: default: False [-2.86 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.983,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.992,0]; TO_MATCH_ENVRCPT_ALL(0.00)[]; IP_SCORE(-0.07)[ip: (2.72), ipnet: 2a00:1450::/32(-1.56), asn: 15169(-1.40), country: US(-0.09)]; NEURAL_SPAM_SHORT(0.19)[0.190,0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[3.4.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 11:08:11 -0000 Hi, I am writing a PCI-E driver, where I am trying to allocate DMA buffers. But seems, like the alignment requirements are not satisfied by bus_dmamem_alloc function. I am using stable/11 branch. *Code :* dma_setup(size, align, alimit) { printf ("size 0x%x align 0x%x alimit 0x%x\n", size, align, alimit); if (bus_dma_tag_create(parent, align, 0, alimit, BUS_SPACE_MAXADDR, NULL, NULL, size, 1, size, 0, NULL, NULL, &dma_tag)) { return (ENOMEM); } if (bus_dmamem_alloc(dma_tag, &virt_addr, BUS_DMA_WAITOK | BUS_DMA_ZERO, &dma_map)) { bus_dma_tag_destroy(dma_tag); return (ENOMEM); } if (bus_dmamap_load(dma_tag, dma_map, virt_addr, size, dma_cbfn, &arg, BUS_DMA_NOWAIT)) { bus_dmamem_free(dma_tag, virt_addr, dma_map); bus_dma_tag_destroy(mw->dma_tag); return (ENOMEM); } printf("dma_addr 0x%lx virt_addr 0x%lx\n", (uint64_t)arg->addr, (uint64_t)virt_addr); } dma_cbfn(void *tmp, bus_dma_segment_t *segs, int nsegs, int error) { struct dma_args *arg = (struct dma_args *)tmp; arg->addr = segs[0].ds_addr; } *Logs: * size 0x100000 align 0x100000 alimit 0xffffffff dma_addr *0x78e00000* virt_addr *0xfffffe1c3665f000* As seen above, dma_addr is as per alignment requirement, but virtual address from bus_dmamem_alloc doesn't seem to satisfy the alignment requirement). My understanding is both the DMA addr and the virtual address should be as per the alignment specified. Can anyone please clarify? Thanks, Rajesh. From owner-freebsd-hackers@freebsd.org Tue Nov 27 12:24:57 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5196811496E9; Tue, 27 Nov 2018 12:24:57 +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 583B676619; Tue, 27 Nov 2018 12:24:56 +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 wARCOjQ0046572 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 27 Nov 2018 14:24:48 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wARCOjQ0046572 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wARCOiMH046571; Tue, 27 Nov 2018 14:24:44 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 27 Nov 2018 14:24:44 +0200 From: Konstantin Belousov To: Rajesh Kumar Cc: freebsd-drivers@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: bus_dmamem_alloc doesn't follow alignment specified Message-ID: <20181127122444.GB2378@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 583B676619 X-Spamd-Result: default: False [-5.12 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; IP_SCORE(-2.14)[ip: (-2.62), ipnet: 2001:470::/32(-4.50), asn: 6939(-3.49), country: US(-0.09)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 12:24:57 -0000 On Tue, Nov 27, 2018 at 04:37:57PM +0530, Rajesh Kumar wrote: > Hi, > > I am writing a PCI-E driver, where I am trying to allocate DMA buffers. But > seems, like the alignment requirements are not satisfied by > bus_dmamem_alloc function. I am using stable/11 branch. > > *Code :* > dma_setup(size, align, alimit) { > > printf ("size 0x%x align 0x%x alimit 0x%x\n", size, align, alimit); > > if (bus_dma_tag_create(parent, align, 0, > alimit, BUS_SPACE_MAXADDR, > NULL, NULL, size, 1, size, > 0, NULL, NULL, &dma_tag)) { > return (ENOMEM); > } > > if (bus_dmamem_alloc(dma_tag, &virt_addr, > BUS_DMA_WAITOK | BUS_DMA_ZERO, &dma_map)) { > bus_dma_tag_destroy(dma_tag); > return (ENOMEM); > } > > if (bus_dmamap_load(dma_tag, dma_map, virt_addr, > size, dma_cbfn, &arg, BUS_DMA_NOWAIT)) { > bus_dmamem_free(dma_tag, virt_addr, dma_map); > bus_dma_tag_destroy(mw->dma_tag); > return (ENOMEM); > } > > printf("dma_addr 0x%lx virt_addr 0x%lx\n", (uint64_t)arg->addr, > (uint64_t)virt_addr); > > } > > dma_cbfn(void *tmp, bus_dma_segment_t *segs, int nsegs, int error) > { > struct dma_args *arg = (struct dma_args *)tmp; > arg->addr = segs[0].ds_addr; > } > > *Logs: * > size 0x100000 align 0x100000 alimit 0xffffffff > dma_addr *0x78e00000* virt_addr *0xfffffe1c3665f000* > > As seen above, dma_addr is as per alignment requirement, but virtual > address from bus_dmamem_alloc doesn't seem to satisfy the alignment > requirement). > > My understanding is both the DMA addr and the virtual address should be as > per the alignment specified. Can anyone please clarify? Only bus address is aligned. For single-segment i.e. contiguous allocations, amd64 could benefit from using dmap VA instead of kmem_alloc. This would be only an optimization, not done right now. From owner-freebsd-hackers@freebsd.org Tue Nov 27 17:28:03 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEDC01155794 for ; Tue, 27 Nov 2018 17:28:02 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from smtp.digiware.nl (smtp.digiware.nl [IPv6:2001:4cb8:90:ffff::3]) (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 2553589B03 for ; Tue, 27 Nov 2018 17:28:02 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from router.digiware.nl (localhost.digiware.nl [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id 03BD9B2750; Tue, 27 Nov 2018 18:28:00 +0100 (CET) X-Virus-Scanned: amavisd-new at digiware.com Received: from smtp.digiware.nl ([127.0.0.1]) by router.digiware.nl (router.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RA53knd4oQGe; Tue, 27 Nov 2018 18:27:59 +0100 (CET) Received: from [192.168.101.70] (unknown [192.168.101.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id 7B995B274F for ; Tue, 27 Nov 2018 18:27:59 +0100 (CET) To: FreeBSD Hackers From: Willem Jan Withagen Subject: setting distinct core file names Message-ID: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> Date: Tue, 27 Nov 2018 18:27:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2553589B03 X-Spamd-Result: default: False [-2.38 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.90)[-0.899,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[digiware.nl]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.93)[-0.925,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(0.00)[country: NL(0.01)]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[smtp.digiware.nl,www.digiware.nl]; NEURAL_HAM_SHORT(-0.25)[-0.245,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:28878, ipnet:2001:4cb8::/29, country:NL]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 17:28:03 -0000 Hi, Looking at core(5) and sysctl it looks like these are system wide settings.... Is there a possibility that a program can set its own corefile name (and path?) During parallel testing I'm running into these scripts that generate cores, but they end up all in the same location. But it would be nice if I could one way or another determine which file came from what script. But for that I would need to be able to set something like %N."script".core as the core name. I could then put that in then ENV of the script and the program would pick it up and set its own corefile name. Possible?? --WjW From owner-freebsd-hackers@freebsd.org Tue Nov 27 17:44:09 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 555C411560B3 for ; Tue, 27 Nov 2018 17:44:09 +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 87BAC8A72D for ; Tue, 27 Nov 2018 17:44:08 +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 wARHhtKY022072 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 27 Nov 2018 19:43:58 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wARHhtKY022072 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wARHhtQO022071; Tue, 27 Nov 2018 19:43:55 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 27 Nov 2018 19:43:55 +0200 From: Konstantin Belousov To: Willem Jan Withagen Cc: FreeBSD Hackers Subject: Re: setting distinct core file names Message-ID: <20181127174355.GC2378@kib.kiev.ua> References: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 87BAC8A72D X-Spamd-Result: default: False [-5.13 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; IP_SCORE(-2.13)[ip: (-2.60), ipnet: 2001:470::/32(-4.50), asn: 6939(-3.48), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 17:44:09 -0000 On Tue, Nov 27, 2018 at 06:27:59PM +0100, Willem Jan Withagen wrote: > Hi, > > Looking at core(5) and sysctl it looks like these are system wide > settings.... > > Is there a possibility that a program can set its own corefile name (and > path?) > > During parallel testing I'm running into these scripts that generate > cores, but they end up all in the same location. But it would be nice if > I could one way or another determine which file came from what script. > > But for that I would need to be able to set something like > %N."script".core > as the core name. I could then put that in then ENV of the script and > the program would pick it up and set its own corefile name. > > Possible?? No. Do not expect any proposal that requires kernel to read user mode environment variable to work. From owner-freebsd-hackers@freebsd.org Tue Nov 27 18:37:41 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E32841157B01 for ; Tue, 27 Nov 2018 18:37:40 +0000 (UTC) (envelope-from freebsd-lists@be-well.ilk.org) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id 669608CB7A for ; Tue, 27 Nov 2018 18:37:40 +0000 (UTC) (envelope-from freebsd-lists@be-well.ilk.org) Received: by be-well.ilk.org (Postfix, from userid 1147) id C6A2E33C1E; Tue, 27 Nov 2018 13:31:04 -0500 (EST) From: Lowell Gilbert To: Willem Jan Withagen Cc: FreeBSD Hackers Subject: Re: setting distinct core file names References: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> Reply-To: FreeBSD Hackers Date: Tue, 27 Nov 2018 13:31:04 -0500 In-Reply-To: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> (Willem Jan Withagen's message of "Tue, 27 Nov 2018 18:27:59 +0100") Message-ID: <44efb6mkyf.fsf@be-well.ilk.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 669608CB7A X-Spamd-Result: default: False [-0.97 / 15.00]; HAS_REPLYTO(0.00)[freebsd-hackers@freebsd.org]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: be-well.ilk.org]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.56)[-0.561,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-0.19)[ip: (0.08), ipnet: 23.30.0.0/15(0.04), asn: 7922(-0.99), country: US(-0.09)]; ASN(0.00)[asn:7922, ipnet:23.30.0.0/15, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.48)[-0.480,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.73)[-0.728,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[ilk.org]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 18:37:41 -0000 Willem Jan Withagen writes: > Looking at core(5) and sysctl it looks like these are system wide > settings.... > > Is there a possibility that a program can set its own corefile name > (and path?) > > During parallel testing I'm running into these scripts that generate > cores, but they end up all in the same location. But it would be nice > if I could one way or another determine which file came from what > script. > > But for that I would need to be able to set something like > %N."script".core > as the core name. I could then put that in then ENV of the script and > the program would pick it up and set its own corefile name. > > Possible?? If you can run the scripts in arbitrary paths, you can encode any extra information you need in a directory name. [I'd recommend just changing the process name, but I'm guessing that the cores themselves are being generated by something running in a subshell.] From owner-freebsd-hackers@freebsd.org Tue Nov 27 20:47:02 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 808B41137F64 for ; Tue, 27 Nov 2018 20:47:02 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f181.google.com (mail-it1-f181.google.com [209.85.166.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC1F16CBFD for ; Tue, 27 Nov 2018 20:47:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f181.google.com with SMTP id c9so753038itj.1 for ; Tue, 27 Nov 2018 12:47:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=6FJONO/2hPoeJbsqTXlHBICnuSxXLwDR+CiifNgNcbg=; b=hjFDut6MMdZe1+1K2iur7WPrKBfZMTDgAQ2jryMtdQETXHtUKlhJyfp/MMrU5mdxB5 tYaDF0dnUDyN/i7CbjF3LJUSZrWAtg9rx7E3B+ExGx3IktSUl0nH3tUS1gU8ixrJmUEp TflM6CSbopPUM2/g58GDpQ1HOKFOnAFZz9mcrBopFaBb/eFzT+7AZZ+knZTpWCttSeGF nnk6848uIJnI5DSrG5FZUQ3jBmDUCDk2ytwQLkYblEg0gKwZGn+WQC8SyLWxFzcNkRuF PlDkFP4BnnynJk1nysQUzRI7B+qrF8cjhkJz+wCTHQ1/MNISJXW2ie3oTMTuIzK+5Kq7 BFVQ== X-Gm-Message-State: AA+aEWbccGyHN+BytTKbUDXcOh0CeQdrm1ru0rd0X1jCoJAwgXtGKHkd WWi4MM9AAS7Wxy0CqjFm8OQx6u1P X-Google-Smtp-Source: AFSGD/UrCpm2zmLoKHgAZTvrVWU29PdGj7MKmHp+IUqNBaJocQ6mlD3wneeOhc6DdQVE2446ghvT+g== X-Received: by 2002:a05:660c:a45:: with SMTP id j5mr434420itl.83.1543351620434; Tue, 27 Nov 2018 12:47:00 -0800 (PST) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com. [209.85.166.45]) by smtp.gmail.com with ESMTPSA id d192sm1677822iog.81.2018.11.27.12.47.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 12:47:00 -0800 (PST) Received: by mail-io1-f45.google.com with SMTP id f6so18148634iob.1 for ; Tue, 27 Nov 2018 12:47:00 -0800 (PST) X-Received: by 2002:a5d:94cc:: with SMTP id y12mr21275969ior.233.1543351619842; Tue, 27 Nov 2018 12:46:59 -0800 (PST) MIME-Version: 1.0 References: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> In-Reply-To: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 27 Nov 2018 12:46:49 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: setting distinct core file names To: Willem Jan Withagen Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: DC1F16CBFD X-Spamd-Result: default: False [-3.96 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; IP_SCORE(-0.99)[ipnet: 209.85.128.0/17(-3.48), asn: 15169(-1.38), country: US(-0.09)]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[181.166.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[181.166.85.209.rep.mailspike.net : 127.0.0.17] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 20:47:02 -0000 One (ugly) trick is to use multiple filesystem links to the script interpreter, where the link names distinguish the scripts. E.g., $ ln /bin/sh /libexec/my_script_one_sh $ ln /bin/sh /libexec/my_script_two_sh $ cat myscript1.sh #!/libexec/my_script_one_sh ... Cores will be dumped with %N of "my_script_one_sh." Best, Conrad On Tue, Nov 27, 2018 at 9:29 AM Willem Jan Withagen wrote: > > Hi, > > Looking at core(5) and sysctl it looks like these are system wide > settings.... > > Is there a possibility that a program can set its own corefile name (and > path?) > > During parallel testing I'm running into these scripts that generate > cores, but they end up all in the same location. But it would be nice if > I could one way or another determine which file came from what script. > > But for that I would need to be able to set something like > %N."script".core > as the core name. I could then put that in then ENV of the script and > the program would pick it up and set its own corefile name. > > Possible?? > --WjW > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@freebsd.org Wed Nov 28 10:44:03 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E27D5115023D for ; Wed, 28 Nov 2018 10:44:02 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from smtp.digiware.nl (smtp.digiware.nl [IPv6:2001:4cb8:90:ffff::3]) (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 CD9BC6EEE3; Wed, 28 Nov 2018 10:44:01 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from router.digiware.nl (localhost.digiware.nl [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id 163A2B3789; Wed, 28 Nov 2018 11:43:53 +0100 (CET) X-Virus-Scanned: amavisd-new at digiware.com Received: from smtp.digiware.nl ([127.0.0.1]) by router.digiware.nl (router.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TRtlTQs-eWsZ; Wed, 28 Nov 2018 11:43:51 +0100 (CET) Received: from [192.168.10.67] (opteron [192.168.10.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id 9659AB3777; Wed, 28 Nov 2018 11:43:51 +0100 (CET) Subject: Re: setting distinct core file names To: cem@freebsd.org Cc: "freebsd-hackers@freebsd.org" References: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> From: Willem Jan Withagen Message-ID: <7b2b134c-3fd3-6212-b06a-81003361e083@digiware.nl> Date: Wed, 28 Nov 2018 11:43:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: CD9BC6EEE3 X-Spamd-Result: default: False [-4.70 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[digiware.nl]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-1.41)[ipnet: 2000::/6(-3.97), asn: 12552(-3.06), country: SE(-0.02)]; MX_GOOD(-0.01)[cached: smtp.digiware.nl]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:12552, ipnet:2000::/6, country:SE]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 10:44:03 -0000 On 27-11-2018 21:46, Conrad Meyer wrote: > One (ugly) trick is to use multiple filesystem links to the script > interpreter, where the link names distinguish the scripts. E.g., > > $ ln /bin/sh /libexec/my_script_one_sh > $ ln /bin/sh /libexec/my_script_two_sh > $ cat myscript1.sh > #!/libexec/my_script_one_sh > ... > > Cores will be dumped with %N of "my_script_one_sh." Neat trick... got to try and remember this. But it is not the shell scripts that are crashing... When running Ceph tests during Jenkins building some programs/executables intentionally crash leaving cores. Others (scripts) use some of these programs with correct input and should NOT crash. And test during startup and termination that there are no cores left. One jenkins test run takes about 4 hours when not executed in parallel. I'm testing 4 version multiple times a day to not have this huge list of PRs the go thru when testing fails. But the intentional cores and the failure cores here collide. And when I have a core program_x.core I can't tell if they are from a failure or from an intentional crash. Now if could tell per program how to name its core that would allow me to fix the problem, without overturning the complete Ceph testing infrastructure and still keep parallel tests. It would also help in that "regular" cores just keep going the way the are. So other application still have the same behaviour. And are still picked up by periodic processing. --WjW > Best, > Conrad > On Tue, Nov 27, 2018 at 9:29 AM Willem Jan Withagen wrote: >> >> Hi, >> >> Looking at core(5) and sysctl it looks like these are system wide >> settings.... >> >> Is there a possibility that a program can set its own corefile name (and >> path?) >> >> During parallel testing I'm running into these scripts that generate >> cores, but they end up all in the same location. But it would be nice if >> I could one way or another determine which file came from what script. >> >> But for that I would need to be able to set something like >> %N."script".core >> as the core name. I could then put that in then ENV of the script and >> the program would pick it up and set its own corefile name. >> >> Possible?? >> --WjW >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@freebsd.org Wed Nov 28 11:21:38 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CD6C11510E8 for ; Wed, 28 Nov 2018 11:21:38 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from smtp.digiware.nl (smtp.digiware.nl [IPv6:2001:4cb8:90:ffff::3]) (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 4E47270114; Wed, 28 Nov 2018 11:21:37 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from router.digiware.nl (localhost.digiware.nl [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id E035DB5E20; Wed, 28 Nov 2018 12:21:35 +0100 (CET) X-Virus-Scanned: amavisd-new at digiware.com Received: from smtp.digiware.nl ([127.0.0.1]) by router.digiware.nl (router.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BsaSMzjfoJCJ; Wed, 28 Nov 2018 12:21:35 +0100 (CET) Received: from [192.168.10.67] (opteron [192.168.10.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id 42CF5B5E16; Wed, 28 Nov 2018 12:21:35 +0100 (CET) Subject: Re: setting distinct core file names From: Willem Jan Withagen To: cem@freebsd.org Cc: "freebsd-hackers@freebsd.org" References: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> <7b2b134c-3fd3-6212-b06a-81003361e083@digiware.nl> Message-ID: Date: Wed, 28 Nov 2018 12:21:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <7b2b134c-3fd3-6212-b06a-81003361e083@digiware.nl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E47270114 X-Spamd-Result: default: False [-2.50 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[digiware.nl]; NEURAL_HAM_LONG(-0.97)[-0.971,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(0.00)[country: NL(0.01)]; MX_GOOD(-0.01)[cached: smtp.digiware.nl]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.33)[-0.333,0]; NEURAL_HAM_MEDIUM(-0.89)[-0.890,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:28878, ipnet:2001:4cb8::/29, country:NL]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 11:21:38 -0000 On 28-11-2018 11:43, Willem Jan Withagen wrote: > On 27-11-2018 21:46, Conrad Meyer wrote: >> One (ugly) trick is to use multiple filesystem links to the script >> interpreter, where the link names distinguish the scripts.  E.g., >> >> $ ln /bin/sh /libexec/my_script_one_sh >> $ ln /bin/sh /libexec/my_script_two_sh >> $ cat myscript1.sh >> #!/libexec/my_script_one_sh >> ... >> >> Cores will be dumped with %N of "my_script_one_sh." > > Neat trick... got to try and remember this. > But it is not the shell scripts that are crashing... > > When running Ceph tests during Jenkins building some > programs/executables intentionally crash leaving cores. > Others (scripts) use some of these programs with correct input and > should NOT crash. And test during startup and termination that there are > no cores left. > > One jenkins test run takes about 4 hours when not executed in parallel. > I'm testing 4 version multiple times a day to not have this huge list of > PRs the go thru when testing fails. > > But the intentional cores and the failure cores here collide. > And when I have a core program_x.core I can't tell if they are from a > failure or from an intentional crash. > > Now if could tell per program  how to name its core that would allow me > to fix the problem, without overturning the complete Ceph testing > infrastructure and still keep parallel tests. > > It would also help in that "regular" cores just keep going the way the > are. So other application still have the same behaviour. And are still > picked up by periodic processing. So I read a bit more about the prcctl and prctl(the Linux variant) and turns out that Linux can set PR_SET_DUMPABLE. And that is actually used in some of the Ceph applications... Being able to set this to 0 or 1 would perhaps be a nice start as well. --WjW > --WjW > >> Best, >> Conrad >> On Tue, Nov 27, 2018 at 9:29 AM Willem Jan Withagen >> wrote: >>> >>> Hi, >>> >>> Looking at core(5) and sysctl it looks like these are system wide >>> settings.... >>> >>> Is there a possibility that a program can set its own corefile name (and >>> path?) >>> >>> During parallel testing I'm running into these scripts that generate >>> cores, but they end up all in the same location. But it would be nice if >>> I could one way or another determine which file came from what script. >>> >>> But for that I would need to be able to set something like >>>          %N."script".core >>> as the core name. I could then put that in then ENV of the script and >>> the program would pick it up and set its own corefile name. From owner-freebsd-hackers@freebsd.org Wed Nov 28 14:43:42 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCE79115688C for ; Wed, 28 Nov 2018 14:43:41 +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 23B4777030; Wed, 28 Nov 2018 14:43:41 +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 wASEhSZh021297 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 28 Nov 2018 16:43:31 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wASEhSZh021297 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wASEhSgq021296; Wed, 28 Nov 2018 16:43:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 28 Nov 2018 16:43:28 +0200 From: Konstantin Belousov To: Willem Jan Withagen Cc: cem@freebsd.org, "freebsd-hackers@freebsd.org" Subject: Re: setting distinct core file names Message-ID: <20181128144328.GF2378@kib.kiev.ua> References: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> <7b2b134c-3fd3-6212-b06a-81003361e083@digiware.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 23B4777030 X-Spamd-Result: default: False [-5.12 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; IP_SCORE(-2.13)[ip: (-2.55), ipnet: 2001:470::/32(-4.50), asn: 6939(-3.49), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 14:43:42 -0000 On Wed, Nov 28, 2018 at 12:21:33PM +0100, Willem Jan Withagen wrote: > On 28-11-2018 11:43, Willem Jan Withagen wrote: > > On 27-11-2018 21:46, Conrad Meyer wrote: > >> One (ugly) trick is to use multiple filesystem links to the script > >> interpreter, where the link names distinguish the scripts.  E.g., > >> > >> $ ln /bin/sh /libexec/my_script_one_sh > >> $ ln /bin/sh /libexec/my_script_two_sh > >> $ cat myscript1.sh > >> #!/libexec/my_script_one_sh > >> ... > >> > >> Cores will be dumped with %N of "my_script_one_sh." > > > > Neat trick... got to try and remember this. > > But it is not the shell scripts that are crashing... > > > > When running Ceph tests during Jenkins building some > > programs/executables intentionally crash leaving cores. > > Others (scripts) use some of these programs with correct input and > > should NOT crash. And test during startup and termination that there are > > no cores left. > > > > One jenkins test run takes about 4 hours when not executed in parallel. > > I'm testing 4 version multiple times a day to not have this huge list of > > PRs the go thru when testing fails. > > > > But the intentional cores and the failure cores here collide. > > And when I have a core program_x.core I can't tell if they are from a > > failure or from an intentional crash. > > > > Now if could tell per program  how to name its core that would allow me > > to fix the problem, without overturning the complete Ceph testing > > infrastructure and still keep parallel tests. > > > > It would also help in that "regular" cores just keep going the way the > > are. So other application still have the same behaviour. And are still > > picked up by periodic processing. > > So I read a bit more about the prcctl and prctl(the Linux variant) and > turns out that Linux can set PR_SET_DUMPABLE. And that is actually used > in some of the Ceph applications... > > Being able to set this to 0 or 1 would perhaps be a nice start as well. Isn't setrlimit(RLIMIT_CORE, 0) enough ? It is slightly different syntax, but the idea is that you set RLIMIT_CORE to zero, then we do not even start dumping. From owner-freebsd-hackers@freebsd.org Wed Nov 28 15:27:29 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 611F71157463 for ; Wed, 28 Nov 2018 15:27:29 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from smtp.digiware.nl (smtp.digiware.nl [IPv6:2001:4cb8:90:ffff::3]) (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 899BE78323; Wed, 28 Nov 2018 15:27:28 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from router.digiware.nl (localhost.digiware.nl [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id 50770A606D; Wed, 28 Nov 2018 16:27:26 +0100 (CET) X-Virus-Scanned: amavisd-new at digiware.com Received: from smtp.digiware.nl ([127.0.0.1]) by router.digiware.nl (router.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dwf-t-vcpqWB; Wed, 28 Nov 2018 16:27:25 +0100 (CET) Received: from [192.168.101.151] (unknown [192.168.101.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id 6A855A606C; Wed, 28 Nov 2018 16:27:25 +0100 (CET) Subject: Re: setting distinct core file names To: Konstantin Belousov Cc: cem@freebsd.org, "freebsd-hackers@freebsd.org" References: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> <7b2b134c-3fd3-6212-b06a-81003361e083@digiware.nl> <20181128144328.GF2378@kib.kiev.ua> From: Willem Jan Withagen Message-ID: Date: Wed, 28 Nov 2018 16:27:26 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181128144328.GF2378@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: nl X-Rspamd-Queue-Id: 899BE78323 X-Spamd-Result: default: False [-2.77 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.97)[-0.968,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[digiware.nl]; NEURAL_HAM_MEDIUM(-0.95)[-0.945,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: smtp.digiware.nl]; NEURAL_HAM_SHORT(-0.55)[-0.551,0]; IP_SCORE(0.00)[country: NL(0.01)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:28878, ipnet:2001:4cb8::/29, country:NL]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 15:27:29 -0000 On 28/11/2018 15:43, Konstantin Belousov wrote: > On Wed, Nov 28, 2018 at 12:21:33PM +0100, Willem Jan Withagen wrote: >> On 28-11-2018 11:43, Willem Jan Withagen wrote: >>> On 27-11-2018 21:46, Conrad Meyer wrote: >>>> One (ugly) trick is to use multiple filesystem links to the script >>>> interpreter, where the link names distinguish the scripts.  E.g., >>>> >>>> $ ln /bin/sh /libexec/my_script_one_sh >>>> $ ln /bin/sh /libexec/my_script_two_sh >>>> $ cat myscript1.sh >>>> #!/libexec/my_script_one_sh >>>> ... >>>> >>>> Cores will be dumped with %N of "my_script_one_sh." >>> Neat trick... got to try and remember this. >>> But it is not the shell scripts that are crashing... >>> >>> When running Ceph tests during Jenkins building some >>> programs/executables intentionally crash leaving cores. >>> Others (scripts) use some of these programs with correct input and >>> should NOT crash. And test during startup and termination that there are >>> no cores left. >>> >>> One jenkins test run takes about 4 hours when not executed in parallel. >>> I'm testing 4 version multiple times a day to not have this huge list of >>> PRs the go thru when testing fails. >>> >>> But the intentional cores and the failure cores here collide. >>> And when I have a core program_x.core I can't tell if they are from a >>> failure or from an intentional crash. >>> >>> Now if could tell per program  how to name its core that would allow me >>> to fix the problem, without overturning the complete Ceph testing >>> infrastructure and still keep parallel tests. >>> >>> It would also help in that "regular" cores just keep going the way the >>> are. So other application still have the same behaviour. And are still >>> picked up by periodic processing. >> So I read a bit more about the prcctl and prctl(the Linux variant) and >> turns out that Linux can set PR_SET_DUMPABLE. And that is actually used >> in some of the Ceph applications... >> >> Being able to set this to 0 or 1 would perhaps be a nice start as well. > Isn't setrlimit(RLIMIT_CORE, 0) enough ? It is slightly different syntax, > but the idea is that you set RLIMIT_CORE to zero, then we do not even > start dumping. Right, At one point I think I had this code in some tests code.... I also think this is the default on the CentOS when I tested it there. So I set it from the top-shell to propagate. But then I could have run into:      [EPERM]            The limit specified to setrlimit() would have raised                         the maximum limit value, and the caller is not the                         super-user. When do wanting dumps. I'm not sure, it was quite some time ago. But that might be a nice suggestion to look into. --WjW From owner-freebsd-hackers@freebsd.org Thu Nov 29 13:36:24 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B63F113C110 for ; Thu, 29 Nov 2018 13:36:24 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from mail.infocus-llc.com (mail.infocus-llc.com [IPv6:2604:3a00:2:1::2:13]) (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 C1CD56B83D; Thu, 29 Nov 2018 13:36:23 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from draco.over-yonder.net (tunnel180062-pt.tunnel.tserv8.dal1.ipv6.he.net [IPv6:2001:470:1f0e:11ae::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.tarragon.infocus-llc.com (Postfix) with ESMTPSA id 435JT21rSDzmDq; Thu, 29 Nov 2018 07:36:22 -0600 (CST) Received: by draco.over-yonder.net (Postfix, from userid 100) id 435JT12Jr2zX0d; Thu, 29 Nov 2018 07:36:21 -0600 (CST) Date: Thu, 29 Nov 2018 07:36:21 -0600 From: "Matthew D. Fuller" To: Willem Jan Withagen Cc: cem@freebsd.org, "freebsd-hackers@freebsd.org" Subject: Re: setting distinct core file names Message-ID: <20181129133621.GF97501@over-yonder.net> References: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> <7b2b134c-3fd3-6212-b06a-81003361e083@digiware.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b2b134c-3fd3-6212-b06a-81003361e083@digiware.nl> X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: C1CD56B83D X-Spamd-Result: default: False [-3.11 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.98)[-0.978,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[over-yonder.net]; NEURAL_HAM_MEDIUM(-0.99)[-0.988,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mail.infocus-llc.com,lyra.over-yonder.net]; NEURAL_HAM_SHORT(-0.82)[-0.816,0]; IP_SCORE(-0.02)[country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:33069, ipnet:2604:3a00::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 13:36:24 -0000 On Wed, Nov 28, 2018 at 11:43:50AM +0100 I heard the voice of Willem Jan Withagen, and lo! it spake thus: > > Neat trick... got to try and remember this. > But it is not the shell scripts that are crashing... You could still make per-test hardlinks to the binary and run from them instead. -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream. From owner-freebsd-hackers@freebsd.org Fri Nov 30 14:23:33 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6585F11458F7 for ; Fri, 30 Nov 2018 14:23:33 +0000 (UTC) (envelope-from freebsd-hackers@dino.sk) Received: from mailhost.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A5E9846CE for ; Fri, 30 Nov 2018 14:23:31 +0000 (UTC) (envelope-from freebsd-hackers@dino.sk) Received: from zeta.dino.sk (fw3.dino.sk [84.245.95.254]) (AUTH: LOGIN milan) by mailhost.netlabit.sk with ESMTPA; Fri, 30 Nov 2018 15:18:20 +0100 id 00DB9424.5C0146AC.0000AE49 Date: Fri, 30 Nov 2018 15:18:20 +0100 From: Milan Obuch To: freebsd-hackers@freebsd.org Subject: EFI boot with multiple alternate boot/OS partitions - possible? Message-ID: <20181130151820.1a197589@zeta.dino.sk> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; i386-portbld-freebsd10.4) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0A5E9846CE X-Spamd-Result: default: False [-0.07 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.90)[-0.902,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dino.sk]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.65)[-0.650,0]; RCVD_TLS_LAST(0.00)[]; NEURAL_SPAM_SHORT(0.78)[0.783,0]; MX_GOOD(-0.01)[mail.dino.sk]; IP_SCORE(0.01)[country: SK(0.03)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:16160, ipnet:84.245.64.0/18, country:SK] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 14:23:33 -0000 Hi, I am working on a project using relatively simple workstation, basically web browser with custom backend, running page with javascript communicating with said backend to display status of some processes (customer's technology aka real world) being supervised. Current prototype uses UP2 board with 32 GB eMMC, where EFI BIOS is used. So far so good, everything runs to project manager's satisfaction, just there is one problem to solve - UPS is not used in order to keep installation simpler and cost lower, so I need to find a way how to run everything from read-only mounted file systems, but occasional update could be requested. It is manageable when dealing with application/libraries, both from ports and custom programms, but if OS partition is to be upgraded, maybe for security reason or the like, power outage in wrong instant could render whole system unusable. In order to minimise risks with such an upgrade, I would like to employ following scheme: (partial partition layout from gpart show) 40 409600 1 efi (200M) 409640 3145728 2 freebsd-ufs (1.5G) 3555368 3145728 3 freebsd-ufs (1.5G) 6701096 8388608 4 freebsd-swap (4.0G) (other partition for application data, cache etc) with /etc/fstab corresponding part being # Device Mountpoint FStype Options Dump Pass# /dev/sdda0p2 / ufs ro 1 1 /dev/sdda0p3 /alt ufs ro 2 2 /dev/sdda0p4 none swap sw 0 0 When upgrade request is being handled, /alt filesystem is being remount with read-write access, receives whole OS installation, relevant config files in /etc directory are being copied into /alt/etc directory, resulting in usable alternate OS copy. This can be verified for accuracy etc. and system should be switched to use partition 3 for next boot, something like nextboot command with -k option makes, but whole partition, not just directory with kernel is switched... Then partitions' roles are swapped, as /etc/fstab file in now active secondary partition would be # Device Mountpoint FStype Options Dump Pass# /dev/sdda0p2 /alt ufs ro 2 2 /dev/sdda0p3 / ufs ro 1 1 /dev/sdda0p4 none swap sw 0 0 Any ideas/hints would be appreciated, I tried to look into efibootmgr and efivar man pages, but got no clear idea how they could be used for my purpose. I do not fully understand some details of EFI boot process, so if some good material for reading is available, let me know (I did some googling, but found no definitive answers yet). Or should I modify my partitions by inserting second efi, so the result would be like 40 409600 1 efi (200M) 409640 3145728 2 freebsd-ufs (1.5G) xxxxx68 409600 3 efi (200M) xxxxx68 3145728 4 freebsd-ufs (1.5G) xxxxx96 8388608 5 freebsd-swap (4.0G) and EFI BIOS will see those two efi partitions as two independent systems allowing me to switch them with some BootOrder vars? I would like to avoid having two efi partitions, 200 MB basically wasted space is not too much in today's devices, but as the whole eMMC is 32 GB in size, it is not negligible, it could be missed sometimes... Regards, Milan From owner-freebsd-hackers@freebsd.org Fri Nov 30 16:14:42 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5E231147F70 for ; Fri, 30 Nov 2018 16:14:42 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 26EAD6A538 for ; Fri, 30 Nov 2018 16:14:42 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: by mailman.ysv.freebsd.org (Postfix) id DDAC31147F6C; Fri, 30 Nov 2018 16:14:41 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC18A1147F6A for ; Fri, 30 Nov 2018 16:14:41 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from msc13.plala.or.jp (msc13.plala.or.jp [60.36.166.23]) by mx1.freebsd.org (Postfix) with ESMTP id 519DE6A534 for ; Fri, 30 Nov 2018 16:14:39 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from localhost ([2400:4050:9320:7a00::8]) by msc13.plala.or.jp with ESMTP id <20181130161417.LVLB25242.msc13.plala.or.jp@localhost> for ; Sat, 1 Dec 2018 01:14:17 +0900 Date: Sat, 01 Dec 2018 01:14:11 +0900 (JST) Message-Id: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> To: hackers@freebsd.org Subject: How to use trim command ? From: Masachika ISHIZUKA X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-VirusScan: Outbound; mvir-ac13; Sat, 1 Dec 2018 01:14:18 +0900 X-Rspamd-Queue-Id: 26EAD6A538 X-Spamd-Result: default: False [-4.30 / 15.00]; ARC_NA(0.00)[]; FORGED_RECIPIENTS_FORWARDING(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; FORWARDED(0.00)[hackers@mailman.ysv.freebsd.org]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[plala.or.jp]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_ONE(0.00)[1]; SPF_FAIL_FORWARDING(0.00)[]; IP_SCORE(-3.61)[ip: (-9.87), ipnet: 2001:1900:2254::/48(-4.64), asn: 10310(-3.44), country: US(-0.09)]; RCVD_IN_DNSWL_MED(-0.20)[5.0.0.0.0.5.0.0.0.0.0.0.0.0.0.0.a.6.0.2.4.5.2.2.0.0.9.1.1.0.0.2.list.dnswl.org : 127.0.9.2]; MX_GOOD(-0.01)[cached: mx.plala.or.jp]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:10310, ipnet:2001:1900:2254::/48, country:US]; FORGED_RECIPIENTS(0.00)[hackers@freebsd.org,freebsd-hackers@freebsd.org] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:14:42 -0000 Hi. I'm using FreeBSD 13.0-CURRENT r341327. I want to use trim command. # trim /dev/gpt/fbroot-current trim `/dev/gpt/fbroot-current' offset 0 length 60568829952 dry run: add -f to actually perform the operation # trim -f /dev/gpt/fbroot-current trim `/dev/gpt/fbroot-current' offset 0 length 60568829952 trim: `/dev/gpt/fbroot-current': Operation not permitted carrot# echo $status 66 How can I use /usr/sbin/trim command ? P.S. My SSDs are as follows. (1) LITEONIT LMT-256M6M mSATA % dmesg | grep -i ada0 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA8-ACS SATA 3.x device ada0: Serial Number TW0XXM305508536E0419 ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 244198MB (500118192 512 byte sectors) (2) Sandisk X600 SATA % dmesg | grep -i ada0 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ACS-4 ATA SATA 3.x device ada0: Serial Number 180678800796 ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes) ada0: Command Queueing enabled ada0: 488386MB (1000215216 512 byte sectors) -- Masachika ISHIZUKA From owner-freebsd-hackers@freebsd.org Fri Nov 30 16:23:45 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B41D211486E5 for ; Fri, 30 Nov 2018 16:23:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA7416AB79 for ; Fri, 30 Nov 2018 16:23:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82e.google.com with SMTP id n21so6499611qtl.6 for ; Fri, 30 Nov 2018 08:23:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FouAgSzZz9mK1qzGMjzHP8olxPuQcnKJ3nPTYCuonCw=; b=Hu00TdQ2Z4HgjO0/rKJihpbGjokFsd1vjsp0WtFZmzIFd0NKxFIGlx/uBMQkP7FTpS MH71JniTEzPYeOknQWy+nDm4nt8XzSwj2To/x8njRqg0bjVWLVB/8iRaPG1FHmvc4DX8 JsfH/tFWqErYN4vYacvWzevVN9TjRd7Q7l0H6e5+zbAoOLLc5EbNdAKUHVBnvz6y5YGW qdjFvvlgGjJRXg4p6tAw6fqZ+k2gkux6D7gQqgPZyfk6qQtOR72H51/FKBYsaYnQXRAi oHT3jn8or2Q0lGt+/4aTWiMpVHsHH1hEEOMwBqhPsFrdoTw8gvdCON8f7bq3cXzdoW3c ouqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FouAgSzZz9mK1qzGMjzHP8olxPuQcnKJ3nPTYCuonCw=; b=glggN34m9X5COmAVRpXDJT/e7PlAhgbMRm7CxuR6tkHNmd7zw8kuA4yeAI2MVIAMWo 8Z2KNoaF0MVph8GjTt1uEEdPV0FNveyOdWmz0HfGSSeEyb+U3UA5gsSWRqgBn10Utelq fzpKXIwfhMOCazpitGS08/R8EnjRWuAqmfisyeme66KXgJ+8tXi4Ct3mOu/PvWtGVUz9 ZX1MCW1vinVPqcOJFuNRSE6i7gOm8PnhxC+dpmnTncOMqhy4on8/wRk2GBQfhEJdDGtq INksHSCaOzyX8JyfO/rFY7bwTwc1438EodcfUkXHUFkUBz0w8GvKgApBCvs6jwJC1PB0 keAQ== X-Gm-Message-State: AA+aEWb/p2M5qKfMqYRz19qAuLjG8zdNL4g7QUByVjvSt4IUARxOnITQ CNCeGBVxHYkIXCm0aDj5YfRqDHcJ3YhnOPGOxNTduDOz X-Google-Smtp-Source: AFSGD/WFYx//nVzX+Q+t9oszp1AKwPQ3ZPaqbRCD7YgtlctMbGvuGSP/OVlFxylSc4gYjU0NbuLiTA8XpkQnjH5hMjc= X-Received: by 2002:a05:6214:1087:: with SMTP id o7mr6254388qvr.115.1543595022771; Fri, 30 Nov 2018 08:23:42 -0800 (PST) MIME-Version: 1.0 References: <20181130151820.1a197589@zeta.dino.sk> In-Reply-To: <20181130151820.1a197589@zeta.dino.sk> From: Warner Losh Date: Fri, 30 Nov 2018 09:23:31 -0700 Message-ID: Subject: Re: EFI boot with multiple alternate boot/OS partitions - possible? To: freebsd-hackers@dino.sk Cc: "freebsd-hackers@freebsd.org" X-Rspamd-Queue-Id: DA7416AB79 X-Spamd-Result: default: False [-2.32 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; NEURAL_HAM_MEDIUM(-0.88)[-0.884,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_SHORT(-0.86)[-0.860,0]; NEURAL_HAM_LONG(-0.93)[-0.935,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[e.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; IP_SCORE(-0.63)[ipnet: 2607:f8b0::/32(-1.74), asn: 15169(-1.34), country: US(-0.09)]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:23:45 -0000 On Fri, Nov 30, 2018 at 7:26 AM Milan Obuch wrote: > Hi, > > I am working on a project using relatively simple workstation, > basically web browser with custom backend, running page with javascript > communicating with said backend to display status of some processes > (customer's technology aka real world) being supervised. Current > prototype uses UP2 board with 32 GB eMMC, where EFI BIOS is used. > > So far so good, everything runs to project manager's satisfaction, just > there is one problem to solve - UPS is not used in order to keep > installation simpler and cost lower, so I need to find a way how to run > everything from read-only mounted file systems, but occasional update > could be requested. > > It is manageable when dealing with application/libraries, both from > ports and custom programms, but if OS partition is to be upgraded, > maybe for security reason or the like, power outage in wrong instant > could render whole system unusable. In order to minimise risks with > such an upgrade, I would like to employ following scheme: > > (partial partition layout from gpart show) > > 40 409600 1 efi (200M) > 409640 3145728 2 freebsd-ufs (1.5G) > 3555368 3145728 3 freebsd-ufs (1.5G) > 6701096 8388608 4 freebsd-swap (4.0G) > > (other partition for application data, cache etc) > > with /etc/fstab corresponding part being > > # Device Mountpoint FStype Options Dump Pass# > /dev/sdda0p2 / ufs ro 1 1 > /dev/sdda0p3 /alt ufs ro 2 2 > /dev/sdda0p4 none swap sw 0 0 > > When upgrade request is being handled, /alt filesystem is being remount > with read-write access, receives whole OS installation, relevant config > files in /etc directory are being copied into /alt/etc directory, > resulting in usable alternate OS copy. This can be verified for > accuracy etc. and system should be switched to use partition 3 for > next boot, something like nextboot command with -k option makes, but > whole partition, not just directory with kernel is switched... > > Then partitions' roles are swapped, as /etc/fstab file in now active > secondary partition would be > > # Device Mountpoint FStype Options Dump Pass# > /dev/sdda0p2 /alt ufs ro 2 2 > /dev/sdda0p3 / ufs ro 1 1 > /dev/sdda0p4 none swap sw 0 0 > > Any ideas/hints would be appreciated, I tried to look into efibootmgr > and efivar man pages, but got no clear idea how they could be used for > my purpose. I do not fully understand some details of EFI boot process, > so if some good material for reading is available, let me know (I did > some googling, but found no definitive answers yet). > efibootmgr is what you want, though if it's under-documented we should fix that. Assuming that p1 is the ESP, you should be able to do: efibootmgr -c -l ssd0p1:/efi/freebsd/loader.efi -k ssd0p3:/boot/kernel/kernel -b 10 -a efibootmgr -c -l ssd0p1:/efi/freebsd/loader.efi -k ssd0p2:/boot/kernel/kernel -b 11 -a this will setup Boot0010 and Boot0011. You can then set the order either with efibootmgr -o or efibootmgr -n. In theory you can also use the full unix path for the -k and -l lines if things are mounted, but I hadn't fixed all the weird edge cases with that which kept cropping up (I think they are are fixed since I can't recreate the problems, but I'm not 100% sure). Extra caveat: This only works for UEFI implementations that have persistent env vars. And non-broken UEFI BootMgr implementations. Supermicro has a broken one that one needs to work around in various ugly ways (they won't fix it, since they think it's a feature, but they are wrong). Warner > Or should I modify my partitions by inserting second efi, so the result > would be like > > 40 409600 1 efi (200M) > 409640 3145728 2 freebsd-ufs (1.5G) > xxxxx68 409600 3 efi (200M) > xxxxx68 3145728 4 freebsd-ufs (1.5G) > xxxxx96 8388608 5 freebsd-swap (4.0G) > > and EFI BIOS will see those two efi partitions as two independent > systems allowing me to switch them with some BootOrder vars? I would > like to avoid having two efi partitions, 200 MB basically wasted space > is not too much in today's devices, but as the whole eMMC is 32 GB in > size, it is not negligible, it could be missed sometimes... > > Regards, > Milan > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@freebsd.org Fri Nov 30 16:45:14 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 244E7114955A for ; Fri, 30 Nov 2018 16:45:14 +0000 (UTC) (envelope-from freebsd-hackers@dino.sk) Received: from mailhost.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A77D6BED5 for ; Fri, 30 Nov 2018 16:45:12 +0000 (UTC) (envelope-from freebsd-hackers@dino.sk) Received: from zeta.dino.sk (fw3.dino.sk [84.245.95.254]) (AUTH: LOGIN milan) by mailhost.netlabit.sk with ESMTPA; Fri, 30 Nov 2018 17:45:10 +0100 id 00DB9422.5C016916.0000BB37 Date: Fri, 30 Nov 2018 17:45:10 +0100 From: Milan Obuch To: Warner Losh Cc: freebsd-hackers@freebsd.org Subject: Re: EFI boot with multiple alternate boot/OS partitions - possible? Message-ID: <20181130174510.2944ffae@zeta.dino.sk> In-Reply-To: References: <20181130151820.1a197589@zeta.dino.sk> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; i386-portbld-freebsd10.4) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 1A77D6BED5 X-Spamd-Result: default: False [-0.61 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.89)[-0.895,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.80)[-0.800,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dino.sk]; NEURAL_SPAM_SHORT(0.39)[0.390,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mail.dino.sk]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(0.01)[country: SK(0.03)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:16160, ipnet:84.245.64.0/18, country:SK]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 16:45:14 -0000 On Fri, 30 Nov 2018 09:23:31 -0700 Warner Losh wrote: > On Fri, Nov 30, 2018 at 7:26 AM Milan Obuch > wrote: [ snip ] > > It is manageable when dealing with application/libraries, both from > > ports and custom programms, but if OS partition is to be upgraded, > > maybe for security reason or the like, power outage in wrong instant > > could render whole system unusable. In order to minimise risks with > > such an upgrade, I would like to employ following scheme: > > > > (partial partition layout from gpart show) > > > > 40 409600 1 efi (200M) > > 409640 3145728 2 freebsd-ufs (1.5G) > > 3555368 3145728 3 freebsd-ufs (1.5G) > > 6701096 8388608 4 freebsd-swap (4.0G) > > > > (other partition for application data, cache etc) > > > > with /etc/fstab corresponding part being > > > > # Device Mountpoint FStype Options Dump Pass# > > /dev/sdda0p2 / ufs ro 1 1 > > /dev/sdda0p3 /alt ufs ro 2 2 > > /dev/sdda0p4 none swap sw 0 0 > > > > When upgrade request is being handled, /alt filesystem is being > > remount with read-write access, receives whole OS installation, > > relevant config files in /etc directory are being copied > > into /alt/etc directory, resulting in usable alternate OS copy. > > This can be verified for accuracy etc. and system should be > > switched to use partition 3 for next boot, something like nextboot > > command with -k option makes, but whole partition, not just > > directory with kernel is switched... > > > > Then partitions' roles are swapped, as /etc/fstab file in now active > > secondary partition would be > > > > # Device Mountpoint FStype Options Dump Pass# > > /dev/sdda0p2 /alt ufs ro 2 2 > > /dev/sdda0p3 / ufs ro 1 1 > > /dev/sdda0p4 none swap sw 0 0 > > > > Any ideas/hints would be appreciated, I tried to look into > > efibootmgr and efivar man pages, but got no clear idea how they > > could be used for my purpose. I do not fully understand some > > details of EFI boot process, so if some good material for reading > > is available, let me know (I did some googling, but found no > > definitive answers yet). > > efibootmgr is what you want, though if it's under-documented we > should fix that. Assuming that p1 is the ESP, you should be able to > do: > > efibootmgr -c -l ssd0p1:/efi/freebsd/loader.efi -k > ssd0p3:/boot/kernel/kernel -b 10 -a > efibootmgr -c -l ssd0p1:/efi/freebsd/loader.efi -k > ssd0p2:/boot/kernel/kernel -b 11 -a > > this will setup Boot0010 and Boot0011. > > You can then set the order either with efibootmgr -o or efibootmgr > -n. In theory you can also use the full unix path for the -k and -l > lines if things are mounted, but I hadn't fixed all the weird edge > cases with that which kept cropping up (I think they are are fixed > since I can't recreate the problems, but I'm not 100% sure). > Thank you for quick reply! Yes, this looks really well, so I test what you wrote to verify it (and learn a bit more, again). This just fills one gap in my undestanding the process of UEFI boot. I try to read our man pages again, and if verified successfully, write something to document this usage. Once again, big thanks! Regards, Milan From owner-freebsd-hackers@freebsd.org Fri Nov 30 20:32:54 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17AF8114FBB4 for ; Fri, 30 Nov 2018 20:32:54 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 893317697A for ; Fri, 30 Nov 2018 20:32:53 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: by mailman.ysv.freebsd.org (Postfix) id 4C37A114FBAE; Fri, 30 Nov 2018 20:32:53 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A79F114FBAD for ; Fri, 30 Nov 2018 20:32:53 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 32A777696A for ; Fri, 30 Nov 2018 20:32:41 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wAUKWTFU029746 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Nov 2018 21:32:30 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: ish@amail.plala.or.jp Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wAUKWSX0006207 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 1 Dec 2018 03:32:28 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: How to use trim command ? To: Masachika ISHIZUKA , hackers@freebsd.org References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> From: Eugene Grosbein Message-ID: <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> Date: Sat, 1 Dec 2018 03:32:17 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 893317697A X-Spamd-Result: default: False [-5.25 / 15.00]; ARC_NA(0.00)[]; FORGED_RECIPIENTS_FORWARDING(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; MX_INVALID(0.50)[cached]; FROM_HAS_DN(0.00)[]; FORWARDED(0.00)[hackers@mailman.ysv.freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-3.61)[ip: (-9.87), ipnet: 2001:1900:2254::/48(-4.64), asn: 10310(-3.43), country: US(-0.09)]; R_SPF_PERMFAIL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_MED(-0.20)[5.0.0.0.0.5.0.0.0.0.0.0.0.0.0.0.a.6.0.2.4.5.2.2.0.0.9.1.1.0.0.2.list.dnswl.org : 127.0.9.2]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:10310, ipnet:2001:1900:2254::/48, country:US]; FORGED_RECIPIENTS(0.00)[ish@amail.plala.or.jp ..,freebsd-hackers@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 20:32:54 -0000 30.11.2018 23:14, Masachika ISHIZUKA wrote: > I'm using FreeBSD 13.0-CURRENT r341327. > I want to use trim command. > > # trim /dev/gpt/fbroot-current > trim `/dev/gpt/fbroot-current' offset 0 length 60568829952 > dry run: add -f to actually perform the operation > # trim -f /dev/gpt/fbroot-current > trim `/dev/gpt/fbroot-current' offset 0 length 60568829952 > trim: `/dev/gpt/fbroot-current': Operation not permitted > carrot# echo $status > 66 > > How can I use /usr/sbin/trim command ? It seems this partition is in use (mounted?) and GEOM won't allow to write to opened partition, you need to close it first (unmount). Be warned: trim will destroy all data in the partition. From owner-freebsd-hackers@freebsd.org Fri Nov 30 23:57:14 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EAED1153C6A for ; Fri, 30 Nov 2018 23:57:14 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id E1BE77D44F for ; Fri, 30 Nov 2018 23:57:13 +0000 (UTC) (envelope-from ian@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id A4FAD1153C69; Fri, 30 Nov 2018 23:57:13 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8256A1153C68 for ; Fri, 30 Nov 2018 23:57:13 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (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 E2D727D44D for ; Fri, 30 Nov 2018 23:57:12 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1543622214; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=r1eLDrWGSJxAEihZhfO6+27gHUARIUiQDds+A+vJKesOAsHuaqwIy+MLpiU0r7Ech8xM+l07GlR/D 7xjAL4jiH2wtbh7HvgzG2eiZ7+r8L4NMy1p9GPvldRXgEpzkxNMHJ60FOLXZQpZ/zJvIPOAFCLGVSm XtFvpSM2tBUncxze68Q1SkBmFEfzi/LwoylOlDP/oeIppNJwNsYj3x8tgUwXGcWA0vxZ/V3fXn/mov PcOSy2a16Zu0R5t3RlpOCmv8hsQAeBu4lzYdhR+4eSy4f+sMgxxSxwloI/zalwB5z0QSerif1BewtQ XehL5ArnIXdEO4Sf+q82gOrPUeEr8pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=QYMc44axdUGBiJIZ4eWxRNzccQTcKk9l/aGzzTBSq4I=; b=VrAcgD5UL86KtKVvXodxCqKb/wTsAjMF0v3wlNi336XhZIyAlFVQbBpZleMwDWIB/yvzSblKs4E1A WJUml0e5TNtqUPArdyw5Bo51JGZlzzOySwIq480/qISqTzJ7JWw8FdOA/sd7Lrz8J2VoS64DLesWgL zDCpM51P+pil9bbiyfJCDsJvuHm1/Sg/UUgnuJcLk/DATSjyJAxJCrWHSUuhaHkMvxLwVfsAlBxCWB au99m8VKV6RJCgzCeRLPlMzPVY1PsMN8oCcxgr7jFy0lu86/wokI6nicY7jHE/SjIqQSY9F18EtxTh GOXOvBcBLppvSwfsSP4h5ra8AOdDV2Q== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=QYMc44axdUGBiJIZ4eWxRNzccQTcKk9l/aGzzTBSq4I=; b=l9k/dcIqAmAOqmr4aGhbrz9jY6+vGN1d2QpvLUVouCCKAHywm7D0i8/2rZxe4TKGGQF3G1wUZ+2KS PcYwZs5RqM/qzMw/mra2tnler8zJcaW87Hl/Bq2fp4TJAoA2XcjGtQijnL0it3UjPWuieNlyx8XDEj Ptg9QSyuGp5RYDmx77oabQPnRcS7dNvQGq/3ynMp1KX3JAudXcbaoa0E8C0wO34Xn+/9Gh2ve66hVm yPd+PQTlZQe3soUmp/q0jHYMDpWjGN7EQHurq+IGGfeLi9Fs3/YbVT3sLKu68Xops8bSNiW9rnTlOJ a+Al22XNt4U04Uet4+ncxmp1Tl7KtYw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 9a392ab1-f4fb-11e8-a59a-7b143e15dabc X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 9a392ab1-f4fb-11e8-a59a-7b143e15dabc; Fri, 30 Nov 2018 23:56:53 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wAUNuwD5045243; Fri, 30 Nov 2018 16:57:00 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1543622218.1860.169.camel@freebsd.org> Subject: Re: How to use trim command ? From: Ian Lepore To: Eugene Grosbein , Masachika ISHIZUKA , hackers@freebsd.org Date: Fri, 30 Nov 2018 16:56:58 -0700 In-Reply-To: <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> 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-Rspamd-Queue-Id: E1BE77D44F X-Spamd-Result: default: False [0.67 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.12)[0.124,0]; NEURAL_SPAM_MEDIUM(0.49)[0.494,0]; ASN(0.00)[asn:10310, ipnet:2001:1900:2254::/48, country:US]; NEURAL_SPAM_SHORT(0.05)[0.051,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 23:57:14 -0000 On Sat, 2018-12-01 at 03:32 +0700, Eugene Grosbein wrote: > 30.11.2018 23:14, Masachika ISHIZUKA wrote: > > > > >   I'm using FreeBSD 13.0-CURRENT r341327. > >   I want to use trim command. > > > > # trim /dev/gpt/fbroot-current > > trim `/dev/gpt/fbroot-current' offset 0 length 60568829952 > > dry run: add -f to actually perform the operation > > # trim -f /dev/gpt/fbroot-current > > trim `/dev/gpt/fbroot-current' offset 0 length 60568829952 > > trim: `/dev/gpt/fbroot-current': Operation not permitted > > carrot# echo $status > > 66 > > > >   How can I use /usr/sbin/trim command ? > It seems this partition is in use (mounted?) and GEOM won't allow to > write > to opened partition, you need to close it first (unmount). > Be warned: trim will destroy all data in the partition. And therein lies yet another reason why trim is such a horrible name for this tool: nothing about the word trim implies destroying live useful information. In idiomatic English, the word drips with overtones of removing only the unneeded excess from something. Truly, dd (with its 30+ years of association of being THE tool that operates on disk devices or specified sub-ranges of blocks within them) is the place for such functionality. -- Ian From owner-freebsd-hackers@freebsd.org Sat Dec 1 00:32:27 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5524811548DD for ; Sat, 1 Dec 2018 00:32:27 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id B7B7C7E4C5 for ; Sat, 1 Dec 2018 00:32:26 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: by mailman.ysv.freebsd.org (Postfix) id 7AC9A11548DC; Sat, 1 Dec 2018 00:32:26 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6768B11548DB for ; Sat, 1 Dec 2018 00:32:26 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from msc13.plala.or.jp (msc13.plala.or.jp [60.36.166.23]) by mx1.freebsd.org (Postfix) with ESMTP id E40C47E4BF for ; Sat, 1 Dec 2018 00:32:24 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from localhost ([2400:4050:9320:7a00::8]) by msc13.plala.or.jp with ESMTP id <20181201003222.LZZY25242.msc13.plala.or.jp@localhost> for ; Sat, 1 Dec 2018 09:32:22 +0900 Date: Sat, 01 Dec 2018 09:31:53 +0900 (JST) Message-Id: <20181201.093153.893601099798031027.ish@amail.plala.or.jp> To: hackers@freebsd.org Subject: Re: How to use trim command ? From: Masachika ISHIZUKA In-Reply-To: <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-VirusScan: Outbound; mvir-ac13; Sat, 1 Dec 2018 09:32:22 +0900 X-Rspamd-Queue-Id: B7B7C7E4C5 X-Spamd-Result: default: False [-4.30 / 15.00]; ARC_NA(0.00)[]; FORGED_RECIPIENTS_FORWARDING(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; FORWARDED(0.00)[hackers@mailman.ysv.freebsd.org]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[plala.or.jp]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_ONE(0.00)[1]; SPF_FAIL_FORWARDING(0.00)[]; IP_SCORE(-3.60)[ip: (-9.87), ipnet: 2001:1900:2254::/48(-4.63), asn: 10310(-3.43), country: US(-0.09)]; RCVD_IN_DNSWL_MED(-0.20)[5.0.0.0.0.5.0.0.0.0.0.0.0.0.0.0.a.6.0.2.4.5.2.2.0.0.9.1.1.0.0.2.list.dnswl.org : 127.0.9.2]; MX_GOOD(-0.01)[cached: mx.plala.or.jp]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:10310, ipnet:2001:1900:2254::/48, country:US]; FORGED_RECIPIENTS(0.00)[hackers@freebsd.org,freebsd-hackers@freebsd.org] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 00:32:27 -0000 >> I'm using FreeBSD 13.0-CURRENT r341327. >> I want to use trim command. > > It seems this partition is in use (mounted?) and GEOM won't allow to write > to opened partition, you need to close it first (unmount). > Be warned: trim will destroy all data in the partition. Thank you for reply. I misunderstood trim was equivalent to fstrim in linux. I undotstood that the trim command is the SSD bulk erase tool. -- Masachika ISHIZUKA From owner-freebsd-hackers@freebsd.org Sat Dec 1 00:36:38 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21D771154B34 for ; Sat, 1 Dec 2018 00:36:38 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 9183D7E9A2 for ; Sat, 1 Dec 2018 00:36:37 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: by mailman.ysv.freebsd.org (Postfix) id 519E81154B31; Sat, 1 Dec 2018 00:36:37 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FDE01154B30 for ; Sat, 1 Dec 2018 00:36:37 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E64D7E998; Sat, 1 Dec 2018 00:36:26 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id wB10aEs1031429 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 1 Dec 2018 01:36:15 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: ian@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id wB10aDgd009985 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 1 Dec 2018 07:36:13 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: How to use trim command ? To: Ian Lepore , Masachika ISHIZUKA , hackers@freebsd.org References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> <1543622218.1860.169.camel@freebsd.org> From: Eugene Grosbein Message-ID: Date: Sat, 1 Dec 2018 07:36:01 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1543622218.1860.169.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 9183D7E9A2 X-Spamd-Result: default: False [-5.29 / 15.00]; ARC_NA(0.00)[]; FORGED_RECIPIENTS_FORWARDING(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; MX_INVALID(0.50)[cached]; FROM_HAS_DN(0.00)[]; FORWARDED(0.00)[hackers@mailman.ysv.freebsd.org]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-3.60)[ip: (-9.87), ipnet: 2001:1900:2254::/48(-4.63), asn: 10310(-3.43), country: US(-0.09)]; R_SPF_PERMFAIL(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[5.0.0.0.0.5.0.0.0.0.0.0.0.0.0.0.a.6.0.2.4.5.2.2.0.0.9.1.1.0.0.2.list.dnswl.org : 127.0.9.2]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:10310, ipnet:2001:1900:2254::/48, country:US]; FORGED_RECIPIENTS(0.00)[ian@freebsd.org ..,freebsd-hackers@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 00:36:38 -0000 01.12.2018 6:56, Ian Lepore wrote: > And therein lies yet another reason why trim is such a horrible name > for this tool: nothing about the word trim implies destroying live > useful information. In idiomatic English, the word drips with overtones > of removing only the unneeded excess from something. That's because it defaults to dry run and its manual pages emphasizes data imminent destruction several times, in bold. newfs destroys data too, cat > /dev/da0 does this too, add the name "dd" itself does not imply data destruction. Can you invent better name? > Truly, dd (with its 30+ years of association of being THE tool that > operates on disk devices or specified sub-ranges of blocks within them) > is the place for such functionality. In fact, I like both. Sometimes it's handy to use dd while dealing with zero blocks inside an image (or /dev/zero) written to single device file. And sometimes it may be useful to be able to "trim /dev/da0 /dev/ada0" with one call. From owner-freebsd-hackers@freebsd.org Sat Dec 1 03:11:14 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1688E115A12B for ; Sat, 1 Dec 2018 03:11:14 +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 90E4C84DA7 for ; Sat, 1 Dec 2018 03:11:13 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 576441CAC2 for ; Sat, 1 Dec 2018 03:11:07 +0000 (UTC) To: freebsd-hackers@freebsd.org References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> <20181201.093153.893601099798031027.ish@amail.plala.or.jp> From: Allan Jude Openpgp: preference=signencrypt Autocrypt: addr=allanjude@freebsd.org; prefer-encrypt=mutual; keydata= xsFNBFVwZcYBEADwrZDH0xe0ZVjc9ORCc6PcBLwS/RTXA6NkvpD6ea02pZ8lPOVgteuuugFc D34LdDbiWr+479vfrKBh+Y38GL0oZ0/13j10tIlDMHSa5BU0y6ACtnhupFvVlQ57+XaJAb/q 7qkfSiuxVwQ3FY3PL3cl1RrIP5eGHLA9hu4eVbu+FOX/q/XVKz49HaeIaxzo2Q54572VzIo6 C28McX9m65UL5fXMUGJDDLCItLmehZlHsQQ+uBxvODLFpVV2lUgDR/0rDa0B9zHZX8jY8qQ7 ZdCSy7CwClXI054CkXZCaBzgxYh/CotdI8ezmaw7NLs5vWNTxaDEFXaFMQtMVhvqQBpHkfOD 7rjjOmFw00nJL4FuPE5Yut0CPyx8vLjVmNJSt/Y8WxxmhutsqJYFgYfWl/vaWkrFLur/Zcmz IklwLw35HLsCZytCN5A3rGKdRbQjD6QPXOTJu0JPrJF6t2xFkWAT7oxnSV0ELhl2g+JfMMz2 Z1PDmS3NRnyEdqEm7NoRGXJJ7bgxDbN+9SXTyOletqGNXj/bSrBvhvZ0RQrzdHAPwQUfVSU2 qBhQEi2apSZstgVNMan0GUPqCdbE2zpysg+zT7Yhvf9EUQbzPL4LpdK1llT9fZbrdMzEXvEF oSvwJFdV3sqKmZc7b+E3PuxK6GTsKqaukd/3Cj8aLHG1T1im1QARAQABzSJBbGxhbiBKdWRl IDxhbGxhbmp1ZGVAZnJlZWJzZC5vcmc+wsF/BBMBAgApBQJVcGXGAhsjBQkSzAMABwsJCAcD AgEGFQgCCQoLBBYCAwECHgECF4AACgkQGZU1PhKYC34Muw/+JOKpSfhhysWFYiRXynGRDe07 Z6pVsn7DzrPUMRNZfHu8Uujmmy3p2nx9FelIY9yjd2UKHhug+whM54MiIFs90eCRVa4XEsPR 4FFAm0DAWrrb7qhZFcE/GhHdRWpZ341WAElWf6Puj2devtRjfYbikvj5+1V1QmDbju7cEw5D mEET44pTuD2VMRJpu2yZZzkM0i+wKFuPxlhqreufA1VNkZXI/rIfkYWK+nkXd9Efw3YdCyCQ zUgTUCb88ttSqcyhik/li1CDbXBpkzDCKI6I/8fAb7jjOC9LAtrZJrdgONywcVFoyK9ZN7EN AVA+xvYCmuYhR/3zHWH1g4hAm1v1+gIsufhajhfo8/wY1SetlzPaYkSkVQLqD8T6zZyhf+AN bC7ci44UsiKGAplB3phAXrtSPUEqM86kbnHg3fSx37kWKUiYNOnx4AC2VXvEiKsOBlpyt3dw WQbOtOYM+vkfbBwDtoGOOPYAKxc4LOIt9r+J8aD+gTooi9Eo5tvphATf9WkCpl9+aaGbSixB tUpvQMRnSMqTqq4Z7DeiG6VMRQIjsXDSLJEUqcfhnLFo0Ko/RiaHd5xyAQ4DhQ9QpkyQjjNf /3f/dYG7JAtoD30txaQ5V8uHrz210/77DRRX+HJjEj6xCxWUGvQgvEZf5XXyxeePvqZ+zQyT DX61bYw6w6bOwU0EVXBlxgEQAMy7YVnCCLN4oAOBVLZ5nUbVPvpUhsdA94/0/P+uqCIh28Cz ar56OCX0X19N/nAWecxL4H32zFbIRyDB2V/MEh4p9Qvyu/j4i1r3Ex5GhOT2hnit43Ng46z5 29Es4TijrHJP4/l/rB2VOqMKBS7Cq8zk1cWqaI9XZ59imxDNjtLLPPM+zQ1yE3OAMb475QwN UgWxTMw8rkA7CEaqeIn4sqpTSD5C7kT1Bh26+rbgJDZ77D6Uv1LaCZZOaW52okW3bFbdozV8 yM2u+xz2Qs8bHz67p+s+BlygryiOyYytpkiK6Iy4N7FTolyj5EIwCuqzfk0SaRHeOKX2ZRjC qatkgoD/t13PNT38V9tw3qZVOJDS0W6WM8VSg+F+bkM9LgJ8CmKV+Hj0k3pfGfYPOZJ/v18i +SmZmL/Uw2RghnwDWGAsPCKu4uZR777iw7n9Io6Vfxndw2dcS0e9klvFYoaGS6H2F13Asygr WBzFNGFQscN4mUW+ZYBzpTOcHkdT7w8WS55BmXYLna+dYer9/HaAuUrONjujukN4SPS1fMJ2 /CS/idAUKyyVVX5vozoNK2JVC1h1zUAVsdnmhEzNPsvBoqcVNfyqBFROEVLIPwq+lQMGNVjH ekLTKRWf59MEhUC2ztjSKkGmwdg73d6xSXMuq45EgIJV2wPvOgWQonoHH/kxABEBAAHCwWUE GAECAA8FAlVwZcYCGwwFCRLMAwAACgkQGZU1PhKYC34w5A//YViBtZyDV5O+SJT9FFO3lb9x Zdxf0trA3ooCt7gdBkdnBM6T5EmjgVZ3KYYyFfwXZVkteuCCycMF/zVw5eE9FL1+zz9gg663 nY9q2F77TZTKXVWOLlOV2bY+xaK94U4ytogOGhh9b4UnQ/Ct3+6aviCF78Go608BXbmF/GVT 7uhddemk7ItxM1gE5Hscx3saxGKlayaOsdPKeGTVJCDEtHDuOc7/+jGh5Zxpk/Hpi+DUt1ot 8e6hPYLIQa4uVx4f1xxxV858PQ7QysSLr9pTV7FAQ18JclCaMc7JWIa3homZQL/MNKOfST0S 2e+msuRwQo7AnnfFKBUtb02KwpA4GhWryhkjUh/kbVc1wmGxaU3DgXYQ5GV5+Zf4kk/wqr/7 KG0dkTz6NLCVLyDlmAzuFhf66DJ3zzz4yIo3pbDYi3HB/BwJXVSKB3Ko0oUo+6/qMrOIS02L s++QE/z7K12CCcs7WwOjfCYHK7VtE0Sr/PfybBdTbuDncOuAyAIeIKxdI2nmQHzl035hhvQX s4CSghsP319jAOQiIolCeSbTMD4QWMK8RL/Pe1FI1jC3Nw9s+jq8Dudtbcj2UwAP/STUEbJ9 5rznzuuhPjE0e++EU/RpWmcaIMK/z1zZDMN+ce2v1qzgV936ZhJ3iaVzyqbEE81gDxg3P+IM kiYh4ZtPB4Q= Subject: Re: How to use trim command ? Message-ID: <1c7139bd-258c-e7d2-2572-052da3803b3b@freebsd.org> Date: Fri, 30 Nov 2018 22:11:03 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: <20181201.093153.893601099798031027.ish@amail.plala.or.jp> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vjvPeIPvmlhKGhFqOg4wpwU6wFjzugN23" X-Rspamd-Queue-Id: 90E4C84DA7 X-Spamd-Result: default: False [1.89 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.60)[0.605,0]; NEURAL_SPAM_MEDIUM(0.50)[0.503,0]; ASN(0.00)[asn:6939, ipnet:209.51.160.0/19, country:US]; NEURAL_SPAM_SHORT(0.78)[0.782,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 03:11:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vjvPeIPvmlhKGhFqOg4wpwU6wFjzugN23 Content-Type: multipart/mixed; boundary="ooQR7IA48vWSxYni6kZKmE7q6v76f972L"; protected-headers="v1" From: Allan Jude To: freebsd-hackers@freebsd.org Message-ID: <1c7139bd-258c-e7d2-2572-052da3803b3b@freebsd.org> Subject: Re: How to use trim command ? References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> <20181201.093153.893601099798031027.ish@amail.plala.or.jp> In-Reply-To: <20181201.093153.893601099798031027.ish@amail.plala.or.jp> --ooQR7IA48vWSxYni6kZKmE7q6v76f972L Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-11-30 19:31, Masachika ISHIZUKA wrote: >>> I'm using FreeBSD 13.0-CURRENT r341327. >>> I want to use trim command. >> >> It seems this partition is in use (mounted?) and GEOM won't allow to w= rite >> to opened partition, you need to close it first (unmount). >> Be warned: trim will destroy all data in the partition. >=20 > Thank you for reply. >=20 > I misunderstood trim was equivalent to fstrim in linux. > I undotstood that the trim command is the SSD bulk erase tool. >=20 If you want to enable TRIM on a UFS filesystem, tunefs is the command you are looking for. The equivalent to fstrim for UFS is fsck_ffs -E: Clear unallocated blocks, notifying the underlying device that they are not used and that their contents may be discarded. This is useful for filesystems which have been mounted on systems without TRIM support, or with TRIM support disabled, as well as filesystems which have been copied from one device to another. See also the -E and -t flags of newfs(8), and the -t flag of tunefs(8). --=20 Allan Jude --ooQR7IA48vWSxYni6kZKmE7q6v76f972L-- --vjvPeIPvmlhKGhFqOg4wpwU6wFjzugN23 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) iQIcBAEBAgAGBQJcAfvKAAoJEBmVNT4SmAt+1LwP/1qkW+dH5ri7/2CoGEFs1CTu CHRDIoCebpIEEopQ3xNYwZHEUAeelAqgT8PQjUrHoDBazsRBMrsG2Z37zXWP3ore gEVVl/JIVm4bhPGcgAVAWw1gfQ0TyzWVbc99bUyXJHFpWCqdWBWa62xLZZ6tnlTh AZK04SwlQ/nhDsnM490xSVDsxjaPyG4O61/IJmhwkdieXAdDC5QpOaaW2JkrQpfJ R4OjRrr5eCATcMBn2sIBngXg46XFrOPz1S9wop3OeIHO1Xnz2W3STZcOMrhCFboE R8YDwlNPyHwTsVhoDItUSpVlXgfXXwODGsgeTrnzoKuc8c4KTD2hsvoJDJbT1L8z 4wFFmypoMNdeDOTjCjuiyfdnGP4WX3+jHsdlQ8Vp2RxWG5Jxlxa/gvTraX17yigt NKRdWlVMYauGRZ+Gxqwafs8y/z/CnlW0ZC6i+VLz78uFrwjHU/ETY3r9wtAvJDb4 VP927Xtr7WupVBV2//o2AUxmuGusr5i4MQ1hNICRUOvxYFnNDRonWyBhrJQpjmow U+ha0+6nVqhF0X0W7lHfrbjfz0/XjYRJDEfrFSf2MDp27L1aHgBUzEshQLx0JCv9 lHWlO50J6ETNXVeLWSpMLjMTfatrdV+Sq6MdKctTXDs9CZ2deHLTlQ5uyIMSA725 iiGCGZ1orNsd54msMl2K =PQjW -----END PGP SIGNATURE----- --vjvPeIPvmlhKGhFqOg4wpwU6wFjzugN23-- From owner-freebsd-hackers@freebsd.org Sat Dec 1 05:53:57 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 919311331923; Sat, 1 Dec 2018 05:53:57 +0000 (UTC) (envelope-from rebecca@bluestop.org) Received: from muon.bluestop.org (muon.bluestop.org [96.73.9.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 C2E2F69D6B; Sat, 1 Dec 2018 05:53:56 +0000 (UTC) (envelope-from rebecca@bluestop.org) Received: from muon.bluestop.org (localhost [127.0.0.1]) by muon.bluestop.org (Postfix) with ESMTP id 01CCF343E3; Fri, 30 Nov 2018 22:54:35 -0700 (MST) Received: from muon.bluestop.org ([127.0.0.1]) by muon.bluestop.org (muon.bluestop.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i0uBQTZWuiI3; Fri, 30 Nov 2018 22:54:35 -0700 (MST) Received: from photon.int.bluestop.org (gw.bluestop.org [96.73.9.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTPSA; Fri, 30 Nov 2018 22:54:35 -0700 (MST) From: Rebecca Cran To: freebsd-hackers@freebsd.org Cc: Eugene Grosbein , Ian Lepore , Masachika ISHIZUKA , hackers@freebsd.org Subject: Re: How to use trim command ? Date: Fri, 30 Nov 2018 22:53:47 -0700 Message-ID: <5281174.XOh7uYVVfo@photon.int.bluestop.org> In-Reply-To: References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> <1543622218.1860.169.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Rspamd-Queue-Id: C2E2F69D6B X-Spamd-Result: default: False [-5.63 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bluestop.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-3.12)[ip: (-9.77), ipnet: 96.64.0.0/11(-4.84), asn: 7922(-0.90), country: US(-0.09)]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bluestop.org:+]; DMARC_POLICY_ALLOW(-0.50)[bluestop.org,quarantine]; MX_GOOD(-0.01)[mail.bluestop.org]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; CTE_CASE(0.50)[]; ASN(0.00)[asn:7922, ipnet:96.64.0.0/11, country:US]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 05:53:57 -0000 On Friday, 30 November 2018 17:36:01 MST Eugene Grosbein wrote: > 01.12.2018 6:56, Ian Lepore wrote: > newfs destroys data too, cat > /dev/da0 does this too, > add the name "dd" itself does not imply data destruction. > Can you invent better name? 'discard'? -- Rebecca Cran From owner-freebsd-hackers@freebsd.org Sat Dec 1 11:23:48 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C136913124FA for ; Sat, 1 Dec 2018 11:23:48 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from msc13.plala.or.jp (msc13.plala.or.jp [60.36.166.23]) by mx1.freebsd.org (Postfix) with ESMTP id 25BD77CDC2 for ; Sat, 1 Dec 2018 11:23:46 +0000 (UTC) (envelope-from ish@amail.plala.or.jp) Received: from localhost ([2400:4050:9320:7a00::8]) by msc13.plala.or.jp with ESMTP id <20181201112343.MKER25242.msc13.plala.or.jp@localhost> for ; Sat, 1 Dec 2018 20:23:43 +0900 Date: Sat, 01 Dec 2018 20:23:32 +0900 (JST) Message-Id: <20181201.202332.546134930481017424.ish@amail.plala.or.jp> To: freebsd-hackers@freebsd.org Subject: Re: How to use trim command ?,Re: How to use trim command ? From: Masachika ISHIZUKA In-Reply-To: <1c7139bd-258c-e7d2-2572-052da3803b3b@freebsd.org> References: <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> <20181201.093153.893601099798031027.ish@amail.plala.or.jp> <1c7139bd-258c-e7d2-2572-052da3803b3b@freebsd.org> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-VirusScan: Outbound; mvir-ac13; Sat, 1 Dec 2018 20:23:43 +0900 X-Rspamd-Queue-Id: 25BD77CDC2 X-Spamd-Result: default: False [1.96 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.45)[-0.448,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:60.36.166.0/24]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[plala.or.jp]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MX_GOOD(-0.01)[cached: mx.plala.or.jp]; NEURAL_SPAM_LONG(0.24)[0.245,0]; RCVD_IN_DNSWL_NONE(0.00)[23.166.36.60.list.dnswl.org : 127.0.10.0]; MID_CONTAINS_FROM(1.00)[]; IP_SCORE(0.00)[ipnet: 60.32.0.0/12(0.43), asn: 4713(-0.34), country: JP(-0.09)]; NEURAL_HAM_SHORT(-0.12)[-0.125,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:4713, ipnet:60.32.0.0/12, country:JP]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 11:23:48 -0000 >> I misunderstood trim was equivalent to fstrim in linux. >> I undotstood that the trim command is the SSD bulk erase tool. > > If you want to enable TRIM on a UFS filesystem, tunefs is the command > you are looking for. Thank you for mail. I'm using 'tunefs -t enable /dev/ada0pXX', that is equivalent to 'discard' in fstab on linux. > The equivalent to fstrim for UFS is fsck_ffs -E: I think 'fsck_ffs -E' is not suitable for daily midnight cron job. -- Masachika ISHIZUKA From owner-freebsd-hackers@freebsd.org Sat Dec 1 20:51:49 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70BA61327634 for ; Sat, 1 Dec 2018 20:51:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D556773EF9 for ; Sat, 1 Dec 2018 20:51:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x834.google.com with SMTP id i7so9771316qtj.10 for ; Sat, 01 Dec 2018 12:51:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p9IczOsJkzFlleXcKYGiHEnN/fLHrmicuCSoKD9PidY=; b=Ux2NTODYZB/EqFgqIuNXrxjmbI53AEGjxP/WG0nhv+6J7qlViumb29PtZgdS5+16U6 eQEo/SV3MgQPhugtFldFtQrr69EcXR4Rt3feQpP6sJqx1wmOOVCg1boYg2Ta+mwiDNFw +Swu1TvHxqbBlLWGZWBwrvw9kHibOu04qwqwpb7uSxQIxoPsNuUqkIFj65XP/0eL2WG0 LVxge+yiqir+IThJXTbNNTVmom17HhvgnX2JRcu0NiLDiMXydwop4up7vHE+IyfOjlnX lqB1KpCbfZ3fIF6JsHEtwgm28tb/sv9gCBnyzHsEpqGAicktDj+4kz04jm09ze1c6CQZ oBPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p9IczOsJkzFlleXcKYGiHEnN/fLHrmicuCSoKD9PidY=; b=qMDByUBurCSH8XABn+1k550qeWnZnUz/Xf8MhD7N7s43QLJJ9v01Yy3vrGXlWSQ/GF VP1y+AnWYG/zd8BjG8WKsrPxFy2NPZ9MBFtbJfudtrMWD6ScQMJr33lLOK1yNuGPR+Bw QijbWoH7h85ZP5X4TsJYP35DhwvK6J2SLTrW9VmIWhiQgnZPdUK0q6eKr8V2gJtpCjyW 3g+iO1DfowCMoynYMk1oiwYWg84hRhSGgODVfX89piB+sTYS3WKJestELVPRYB4KHT1k 8HaZYjFNsjJdK9tzQfbTnHnMqP0yDw82mkbQ/WeeSIEDRzIg+Up1Ea6sUMUOPsrqOARf oo7g== X-Gm-Message-State: AA+aEWZzvKoE6M0JuhF1fYfHhwBwbtiUGsp+3M1bNpc3scjcV2Dg+zhU miVcFh+RpaVCCEwcQLn3WpufpD3YEEHAxzrJTT5V+Mi4 X-Google-Smtp-Source: AFSGD/VG/8HByj8NE4QfGdK7Sf1WCNPhv2uQKSFbdJKdZqcanR4s5BhU8bDu6MhfCgQq5BCHMy6hmsFk9SN7vMbaFt4= X-Received: by 2002:aed:3881:: with SMTP id k1mr9818898qte.345.1543697508186; Sat, 01 Dec 2018 12:51:48 -0800 (PST) MIME-Version: 1.0 References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> <1543622218.1860.169.camel@freebsd.org> <5281174.XOh7uYVVfo@photon.int.bluestop.org> In-Reply-To: <5281174.XOh7uYVVfo@photon.int.bluestop.org> From: Warner Losh Date: Sat, 1 Dec 2018 13:51:36 -0700 Message-ID: Subject: Re: How to use trim command ? To: Rebecca Cran Cc: "freebsd-hackers@freebsd.org" , ish@amail.plala.or.jp, "freebsd-hackers@freebsd.org" , Ian Lepore , Eugene Grosbein X-Rspamd-Queue-Id: D556773EF9 X-Spamd-Result: default: False [-2.48 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; NEURAL_HAM_MEDIUM(-0.97)[-0.972,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.983,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[4.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.89)[-0.893,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; IP_SCORE(-0.62)[ipnet: 2607:f8b0::/32(-1.70), asn: 15169(-1.31), country: US(-0.09)]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 20:51:49 -0000 On Sat, Dec 1, 2018 at 12:50 AM Rebecca Cran via freebsd-hackers < freebsd-hackers@freebsd.org> wrote: > On Friday, 30 November 2018 17:36:01 MST Eugene Grosbein wrote: > > 01.12.2018 6:56, Ian Lepore wrote: > > > newfs destroys data too, cat > /dev/da0 does this too, > > add the name "dd" itself does not imply data destruction. > > > Can you invent better name? > > 'discard'? > That's a good name. trim has the unfortunate collision with the perl 'trim' function and similar things that I didn't think of when I recommended it. It's also nicely technology agnostic. Warner From owner-freebsd-hackers@freebsd.org Sat Dec 1 20:55:55 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E07313277BD for ; Sat, 1 Dec 2018 20:55:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADB117410E for ; Sat, 1 Dec 2018 20:55:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x829.google.com with SMTP id d19so9789859qtq.9 for ; Sat, 01 Dec 2018 12:55:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9NvvRRjOcFG2RD3xTkR/aTY+nfwaRLvgNsjhhLuqCM4=; b=OU+hqdczVT3rvErUccPRZE2LmynSWCOJurNAGNdXnUH7ECLH38txuPeOkkqg6M/nCd JkU5FT5dIsBo8kuh3WRgwHIA3VKkPFZwW5Zx5pFhBirfM0DaibpvqkoiFAI75RUzE0MU J/t3nIGUuOJzzyW/eVvdfXW/fc+OiMEl3DIMN8vaR/o+vYqUzMAFhQ9sylDeZd6IuRsN 6M7oppr9d/4g3AaxF48orVfzPSLvc/L674m+pkp3b8j4TEGtThQO7ttoqpNyl01MPMaZ UcPWy0Rjf12u/dZrtZkweLx3dCls+XFijnC4sHngPoqaaiCxp6cI/1QyugaywWtVFXPB YKng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9NvvRRjOcFG2RD3xTkR/aTY+nfwaRLvgNsjhhLuqCM4=; b=Bva5IUw6g93eUUxNcFqKMs7Y6L/+gZwKvHdyv5egMgIJRhHPVv3kViwR1uE/h9Asyj t5L9IjHdxM+bUsLhfhtTTvQ1jSeFMMuDE+Xp/6tXHRQBeLG+SevukBTGgIp4oTeRLb1f RoXHOKUv+sqzN0XWzFqrPDWOGlmu323G4umx+0bbaD3wGcfiFf6yvsNtWyIIJbMit/vB oICZsxaq/2D4XefhbGB2npK8bb4gr9jp0FgE5jigLMb9CmwchN4kFRLj1URzlkQrVsCD AIM/Hd46G+nSFyG3ORVmgFTqi5o0pmGWkpSqhYpxGz2iTBtrQ4bvzCIFv2d5vipRhKRl N2GQ== X-Gm-Message-State: AA+aEWb+A8Sb0KiOiLzkZFyQW+w/jZwu9opkmxhvzrzh3935CPNVaVHb D+t6Xip/sZKG6/0Xfq06qiJWDNQCcU1VIB1oiJhMUw== X-Google-Smtp-Source: AFSGD/UEvbe6ZqQthzKulAV41XeId7OdznH3o42Ob3z+tm8a4VYiETHBmrl+39qXIYv+dhbLkhowfDczcYDWdPTnB0c= X-Received: by 2002:ac8:548a:: with SMTP id h10mr10440915qtq.15.1543697754209; Sat, 01 Dec 2018 12:55:54 -0800 (PST) MIME-Version: 1.0 References: <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> <20181201.093153.893601099798031027.ish@amail.plala.or.jp> <1c7139bd-258c-e7d2-2572-052da3803b3b@freebsd.org> <20181201.202332.546134930481017424.ish@amail.plala.or.jp> In-Reply-To: <20181201.202332.546134930481017424.ish@amail.plala.or.jp> From: Warner Losh Date: Sat, 1 Dec 2018 13:55:43 -0700 Message-ID: Subject: Re: How to use trim command ?,Re: How to use trim command ? To: ish@amail.plala.or.jp Cc: "freebsd-hackers@freebsd.org" X-Rspamd-Queue-Id: ADB117410E X-Spamd-Result: default: False [-2.45 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; NEURAL_HAM_MEDIUM(-0.97)[-0.970,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_SHORT(-0.87)[-0.875,0]; NEURAL_HAM_LONG(-0.97)[-0.971,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[9.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; IP_SCORE(-0.62)[ipnet: 2607:f8b0::/32(-1.70), asn: 15169(-1.31), country: US(-0.09)]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 20:55:55 -0000 On Sat, Dec 1, 2018 at 4:41 AM Masachika ISHIZUKA wrote: > >> I misunderstood trim was equivalent to fstrim in linux. > >> I undotstood that the trim command is the SSD bulk erase tool. > > > > If you want to enable TRIM on a UFS filesystem, tunefs is the command > > you are looking for. > > Thank you for mail. > > I'm using 'tunefs -t enable /dev/ada0pXX', that is equivalent > to 'discard' in fstab on linux. > > > The equivalent to fstrim for UFS is fsck_ffs -E: > > I think 'fsck_ffs -E' is not suitable for daily midnight cron > job. > FreeBSD doesn't have an equivalent of a daemon that runs and trims blocks after a while of being idle (trimd on linux I think). Warner From owner-freebsd-hackers@freebsd.org Sat Dec 1 21:23:54 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF5EE1328325 for ; Sat, 1 Dec 2018 21:23:54 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id EA1B474F1F for ; Sat, 1 Dec 2018 21:23:53 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 1335A1484E; Sat, 1 Dec 2018 21:23:46 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id wB1LNjRn012406 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 1 Dec 2018 21:23:45 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id wB1LNiW2012405; Sat, 1 Dec 2018 21:23:44 GMT (envelope-from phk) To: Warner Losh cc: ish@amail.plala.or.jp, "freebsd-hackers@freebsd.org" Subject: Re: How to use trim command ?,Re: How to use trim command ? In-reply-to: From: "Poul-Henning Kamp" References: <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> <20181201.093153.893601099798031027.ish@amail.plala.or.jp> <1c7139bd-258c-e7d2-2572-052da3803b3b@freebsd.org> <20181201.202332.546134930481017424.ish@amail.plala.or.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12403.1543699424.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Sat, 01 Dec 2018 21:23:44 +0000 Message-ID: <12404.1543699424@critter.freebsd.dk> X-Rspamd-Queue-Id: EA1B474F1F X-Spamd-Result: default: False [5.21 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.73)[0.731,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.dk]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.94)[0.937,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[phk.freebsd.dk]; NEURAL_SPAM_LONG(0.96)[0.956,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; RCVD_NO_TLS_LAST(0.10)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; IP_SCORE(0.30)[asn: 1835(1.48), country: EU(0.00)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 21:23:55 -0000 -------- In message , Warner Losh writes: >On Sat, Dec 1, 2018 at 4:41 AM Masachika ISHIZUKA >wrote: >> I think 'fsck_ffs -E' is not suitable for daily midnight cron job. > >FreeBSD doesn't have an equivalent of a daemon that runs and trims blocks >after a while of being idle (trimd on linux I think). Why would you run 'fsck_ffs -E' in cron anyway ? If the file-system is has TRIM enabled, it would be a no-op, unless there are bugs in the fs ? As for command name: bio_delete(8) would be my suggestion, but I'm biased= . -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-freebsd-hackers@freebsd.org Sat Dec 1 22:14:29 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68DF71329A82; Sat, 1 Dec 2018 22:14:29 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660067.outbound.protection.outlook.com [40.107.66.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFBE76BA2; Sat, 1 Dec 2018 22:14:27 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM (52.132.50.155) by YTOPR0101MB1708.CANPRD01.PROD.OUTLOOK.COM (52.132.45.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.19; Sat, 1 Dec 2018 22:14:25 +0000 Received: from YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM ([fe80::9404:5554:6cd6:10d0]) by YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM ([fe80::9404:5554:6cd6:10d0%5]) with mapi id 15.20.1382.020; Sat, 1 Dec 2018 22:14:25 +0000 From: Rick Macklem To: Warner Losh , Rebecca Cran CC: "ish@amail.plala.or.jp" , "freebsd-hackers@freebsd.org" , "freebsd-hackers@freebsd.org" , Eugene Grosbein , Ian Lepore Subject: Re: How to use trim command ? Thread-Topic: How to use trim command ? Thread-Index: AQHUibe2oaqj2u4F20iO7aVXdhCR1qVqcirZ Date: Sat, 1 Dec 2018 22:14:25 +0000 Message-ID: References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> <1543622218.1860.169.camel@freebsd.org> <5281174.XOh7uYVVfo@photon.int.bluestop.org>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB1708; 6:uuM89djmk4iGfrx3OZyIRhBM4M+DN2dSCgo7YZqw0gw+vl98mr/eAYqsqGHjF487GYnO2lxgvKGOO1BMXUDKLe/EFIZl2Ajq4EGdFunKJ+P7srzSGY0FwtFZhuyasd7KZiWPeVWvvss17LarxAJVe4TgkkSnS6TMp2DBXyVGnTd8gkB839d0erN0h+GRoulLwP/iyQpg8r9wzu37eO+bmd95Y7aMcL9Qh4QBFT/ZYGPRLlziAo8rQ+pZ4nxPom2CmnRQN/vzD0lniBG7Ur8REnWjxMPRJR9bevwsoRKZO8J0VXlkL3wTdVSBMiq/iXjwfmH1E+12fcIAzN8fjb/r6OHtIK2n4XgssqCUImL4KJocrDa6PZtYGgjO+gFIjDpS0aT51mBvC/Utl7R8zruYVLRQPyHVzD3tS88rsWJYslIM/KIBgpcdJeiwDhnrDqm7Cgh8olpABjsrwpCZdgSdMw==; 5:DP47+WkCKfqECY2qXkwdz1hpVn4mAGwEtbPbf0a2rKhf0/qyAoPMjxnSxri2H2/PvlbGPdfeXRT7v50bFGu+aSaZeQuzzI6IM7ox1koOtLwkei5ZdAHBOCPHvEouCkU/OIJn9VctMECbzhmWDPXvOhPmSG/u9uXVA2ttHzzrTI4=; 7:OCUaDamwyFjvJPArUxi1z2FmtnSXuxFpsG2r2I5FavoAOJWsW7P8itQ5JL59+yYh8/HwStVppoMMXqyOogWWpRq2hgsPxH/lSW0VgT8ejLTIkw0f53HQkynSXEBbwKOqY5g8Eqwp4GP+XsWWO46u0w== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 230d23f5-2d9d-4a0f-a366-08d657da5acb x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:YTOPR0101MB1708; x-ms-traffictypediagnostic: YTOPR0101MB1708: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231455)(999002)(944501481)(52105112)(3002001)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:YTOPR0101MB1708; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB1708; x-forefront-prvs: 087396016C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(396003)(136003)(376002)(346002)(189003)(199004)(105586002)(786003)(33656002)(54906003)(110136005)(106356001)(68736007)(97736004)(74482002)(25786009)(316002)(93886005)(486006)(71200400001)(71190400001)(53936002)(14454004)(99286004)(76176011)(7696005)(6246003)(478600001)(102836004)(55016002)(305945005)(9686003)(186003)(4326008)(46003)(229853002)(6506007)(446003)(5660300001)(8936002)(81156014)(8676002)(81166006)(86362001)(11346002)(2906002)(256004)(74316002)(476003)(6436002); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB1708; H:YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: wIYU2kOxc5Pn7wI2tCcwySVjMufNW4ktdosJfcYcYQUOZHnOPdfM49ykvOp0URGoBCdePTv+Nk3UvNKzJxAIgLXpmHaiwRR1NW16G+35ZXFkEDjdM56p63L9amaS8l4gpzHJb0vRMkajWnec8Dt8MA3beoK6HAIZ/AsXVZcREUzohJelu799hPA2ZHw+Sui/QFCF7hyFJvqY4AwsKcw80e+vShlgrEOghmIxY2ES00ukTYbA5+LW+8FrJOyKj+ztXWNrKjOJj1c3x18yhTKQjAUwx6+Mbv9E2wyBV20IGoHP2QjVEJ7E/Ez35KWt2DvGF4lC9jrFFGdM72RCluOOGXYDKxHSjt8svOHiqIXrL/I= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 230d23f5-2d9d-4a0f-a366-08d657da5acb X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2018 22:14:25.6504 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB1708 X-Rspamd-Queue-Id: 4CFBE76BA2 X-Spamd-Result: default: False [-2.91 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/17]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[uoguelph.ca]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com]; NEURAL_HAM_SHORT(-0.92)[-0.915,0]; RCVD_IN_DNSWL_NONE(0.00)[67.66.107.40.list.dnswl.org : 127.0.3.0]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(-0.69)[ipnet: 40.64.0.0/10(-1.49), asn: 8075(-1.89), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:8075, ipnet:40.64.0.0/10, country:US]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 22:14:29 -0000 Warner Losh wrote: >Rebecca Cran wrote: >> On Friday, 30 November 2018 17:36:01 MST Eugene Grosbein wrote: >> > 01.12.2018 6:56, Ian Lepore wrote: >> >> > newfs destroys data too, cat > /dev/da0 does this too, >> > add the name "dd" itself does not imply data destruction. >> >> > Can you invent better name? >> >> 'discard'? >> > >That's a good name. trim has the unfortunate collision with the perl 'trim= ' >function and similar things that I didn't think of when I recommended it. >It's also nicely technology agnostic. What about something with "ssd" in it, like "ssdbulkerase" or "ssderaseall"= ? rick From owner-freebsd-hackers@freebsd.org Sat Dec 1 22:24:31 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 900891329EBA for ; Sat, 1 Dec 2018 22:24:31 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6903770EC for ; Sat, 1 Dec 2018 22:24:29 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wm1-x32d.google.com with SMTP id y1so2260427wmi.3 for ; Sat, 01 Dec 2018 14:24:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zv05fszc1bOSJehQd7Raa1LwS4DzKqQbyY7EKR08faU=; b=K5s+4QsaqoGNrT+p6YQ4Ae4APc160ZvHgiHlzr2WmEeXTZHK+w+nAqNL6P+O/ZHSd9 ySwoR+d7FWGjZmo2MQ9iB+/7ficLm+mZasemRvMwjPXynnj1YuFxmL1+Ih4QHqbFPwnC Z2BpL7ro9Np4JeM2TasXZ337LD1BFZzDjza8k0pOjf3ZTbfW6L78HdwtLwm4NqyBiHQp i3ttpfJLic8P2pMPXy3r4x7bZcK6Tdez2v3Nbr69PFSvSmRepvcpgGhr3soMrPquzqot 8CFJ7URYuogrX4KTLgEQmya4bmxXw/a+vu+C6Hi6SdbHH3gYiDIInhyN/Ue1UqUI1TqZ St/w== X-Gm-Message-State: AA+aEWYJoJFGZpzIDY3A7GmwBazcUnkQ73nqQKn3UTSdl36eaUQ8SCvt mTDeN5aPQvs75hkeM8uLapfSLuopQJw= X-Google-Smtp-Source: AFSGD/WEvF9R9SQ86mU3pjY7HhvTSSql5sjjrubY1MM3Nl0F18GFSD7WmuNfqGnGu1zz34w1TdZxzg== X-Received: by 2002:a1c:e90d:: with SMTP id q13mr3497713wmc.106.1543703068561; Sat, 01 Dec 2018 14:24:28 -0800 (PST) Received: from gumby.homeunix.com ([2.121.229.87]) by smtp.gmail.com with ESMTPSA id t70sm2612964wmd.36.2018.12.01.14.24.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Dec 2018 14:24:27 -0800 (PST) Date: Sat, 1 Dec 2018 22:24:24 +0000 From: RW To: freebsd-hackers@freebsd.org Subject: Re: How to use trim command ?,Re: How to use trim command ? Message-ID: <20181201222424.0ae8abfd@gumby.homeunix.com> In-Reply-To: <12404.1543699424@critter.freebsd.dk> References: <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> <20181201.093153.893601099798031027.ish@amail.plala.or.jp> <1c7139bd-258c-e7d2-2572-052da3803b3b@freebsd.org> <20181201.202332.546134930481017424.ish@amail.plala.or.jp> <12404.1543699424@critter.freebsd.dk> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; amd64-portbld-freebsd11.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E6903770EC X-Spamd-Result: default: False [-3.34 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[googlemail.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[googlemail.com:+]; DMARC_POLICY_ALLOW(-0.50)[googlemail.com,quarantine]; MX_GOOD(-0.01)[alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.77)[-0.769,0]; RECEIVED_SPAMHAUS_PBL(0.00)[87.229.121.2.zen.spamhaus.org : 127.0.0.10]; IP_SCORE(-0.56)[ipnet: 2a00:1450::/32(-1.42), asn: 15169(-1.30), country: US(-0.09)]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[googlemail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[googlemail.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[d.2.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 22:24:31 -0000 On Sat, 01 Dec 2018 21:23:44 +0000 Poul-Henning Kamp wrote: > Why would you run 'fsck_ffs -E' in cron anyway ? > > If the file-system is has TRIM enabled, it would be a no-op, unless > there are bugs in the fs ? There's a school of thought that trimming in real-time, after file deletion, slows down I/O on the device. Some people advocate turning-off trim support in the file-system and trimming all the unused space in one go from cron when the system is likely to be idle. I don't know whether there's any truth in it. It sounds unlikely with modern drives. From owner-freebsd-hackers@freebsd.org Sat Dec 1 22:36:05 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD83B132A284; Sat, 1 Dec 2018 22:36:05 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id DC1147755C; Sat, 1 Dec 2018 22:36:04 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 858E014866; Sat, 1 Dec 2018 22:36:03 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id wB1Ma2CY059686 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 1 Dec 2018 22:36:03 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id wB1Ma0kF059270; Sat, 1 Dec 2018 22:36:00 GMT (envelope-from phk) To: Rick Macklem cc: Warner Losh , Rebecca Cran , "ish@amail.plala.or.jp" , "freebsd-hackers@freebsd.org" , "freebsd-hackers@freebsd.org" , Ian Lepore , Eugene Grosbein Subject: Re: How to use trim command ? In-reply-to: From: "Poul-Henning Kamp" References: <20181201.011411.2100982142219259108.ish@amail.plala.or.jp> <1543622218.1860.169.camel@freebsd.org> <5281174.XOh7uYVVfo@photon.int.bluestop.org>, MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <59266.1543703760.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Sat, 01 Dec 2018 22:36:00 +0000 Message-ID: <59267.1543703760@critter.freebsd.dk> X-Rspamd-Queue-Id: DC1147755C X-Spamd-Result: default: False [5.10 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.79)[0.794,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.dk]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.79)[0.789,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: phk.freebsd.dk]; NEURAL_SPAM_LONG(0.94)[0.938,0]; RCPT_COUNT_SEVEN(0.00)[8]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; RCVD_NO_TLS_LAST(0.10)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; IP_SCORE(0.28)[asn: 1835(1.42), country: EU(0.00)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 22:36:05 -0000 -------- In message , Rick Macklem writes: >What about something with "ssd" in it, like "ssdbulkerase" or "ssderaseal= l"? BIO_DELETE is not limited to SSD, it can also be used to discard encryptio= n keys for data you no longer want and many other things. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-freebsd-hackers@freebsd.org Sat Dec 1 22:40:44 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99319132A496 for ; Sat, 1 Dec 2018 22:40:44 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 164517779D for ; Sat, 1 Dec 2018 22:40:44 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 48C17148C9; Sat, 1 Dec 2018 22:40:43 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id wB1MegE7001205 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 1 Dec 2018 22:40:43 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id wB1MegSt001179; Sat, 1 Dec 2018 22:40:42 GMT (envelope-from phk) To: RW , RW via freebsd-hackers Subject: Re: How to use trim command ?,Re: How to use trim command ? In-reply-to: <20181201222424.0ae8abfd@gumby.homeunix.com> From: "Poul-Henning Kamp" References: <7e69211c-6ffb-6155-b17a-a845c0b3586d@grosbein.net> <20181201.093153.893601099798031027.ish@amail.plala.or.jp> <1c7139bd-258c-e7d2-2572-052da3803b3b@freebsd.org> <20181201.202332.546134930481017424.ish@amail.plala.or.jp> <12404.1543699424@critter.freebsd.dk> <20181201222424.0ae8abfd@gumby.homeunix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1174.1543704042.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Sat, 01 Dec 2018 22:40:42 +0000 Message-ID: <1177.1543704042@critter.freebsd.dk> X-Rspamd-Queue-Id: 164517779D X-Spamd-Result: default: False [5.32 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.88)[0.881,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.dk]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.92)[0.921,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: phk.freebsd.dk]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(0.96)[0.957,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; FREEMAIL_TO(0.00)[googlemail.com]; RCVD_NO_TLS_LAST(0.10)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; IP_SCORE(0.27)[asn: 1835(1.36), country: EU(0.00)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2018 22:40:44 -0000 -------- In message <20181201222424.0ae8abfd@gumby.homeunix.com>, RW via freebsd-ha= ckers writes: >On Sat, 01 Dec 2018 21:23:44 +0000 >> Why would you run 'fsck_ffs -E' in cron anyway ? >> = >> If the file-system is has TRIM enabled, it would be a no-op, unless >> there are bugs in the fs ? > >There's a school of thought that trimming in real-time, after file >deletion, slows down I/O on the device. I suspect people would have reached that conclusion back when various shady outfits started selling camera-grade FAL devices in 2.5" form-factor. My advice would be to avoid any device where that pattern is observed, because that means there is too few write buffers and paths. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= .