You are not logged in.

#1 2010-07-02 09:41:49

Watermel0n
Member
Registered: 2010-03-10
Posts: 60

How to shrink an LUKS encrypted partition?

Alright, so I have this external hard drive with 1TB. I created 1 partition on it which spans the whole drive. Then I luks-encrypted this partition and put an ext4 filesystem on it. Now I need to make a second partition on it (~8GB). So how would I accomplish this without data loss? big_smile
I googled, but only found information about lvm-setups. In this case I don't use lvm.
Should I first resize the partition using fdisk and then somehow tell luks that the partition got smaller and last but not least resize the ext4 fs inside?
Could somebody help me out?

Edit: Alright so this is definitely the wrong way. I think first resizing the ext4 partition, then the partitiontable and then the luks should do the trick. Will try out and then report back.
Edit2: Alright this worked without problems.

Last edited by Watermel0n (2010-07-02 10:21:15)

Offline

#2 2011-01-26 18:38:39

siriusb
Member
From: Hungary
Registered: 2010-01-01
Posts: 422

Re: How to shrink an LUKS encrypted partition?

I'd like to resize 2 LUKS partitions, so I'm wondering what did you do after resizing ext4 filesystem. I think you used resize2fs for the first step, but I don't know how you resized the physical partition without deleting/recreating it.

Offline

Board footer

Powered by FluxBB