Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • C cryptsetup
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 5
    • Merge requests 5
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • cryptsetupcryptsetup
  • cryptsetup
  • Issues
  • #372
Closed
Open
Issue created Mar 26, 2018 by Frederick Zhang@FrederickZh

[Suggestion needed] High memory usage when opening a LUKS2 partition

I was trying to open a 7.2TB encrypted ext4 partition on my Raspberry Pi (1G memory, 8G swap, using cryptsetup 2.0.2) but got:

Mar 27 00:26:25 Pi3BP kernel: Out of memory: Kill process 738 (cryptsetup) score 93 or sacrifice child
Mar 27 00:26:25 Pi3BP kernel: Killed process 738 (cryptsetup) total-vm:1056100kB, anon-rss:888844kB, file-rss:5704kB, shmem-rss:0kB
Mar 27 00:26:25 Pi3BP kernel: oom_reaper: reaped process 738 (cryptsetup), now anon-rss:888940kB, file-rss:5692kB, shmem-rss:0kB

The partition was created via

cryptsetup --cipher aes-xts-plain64 --key-size 256 --hash sha256 luksFormat --type luks2 /dev/sdb1

Having no idea why cryptsetup open was consuming such a large amount of memory, I spent hours googling the issue but got no clue at the end. But since most of the successful examples I found were quite old and apparently they were using LUKS1, I tried re-formatting the partition with --type luks1 and this time it just got mounted on Raspberry Pi without any error.

May I know:

  1. Are there any workarounds to this issue?
  2. What factors influence the memory usage?

This is pretty much the first time for me to try out disk encryption and I am still absolutely a n00b. It would be greatly appreciated if you could provide me some suggestions. Thanks!

Assignee
Assign to
Time tracking