DM-Crypt Archive mirror
 help / color / mirror / Atom feed
From: Erwin van Londen <erwin@erwinvanlonden.net>
To: Johnny Dahlberg <svartchimpans@gmail.com>,
	"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: Thu, 25 Mar 2021 18:01:16 +1000	[thread overview]
Message-ID: <5621b9d7e6e577a6388695cfa27d20fc3a2c8271.camel@erwinvanlonden.net> (raw)
In-Reply-To: <CA+3G=9jwG465ALjufeuK5ihSQxe5-iOCE5ZhkXh11s+_rqnB6w@mail.gmail.com>

I think the quickest way to find out is:

"lsblk -o name,phy-sec,log-sec"

Output like this shows it nicely:

[ monster % ~ ] lsblk -o name,phy-sec,log-sec                         
[  5:57PM ]
NAME                   PHY-SEC LOG-SEC
sda                        512     512
├─sda1                     512     512
└─sda2                     512     512
  ├─vg_monster-lv_home     512     512
  ├─vg_monster-lv_swap     512     512
  └─vg_monster-lv_root     512     512
sdb                        512     512
├─sdb1                     512     512
└─sdb2                     512     512

Obviously playing around with the output parameters gives you plenty
flexibility.

Cheers
Erwin

On Wed, 2021-03-24 at 20:53 +0100, Johnny Dahlberg wrote:
> 
> 
> 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! :-)
> > 
> > _______________________________________________
> > dm-crypt mailing list -- dm-crypt@saout.de
> > To unsubscribe send an email to dm-crypt-leave@saout.de

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

      reply	other threads:[~2021-03-25  8:28 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
2021-03-25  8:01               ` Erwin van Londen [this message]

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=5621b9d7e6e577a6388695cfa27d20fc3a2c8271.camel@erwinvanlonden.net \
    --to=erwin@erwinvanlonden.net \
    --cc=dm-crypt@saout.de \
    --cc=robin.listas@telefonica.net \
    --cc=svartchimpans@gmail.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).