From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: ** X-Spam-Status: No, score=2.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 691DFC433C1 for ; Wed, 24 Mar 2021 19:56:26 +0000 (UTC) Received: from mail.server123.net (mail.server123.net [78.46.64.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D6A6D61A25 for ; Wed, 24 Mar 2021 19:56:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6A6D61A25 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-crypt-bounces@saout.de X-Virus-Scanned: amavisd-new at saout.de Authentication-Results: mail.server123.net (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::f31; helo=mail-qv1-xf31.google.com; envelope-from=svartchimpans@gmail.com; receiver= Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Wed, 24 Mar 2021 20:53:14 +0100 (CET) Received: by mail-qv1-xf31.google.com with SMTP id x27so3289qvd.2 for ; Wed, 24 Mar 2021 12:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ueuK9WAS0myBmmkCNq2t0UBpMp8qCdZE1pXqluPiOP8=; b=SaqFsWyvKUxILfL3Rb0rbST5aki15udnB85Bv6qBnvt25MwgR8uGR5a1TBIA0QoRkx QkMSTDdppVXyLWODAWKJs3naztGqXA1VyrCQDDpBdDp2XMfZ6VwpXyPgYhoHCIjicwKq u6EFoI2duuh2/PUvSqtuKqkTb9dNdCQ+RZo7nngyxQPBZx3GXOx69ETj0yk7mwQAiWkT DFL7PgvvYLhCEgpeNjvC4iH42ihqd4wNcZ9P6mWWE9ItyV4YWuDQSMrv+u0VgA5gjJ+r i+6aN7SNtBk45Lt4wj52I1PDWuegDc2sX0NGIVlw/FbTSI2PUsE6Wj9aGhn56mfBsUAB StYg== 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=ueuK9WAS0myBmmkCNq2t0UBpMp8qCdZE1pXqluPiOP8=; b=PidlE11LDF6REd/6Vk1ul3iFuiuu5pkaSzPdHFaitOXALivxlthwLYwSTgxP0+mO81 71BX3Bskw2e6aAUGYje2PNhYTELLj5WHnn2IhRPY8GXkQ2ML/Lu3tLLKOhgwuUWRe3s1 KHBYNzpkxBILaEcl7dCPFuUAVvwOwVCoRWHqaEe7QEZW2jO/y4Uy9C2INXs+C3/EYcBa yHS7DJpf0jmfjaE7hnTTcJaT1y706UFMFfx8+TD0swwOrHRZAIV1B52tZ3XoKN6pD6FC 47LIuDtOLLFIsPVmULsXioI/Zf7kQKBLvnOo+BD02YaPFNJOPxR1QV+mCU6LOUO01V1+ GRBQ== X-Gm-Message-State: AOAM533TSFZ0CUZ7TZGxm9jwnG8s++YgK4kG0WRe//JfnISyd0ln32r2 DmW15I3I6Q7xAfWVL1bkaoj6C875Fz1ce/1csR8= X-Google-Smtp-Source: ABdhPJwhQQiAFDi1NufIQcs3ZjBCwLMffUcIZnAMVFTQcLG0TTUTME0T/R13eeY6zbC5WK2LFAePsF0Sgtyc2YOIfaw= X-Received: by 2002:a05:6214:4b3:: with SMTP id w19mr4787086qvz.26.1616615592637; Wed, 24 Mar 2021 12:53:12 -0700 (PDT) MIME-Version: 1.0 References: <_X7kzj_AZLSVcCkPM4xu_QoNVntVev87vOgJfHun_dR43IVunAzxvUFJubPVV3sDAMoJlJJAlFuljdv5Svkz49B5VMFXABWrEEk641NrHs4=@fomin.one> <25272852-a21f-dd2d-690c-b016b3399128@telefonica.net> In-Reply-To: From: Johnny Dahlberg Date: Wed, 24 Mar 2021 20:53:00 +0100 Message-ID: To: "Carlos E. R." Message-ID-Hash: 3L6UPTIGFM5TYSTY6SELXF6VZUVTEZEI X-Message-ID-Hash: 3L6UPTIGFM5TYSTY6SELXF6VZUVTEZEI X-MailFrom: svartchimpans@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-dm-crypt.saout.de-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: dm-crypt mail list X-Mailman-Version: 3.3.2 Precedence: list Subject: [dm-crypt] Re: Aligning entire LUKS/LVM/Ext4 filesystem stack to 4K sectors List-Id: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============5029784788606099166==" --===============5029784788606099166== Content-Type: multipart/alternative; boundary="0000000000002339f105be4da64b" --0000000000002339f105be4da64b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 19 Mar 2021 at 23:21, Carlos E. R. wrote: > On 19/03/2021 22.39, Johnny Dahlberg wrote: > > On 19/03/2021, Carlos E. R. wrote: > >> On 19/03/2021 21.24, Johnny Dahlberg wrote: > >>> On 19/03/2021, Maksim Fomin <> wrote: > >>>>> On Friday, 19 March 2021 =D0=B3., 19:09, Johnny Dahlberg <> wrote: > >> > >> ... > > > >> Related question: > >> > >> How can one, on an exiting encrypted partition, find out what size is > >> using each layer, and if they are aligned or not? > >> > >> I am using encrypted partitions on SSD and I'm a bit worried. > >> > >> > > > > Hello Carlos! > > > > First you would check the physical sector size of your SSD. It is most > > likely 4096 bytes (4K). You can check this by doing: > > > > cat /sys/block/(the parent device such as > nvme0n1)/queue/physical_block_size > > On the two machines I have running now, both have an nvme system disk, > but only one has the encrypted partition on it; both use 512: > > cer@Telcontar:~> cat /sys/block/nvme0n1/queue/physical_block_size > 512 > cer@Telcontar:~> > > Isengard:~ # cat /sys/block/sda/queue/physical_block_size > 512 > Isengard:~ # > > Hum! > Since January 2011, all manufacturers began using Advanced Format (4096 bytes): https://en.m.wikipedia.org/wiki/Advanced_Format#History >From what I can find online, your Samsung 970 Evo Plus uses 8K sectors physically. > I think I'm good - no worries :-) > > Thanks! :-) > > -- > Cheers / Saludos, > > Carlos E. R. > (from 15.2 x86_64 at Telcontar) > If you want to check everything for sure, and learn everything important that there is to know about these things, you can check out my new guide / alignment checker tool at: https://bananaman.github.io/friendly-guides/pages/storage_alignment.html You just type in your current values in each field and it will tell you whether they're aligned to your physical sectors, or better yet to MiB boundaries (which is guaranteed to be aligned to all physical sector sizes no matter what your drive uses). Every step tells you which commands to run to check that particular value. There's also plenty of interesting information to learn on there. Take care! -- Johnny --0000000000002339f105be4da64b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, 19 Mar 2021 at 23:21, Carlos = E. R. <robin.listas@telef= onica.net> wrote:
On 19/03/2021 22.39, Johnny Dahlberg wrote:
> On 19/03/2021, Carlos E. R. <robin.listas@telefonica.net> wrote:
>> On 19/03/2021 21.24, Johnny Dahlberg wrote:
>>> On 19/03/2021, Maksim Fomin <> wrote:
>>>>> On Friday, 19 March 2021 =D0=B3., 19:09, Johnny Dahlbe= rg <> wrote:
>>
>> ...


>> Related question:
>>
>> How can one, on an exiting encrypted partition, find out what size= is
>> using each layer, and if they are aligned or not?
>>
>> I am using encrypted partitions on SSD and I'm a bit worried.<= br> >>
>>
>
> Hello Carlos!
>
> First you would check the physical sector size of your SSD. It is most=
> likely 4096 bytes (4K). You can check this by doing:
>
> cat /sys/block/(the parent device such as nvme0n1)/queue/physical_bloc= k_size

On the two machines I have running now, both have an nvme system disk,
but only one has the encrypted partition on it; both use 512:

cer@Telcontar:~> cat /sys/block/nvme0n1/queue/physical_block_size
512
cer@Telcontar:~>

Isengard:~ # cat /sys/block/sda/queue/physical_block_size
512
Isengard:~ #

Hum!

Since January 2011, all manufacturers began u= sing Advanced Format (4096 bytes):=C2=A0https://en.m.wikipedia.org/wiki/Advanced_F= ormat#History

From what I can find online,= your Samsung 970 Evo Plus uses 8K sectors physically.


I think I'm good -=C2=A0 no worries :-)

Thanks! :-)

--
Cheers / Saludos,

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Carlos E. R.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (from 15.2 x86_64 a= t Telcontar)

If you want to check everything for s= ure, and learn everything important that there is to know about these thing= s, you can check out my new guide / alignment checker tool at:

https://bananaman.github.io/friendly-guides/pages/storage_alignment.ht= ml

You just type in your current values in each field and it wil= l tell you whether they're aligned to your physical sectors, or better = yet to MiB boundaries (which is guaranteed to be aligned to all physical se= ctor sizes no matter what your drive uses).

Every step tells you whi= ch commands to run to check that particular value.

There's also = plenty of interesting information to learn on there.

Take care!
<= br>-- Johnny
--0000000000002339f105be4da64b-- --===============5029784788606099166== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dm-crypt mailing list -- dm-crypt@saout.de To unsubscribe send an email to dm-crypt-leave@saout.de --===============5029784788606099166==--