Fresh install with LUKS

Hello togheter
I’ve installed my new notebook (Tuxedo Pulse 14 Gen3) with manjaro xfce 23.1.4.
Because I want to use the notebook for business I’ve chosen LUKS for root and SWAP. When booting, after entering the key, the following messages appear:
error: attempt to read or write outside of disk cryptouuid/d21317...

All things are working, should I be worried?

Filesystem I use: xfs

/etc/crypttab

luks-d2131788-c1b8-46cd-ba6c-1617706c8483 UUID=d2131788-c1b8-46cd-ba6c-1617706c8483     /crypto_keyfile.bin luks
luks-5e256057-ece0-4835-b9f0-922b70eaa081 UUID=5e256057-ece0-4835-b9f0-922b70eaa081     /crypto_keyfile.bin luks

/etc/fstab

UUID=4CC0-895A                            /boot/efi      vfat    umask=0077 0 2
/dev/mapper/luks-d2131788-c1b8-46cd-ba6c-1617706c8483 /              xfs     defaults,noatime 0 1
/dev/mapper/luks-5e256057-ece0-4835-b9f0-922b70eaa081 swap           swap    defaults,noatime 0 0
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0

swap infos

$ swapon --show
NAME      TYPE       SIZE USED PRIO
/dev/dm-1 partition 32.1G   0B   -2

$ cat /proc/meminfo  | grep -i swap
SwapCached:            0 kB
SwapTotal:      33664924 kB
SwapFree:       33664924 kB
Zswap:                 0 kB
Zswapped:              0 kB
1 Like

This could mean the partition alignment is off.

There is a couple of articles

1 Like

Good idea. I’ll try this and post my results

1 Like

Did you partition manually or is this a installer error?

First try manually, second automatic. Same errors.
I don’t know if I have today enough time, it’s getting late at work.

Are you using grub2 to boot the system?
Check /etc/default/grub if GRUB_DEFAULT=saved is set and possibly disable that followed by update-grub to regenerate /boot/grub/grub.cfg.

For me, it looks good.

[lucarelli@marco-tuxedopulse14gen3 ~]$ sudo xfs_info /dev/mapper/luks-d2131788-c1b8-46cd-ba6c-1617706c8483 
meta-data=/dev/mapper/luks-d2131788-c1b8-46cd-ba6c-1617706c8483 isize=512    agcount=4, agsize=58923860 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=1
         =                       reflink=1    bigtime=1 inobtcount=1 nrext64=1
data     =                       bsize=4096   blocks=235695439, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=115085, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

[lucarelli@marco-tuxedopulse14gen3 ~]$ sudo blockdev --getbsz /dev/mapper/luks-d2131788-c1b8-46cd-ba6c-1617706c8483 
512

[lucarelli@marco-tuxedopulse14gen3 ~]$ sudo cryptsetup status luks-d2131788-c1b8-46cd-ba6c-1617706c8483
/dev/mapper/luks-d2131788-c1b8-46cd-ba6c-1617706c8483 is active and is in use.
  type:    LUKS1
  cipher:  aes-xts-plain64
  keysize: 512 bits
  key location: dm-crypt
  device:  /dev/nvme0n1p2
  sector size:  512
  offset:  4096 sectors
  size:    1885563516 sectors
  mode:    read/write

[lucarelli@marco-tuxedopulse14gen3 ~]$ sudo fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 970 EVO Plus 1TB            
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 0491EAA4-6EF8-46DD-A73B-7BFE9E304667

Device              Start        End    Sectors   Size Type
/dev/nvme0n1p1       4096     618495     614400   300M EFI System
/dev/nvme0n1p2     618496 1886186107 1885567612 899.1G Linux filesystem
/dev/nvme0n1p3 1886186108 1953520064   67333957  32.1G Linux filesystem
[lucarelli@marco-tuxedopulse14gen3 ~]$ sudo fdisk -l /dev/mapper/luks-d2131788-c1b8-46cd-ba6c-1617706c8483 
Disk /dev/mapper/luks-d2131788-c1b8-46cd-ba6c-1617706c8483: 899.11 GiB, 965408520192 bytes, 1885563516 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[lucarelli@marco-tuxedopulse14gen3 ~]$ 

Yes. I’ve grub2. After your change, the error message is the same.

Here my /etc/default/grub

# GRUB boot loader configuration

#GRUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="quiet cryptdevice=UUID=d2131788-c1b8-46cd-ba6c-1617706c8483:luks-d2131788-c1b8-46cd-ba6c-1617706c8483 root=/dev/mapper/luks-d2131788-c1b8-46cd-ba6c-1617706c8483 splash resume=/dev/mapper/luks-5e256057-ece0-4835-b9f0-922b70eaa081 udev.log_priority=3"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Set to 'countdown' or 'menu' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE=hidden

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command 'videoinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
GRUB_SAVEDEFAULT=true

# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU=y

# Uncomment this option to enable os-prober execution in the grub-mkconfig command
GRUB_DISABLE_OS_PROBER=false

# Uncomment to ensure that the root filesystem is mounted read-only so that
# systemd-fsck can run the check automatically. We use 'fsck' by default, which
# needs 'rw' as boot parameter, to avoid delay in boot-time. 'fsck' needs to be
# removed from 'mkinitcpio.conf' to make 'systemd-fsck' work.
# See also Arch-Wiki: https://wiki.archlinux.org/index.php/Fsck#Boot_time_checking
#GRUB_ROOT_FS_RO=true
GRUB_ENABLE_CRYPTODISK=y

The error message is only after i enter the passphrase, can’t find anything about it in logs (dmes, journalctl).

I’ve run the mention script from here: GitHub - crysman/check-partitions-alignment: a bash script to check correct partitions alignment
Now I’m really confused :frowning:

[lucarelli@marco-tuxedopulse14gen3 Documents]$ ./checkpartitionsalignment.sh 
ERR: no device specified
usage: checkpartitionsalignment.sh /dev/sdX
INFO: for your convenience, invoking 'lsblk'...
NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
nvme0n1                                       259:0    0 931.5G  0 disk  
├─nvme0n1p1                                   259:1    0   300M  0 part  /boot/efi
├─nvme0n1p2                                   259:2    0 899.1G  0 part  
│ └─luks-d2131788-c1b8-46cd-ba6c-1617706c8483 254:0    0 899.1G  0 crypt /
└─nvme0n1p3                                   259:3    0  32.1G  0 part  
  └─luks-5e256057-ece0-4835-b9f0-922b70eaa081 254:1    0  32.1G  0 crypt [SWAP]

[lucarelli@marco-tuxedopulse14gen3 Documents]$ ./checkpartitionsalignment.sh /dev/nvme0n1p1 
what does the parted utility say about /dev/nvme0n1p1 partitions alignment?
1 aligned
OK, seems to be all right, but...
let's check manually alignment to 4096B (necessary in case of SSD HDD):
Number  Start  End         Size        File system  Flags
1    0 % 4096 = 0    314572799(+1) % 4096 = 0    314572800 % 4096 = 0

OK, everything divisible by 4096, lucky you! :)

[lucarelli@marco-tuxedopulse14gen3 Documents]$ ./checkpartitionsalignment.sh /dev/nvme0n1p2
Error: /dev/nvme0n1p2: unrecognised disk label
Error: /dev/nvme0n1p2: unrecognised disk label
what does the parted utility say about /dev/nvme0n1p2 partitions alignment?
OK, seems to be all right, but...
let's check manually alignment to 4096B (necessary in case of SSD HDD):


OK, everything divisible by 4096, lucky you! :)

[lucarelli@marco-tuxedopulse14gen3 Documents]$ ./checkpartitionsalignment.sh /dev/nvme0n1p3
Error: /dev/nvme0n1p3: unrecognised disk label
Error: /dev/nvme0n1p3: unrecognised disk label
what does the parted utility say about /dev/nvme0n1p3 partitions alignment?
OK, seems to be all right, but...
let's check manually alignment to 4096B (necessary in case of SSD HDD):


OK, everything divisible by 4096, lucky you! :)

[lucarelli@marco-tuxedopulse14gen3 Documents]$ ./checkpartitionsalignment.sh /dev/nvme0n1
what does the parted utility say about /dev/nvme0n1 partitions alignment?
1 aligned
2 aligned
3 not aligned: 1886186108s % 2048s != 0s
OK, seems to be all right, but...
let's check manually alignment to 4096B (necessary in case of SSD HDD):
Number  Start          End             Size           File system  Name  Flags
1    2097152 % 4096 = 0            316669951(+1) % 4096 = 0          314572800 % 4096 = 0
2    316669952 % 4096 = 0          965727287295(+1) % 4096 = 2048    965410617344 % 4096 = 2048
3    965727287296 % 4096 = 2048    1000202273279(+1) % 4096 = 512    34474985984 % 4096 = 2560

WARNING: not divisible by 4096*:
2    316669952 % 4096 = 0          965727287295(+1) % 4096 = 2048    965410617344 % 4096 = 2048
3    965727287296 % 4096 = 2048    1000202273279(+1) % 4096 = 512    34474985984 % 4096 = 2560
* on color terminals printed in color
INFO: why this might be a problem? https://superuser.com/questions/393914/what-is-partition-alignment-and-why-whould-i-need-it
[lucarelli@marco-tuxedopulse14gen3 Documents]$ 

I’ve tried the same install procedure with ext4, now it works without any error message.
Tried the same again with xfs, error :frowning:

Yes - I noticed the same - I think Calamares has an issue with xfs - as I can manually create the setup without problems.

But not many noticed - I reckon that xfs is not widely used with Manjaro.

1 Like

I think I’ll stick with ext4.

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.