dm-crypt.saout.de archive mirror
 help / color / mirror / Atom feed
From: Johnny Dahlberg <svartchimpans@gmail.com>
To: "Carlos E. R." <robin.listas@telefonica.net>
Cc: dm-crypt mail list <dm-crypt@saout.de>
Subject: [dm-crypt] Re: Aligning entire LUKS/LVM/Ext4 filesystem stack to 4K sectors
Date: Wed, 24 Mar 2021 20:53:00 +0100	[thread overview]
Message-ID: <CA+3G=9jwG465ALjufeuK5ihSQxe5-iOCE5ZhkXh11s+_rqnB6w@mail.gmail.com> (raw)
In-Reply-To: <ecfbdb33-e386-5ed9-9c44-cf1d48b55400@telefonica.net>


[-- Attachment #1.1: Type: text/plain, Size: 2326 bytes --]

On Fri, 19 Mar 2021 at 23:21, Carlos E. R. <robin.listas@telefonica.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 г., 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

[-- Attachment #1.2: Type: text/html, Size: 3335 bytes --]

[-- Attachment #2: Type: text/plain, Size: 147 bytes --]

_______________________________________________
dm-crypt mailing list -- dm-crypt@saout.de
To unsubscribe send an email to dm-crypt-leave@saout.de

  reply	other threads:[~2021-03-24 19:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 16:09 [dm-crypt] Aligning entire LUKS/LVM/Ext4 filesystem stack to 4K sectors Johnny Dahlberg
     [not found] ` <_X7kzj_AZLSVcCkPM4xu_QoNVntVev87vOgJfHun_dR43IVunAzxvUFJubPVV3sDAMoJlJJAlFuljdv5Svkz49B5VMFXABWrEEk641NrHs4=@fomin.one>
     [not found]   ` <ORDtENr6aBENCEKNaBoLivcFJL2TWrcPLZcM1NDn9mSyDJlbXgdwUR5HbCRsw9etKJIKiByQV4qkuFO1h9pVyX4_wv89xQUFNc2CcU8mqug=@fomin.one>
2021-03-19 20:24     ` [dm-crypt] " Johnny Dahlberg
2021-03-19 20:45       ` Carlos E. R.
2021-03-19 21:39         ` Johnny Dahlberg
2021-03-19 22:19           ` Carlos E. R.
2021-03-24 19:53             ` Johnny Dahlberg [this message]
2021-03-25  8:01               ` Erwin van Londen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+3G=9jwG465ALjufeuK5ihSQxe5-iOCE5ZhkXh11s+_rqnB6w@mail.gmail.com' \
    --to=svartchimpans@gmail.com \
    --cc=dm-crypt@saout.de \
    --cc=robin.listas@telefonica.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).