Wednesday, January 11, 2012

Resizing/Growing Encrypted BTRFS Root Partition

Installed Fedora 16 into 10GB KVM guest. Copied kvm img file to laptop with 110GB drive. Install created with 1MB BIOS boot partition, 500MB Grub boot (/boot) partition, 2GB encrypted swap partition and 10GB encrypted root (/) partition. Increased root partition with the following steps after install and 'yum update'.

- Booted livecd (Parted Magic, SystemRescueCD, etc).
- Used 'parted' to print partition table info. Noted Start location.
- Used 'parted' to delete partition. Ex. rm 4
- Used 'parted' to recreate partition. Set start to noted start location. Ex. 'mkpart 4 100%'
- Restarted system.
- Booted livecd again.
- Opened crypt with cryptsetup (cryptsetup luksOpen ). Crypt opened at /dev/mapper/ . Ex. 'cryptsetup luksOpen /dev/sda4 sda4'
- Resized crypt with cryptsetup (cryptsetup resize ). Crypt resized to 100% of partition space. Ex. 'cryptsetup resize sda4'
- Mounted BTRFS Filesystem (mount ). Ex.'mount /dev/mapper/sda4 /mnt/sda4'
- Resized BTRFS Filesystem (btrfs filesystem resize max ). Filesystem grew to size of crypt. Ex. 'btrfs filesystem resize max /mnt/sda4'
- Unmounted BTRFS Filesystem(umount ). Ex. 'umount /mnt/sda4'
- Closed crypt (cryptsetup luksClose ). Ex. 'cryptsetup luksClose sda4'
- Restarted system

The BTRFS partition resized to 100% of the free space.


0 Comments:

Post a Comment

<< Home