From nobody Mon Mar 21 12:52:20 2022 X-Original-To: freebsd-security@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5B99F1A31E36 for ; Mon, 21 Mar 2022 12:52:28 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KMZJq4cByz3vhP for ; Mon, 21 Mar 2022 12:52:27 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: by mail-il1-x12c.google.com with SMTP id e18so1297588ilr.2 for ; Mon, 21 Mar 2022 05:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataix.net; s=net; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=/wVHlxo9eMKR0TGehNEwJ+lYGcwapTggsh2plEj2EYU=; b=s9pfIHar/Vn5oJobYRhjwZiAIGsz1dx3MRL+5Dk/h9fCZHGOAsWOvjVjD/F6azatZ1 pieTqAIKLqkx1oZ/qJqT7mF96mRuA0XvoHDQGbbvjKlZXnCkPGpNJ4ULo0wyoTTkPrBR cUsHWvLgm1IlbixZpMEOHsR6YHjASXm/9Hgl4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=/wVHlxo9eMKR0TGehNEwJ+lYGcwapTggsh2plEj2EYU=; b=8LUiqcwrHUazWnbmIJqD9nLeF6T7ZiGU1IWbxVggU9/d6u/fEWpaYZ6wucIkQ787jf 27qIaHIgDkPuRU5CLPVEJwhU9lTIy+rtC+XG03k7Fd8itZ+y4m52WxKQJfQZxcRtLyM/ C48HsfaJ8MI4rjTWUD61hLP0cQr4nb34eGNIw4v39qupibPEfBQ2RbQBZaZ43ztBL6fR 7mMllQuG39alaeFMjIATjVXMRm8AgNI/si0cwTiOfDhBDmpfYKh48uNWNDecKTENOXZL zR85+z/uIgLLIkP0aed0BgJMYBdCFpd0hNkPODQ8WINN7O+cofSZTGaElgQ2EXC6P1+V psSw== X-Gm-Message-State: AOAM532ysEuHRHdjUEzUpilAeM2wAAR6FXhaTPPI2aoJX00ZDgaG3tdh 6nbGbT8AaZPkyswsJhv18U3c9TUSDaZ4hw== X-Google-Smtp-Source: ABdhPJyn1HgMLoIganoTxLQGcVCpOQ4Yram/rsimM/gmoL4jwB1ed8any093/2hf9ilbpPxZgRU+nA== X-Received: by 2002:a05:6e02:20e3:b0:2c8:1e7b:529c with SMTP id q3-20020a056e0220e300b002c81e7b529cmr3533625ilv.34.1647867141151; Mon, 21 Mar 2022 05:52:21 -0700 (PDT) Received: from smtpclient.apple (2603-6000-ca01-b73e-6559-99dd-8426-df0e.res6.spectrum.com. [2603:6000:ca01:b73e:6559:99dd:8426:df0e]) by smtp.gmail.com with ESMTPSA id c6-20020a056e020bc600b002c6731e7cb8sm9313622ilu.31.2022.03.21.05.52.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Mar 2022 05:52:20 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: "J. Hellenthal" List-Id: Security issues List-Archive: https://lists.freebsd.org/archives/freebsd-security List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-security@freebsd.org X-BeenThere: freebsd-security@freebsd.org Mime-Version: 1.0 (1.0) Subject: Re: SSD erase question Date: Mon, 21 Mar 2022 07:52:20 -0500 Message-Id: References: <274c8cca-80b0-9460-6754-6bb77efbb4dd@htwsaar.de> Cc: freebsd-security@freebsd.org In-Reply-To: <274c8cca-80b0-9460-6754-6bb77efbb4dd@htwsaar.de> To: Damian Weber X-Mailer: iPhone Mail (19E241) X-Rspamd-Queue-Id: 4KMZJq4cByz3vhP X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=dataix.net header.s=net header.b=s9pfIHar; dmarc=pass (policy=reject) header.from=dataix.net; spf=pass (mx1.freebsd.org: domain of jhellenthal@dataix.net designates 2607:f8b0:4864:20::12c as permitted sender) smtp.mailfrom=jhellenthal@dataix.net X-Spamd-Result: default: False [-3.49 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[dataix.net:s=net]; NEURAL_HAM_MEDIUM(-1.00)[-0.997]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-security@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[dataix.net:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::12c:from]; NEURAL_HAM_SHORT(-1.00)[-0.995]; DMARC_POLICY_ALLOW(-0.50)[dataix.net,reject]; MLMMJ_DEST(0.00)[freebsd-security]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Personally I would use dc3dd from ports and you'll be plenty alright. While dd would be enough in most occasions I won't assume your data is of a t= ypical user. It only writes the random bits to the disk once. In some scenar= ios it's possible to reverse that. dc3dd takes care of that by writing multi= ple times. There is also dcfldd which was superseded by dc3dd. --=20 J. Hellenthal The fact that there's a highway to Hell but only a stairway to Heaven says a= lot about anticipated traffic volume. > On Mar 21, 2022, at 07:15, Damian Weber wrote: >=20 > =EF=BB=BF > Hi all, >=20 > I'd like to have an answer on a secure FreeBSD way to erase=20 > SSDs before giving these away to someone for reusing it.=20 >=20 > Is the following enough to protect confidential data=20 > previously stored there? >=20 > 1) dd : overwriting with random bits (complete capacity) > 2) gpart create > 3) gpart add > 4) newfs >=20 > Details for an example with /dev/ada1 see below. >=20 > Thanks a lot, >=20 > Damian >=20 >=20 > # fdisk ada1 > ******* Working on device /dev/ada1 ******* > parameters extracted from in-core disklabel are: > cylinders=3D484521 heads=3D16 sectors/track=3D63 (1008 blks/cyl) >=20 > Figures below won't work with BIOS for partitions not in cyl 1 > parameters to be used for BIOS calculations are: > cylinders=3D484521 heads=3D16 sectors/track=3D63 (1008 blks/cyl) >=20 > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > sysid 238 (0xee),(EFI GPT) > start 1, size 488397167 (238475 Meg), flag 0 > beg: cyl 0/ head 0/ sector 2; > end: cyl 1023/ head 255/ sector 63 > The data for partition 2 is: > > The data for partition 3 is: > > The data for partition 4 is: > >=20 > # gpart show ada1 > =3D> 40 488397088 ada1 GPT (233G) > 40 1024 1 freebsd-boot (512K) > 1064 480246784 2 freebsd-ufs [bootme] (229G) > 480247848 8149280 3 freebsd-swap (3.9G) >=20 > # dd if=3D/dev/random of=3D/dev/ada1 bs=3D512 count=3D488397088 >=20 > # gpart create -s gpt ada1 >=20 > # gpart add -t freebsd-ufs ada1 >=20 > # newfs -U /dev/ada1p1 >=20 >=20