[GTALUG] Thinkpad [3]: Aligning size of dm-crypt and partition/filesystem

Matt Price moptop99 at gmail.com
Wed Jun 15 10:43:18 EDT 2016


Final question! In order to enable suspend to disk, I ended up shrinking my
root partition (I also added an M.2 SSD, so the whole thing was a bit
complex). In the end I got it to work, but I made some kind of an error and
currently my on-disk “crypt” is a little larger than the partition and file
system that I am using for root, so I have some wasted space on the disk:

➜  ~ sudo fdisk /dev/sda
Command (m for help): p
Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 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
Disklabel type: gpt
Disk identifier: 9B4C2E92-6C7D-4C69-B67B-1823E4DB9BA6

Device         Start       End   Sectors   Size Type
/dev/sda1       2048   1026047   1024000   500M EFI System
/dev/sda2    1026048 106907647 105881600  50.5G Linux filesystem
/dev/sda3  106907648 483340287 376432640 179.5G Linux LVM
/dev/sda4  483340288 500117503  16777216     8G Linux swap

➜  ~ sudo cryptsetup status cryptsetup
/dev/mapper/cryptsetup is active and is in use.
  type:    LUKS1
  cipher:  aes-xts-plain64
  keysize: 256 bits
  device:  /dev/sda2
  offset:  4096 sectors
  size:    105877504 sectors
  mode:    read/write

Anyone out there have advice abot how to safely and reliably expand the
partition and the file system so that they both end precisely where the
crypt does?

Thanks again guys! as always, it’s much appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/talk/attachments/20160615/0d45d94b/attachment.html>


More information about the talk mailing list