luks cannot create small volumes < 8M
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cryptsetup (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I wanted to create a new luks image file, or actually increase the size of one that had overflowed.
Each time I get the error message:
Requested offset is beyond real size of device /work/e/
There is a suggestion this happens if you already have a luks drive mounted that is larger. I had nothing mounted through mapper.
I successfully created my volume on 16.04, and 18.04. It fails on 20.04 after clean boot, and one device mount "sudo mount /dev/sda10 /work". I also mount /opt, and /big in my fstab
I believe all versions have already been gathered.
#!/bin/sh
dd if=/dev/zero of=codes.cryp bs=1024 count=8000 # 4M volume
sudo cryptsetup -vy luksFormat codes.cryp
sudo cryptsetup luksOpen /work/e/
sudo mkfs.ext4 /dev/mapper/codes
sudo cryptsetup luksClose codes
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: cryptsetup 2:2.2.2-3ubuntu2
ProcVersionSign
Uname: Linux 5.4.0-28-generic x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Wed Apr 29 15:56:38 2020
InstallationDate: Installed on 2020-04-26 (3 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
SourcePackage: cryptsetup
UpgradeStatus: No upgrade log present (probably fresh install)
cmdline: BOOT_IMAGE=
crypttab: # <target name> <source device> <key file> <options>
Here is my "df -h" after mounting an 800M old volume, and the one created on 16.04 4.7M just now
Filesystem Size Used Avail Use% Mounted on e/codes
udev 3.8G 0 3.8G 0% /dev
tmpfs 785M 2.2M 783M 1% /run
/dev/sda8 46G 17G 27G 38% /
tmpfs 3.9G 26M 3.9G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda9 1.9G 1.2G 571M 68% /opt
/dev/sda2 96M 33M 64M 34% /boot/efi
/dev/sda11 270G 210G 47G 82% /big
tmpfs 785M 44K 785M 1% /run/user/1000
/dev/sda10 4.5G 1.9G 2.4G 45% /work
/dev/mapper/proj 803M 278M 468M 38% /proj
/dev/mapper/codes 4.7M 60K 4.2M 2% /home/francis/