[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

reduce crypt partition



i need a little help reducing my crypt partition.  when i first
installed debian, i used a rather standard /boot on /dev/hda1 and crypt
on /dev/hda2, using LVM for the rest of the partitions.

i've been following this[1] resize guide and i am at step 5, having
already resized my logical LVM root and physical LVM volumes
successfully.  /boot is about 230M and the rest (~39G) is allocated for
crypt.  inside crypt i now have a 20G physical LVM volume with 512M swap
and 10G root logical volumes, and ~10G free space.  now i just want to
reduce crypt so it is also about 20G, leaving the rest of the ~19G as
free space on the drive.

the final step it seems, before praying, is to delete /dev/hda2 with
fdisk and recreate it with the smaller size.  i'm wondering what the
correct size should be; i'm afraid i might make it too small and then
corrupt everything somehow.  i don't have the same layout as in the
guide since ubuntu does it a little differently with extended
partitions, so a little assistance going through fdisk would be appreciated.

below is some info from fdisk and LVM, let me know if you need more
info.  thanks so much


1.
https://help.ubuntu.com/community/ResizeEncryptedPartitions#Detailed_resizing_.2BAH4_Reducing_an_encrypted_partition

$ sudo fdisk -l

Disk /dev/hda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3f423f42

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          31      248976   83  Linux
/dev/hda2              32        4864    38821072+  83  Linux

Disk /dev/dm-0: 39.7 GB, 39751725568 bytes
255 heads, 63 sectors/track, 4832 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 10.8 GB, 10850664448 bytes
255 heads, 63 sectors/track, 1319 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/dm-2: 536 MB, 536870912 bytes
255 heads, 63 sectors/track, 65 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-2 doesn't contain a valid partition table
$ sudo pvdisplay
  --- Physical volume ---
  PV Name               /dev/dm-0
  VG Name               graveyard
  PV Size               20.00 GB / not usable 3.81 MB
  Allocatable           NO
  PE Size (KByte)       4096
  Total PE              5119
  Free PE               2404
  Allocated PE          2715
  PV UUID               HMRsf8-1ePs-J33c-4tQu-7MtA-V6dv-O0U10R
$ sudo lvdisplay
  --- Logical volume ---
  LV Name                /dev/graveyard/root
  VG Name                graveyard
  LV UUID                C7bLop-WiHU-dwRy-3jBR-k1QP-rQEH-X9Zchr
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                10.11 GB
  Current LE             2587
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1

  --- Logical volume ---
  LV Name                /dev/graveyard/swap_1
  VG Name                graveyard
  LV UUID                yyUTnD-JVGR-BzVb-krSR-Mswq-aYoE-9YYfJt
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                512.00 MB
  Current LE             128
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:2


Reply to: