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

Matt Price moptop99 at gmail.com
Wed Jun 15 21:22:13 EDT 2016


On Wed, Jun 15, 2016 at 5:59 PM, o1bigtenor <o1bigtenor at gmail.com> wrote:

> On Wed, Jun 15, 2016 at 9:43 AM, Matt Price via talk <talk at gtalug.org>
> wrote:
> > 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.
> >
>
> No ideas on the other two problems but on this one I would recommend
> using something like:
>
> boot your system using a system rescue disc
>
Yes! I use the Ubuntu livecd just because it's easy to get

> adjust your partition(s)  (carefully please) using gparted
>
is that adequate? Can I be sure that the crypt and the partition match
exactly? I feel like it's somewhat difficult to measure the size & extent
of a crypt in units that gparted also understands

> close
>
> reboot as regular
>
> Should be real easy (assuming that the empty space is right beside
> where you want it.
> Recommend a backup before but then you already know that - - yes?
>
yes... though I don't always follow recommendations.

>
> Let us know what you use
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/talk/attachments/20160615/8f97e019/attachment.html>


More information about the talk mailing list