Solved [solved]GELI resize doesn't work.

Hi
Recently I have resized the partition from 300GB to 500GB, however the geli list still shows 300GB total space for the entire partition.

Below is my gpart status:
Code:
root@storage-backup1:~ # gpart show -l da1
=>        34  1048575933  da1  GPT  (500G)
          34        2014       - free -  (1M)
        2048  1048573919    1  data_disk0  (500G)

Code:
Geom name: gpt/data_disk0.eli
State: ACTIVE
EncryptionAlgorithm: AES-CBC
KeyLength: 256
Crypto: hardware
UsedKey: 0
Flags: NONE
KeysAllocated: 75
KeysTotal: 75
Providers:
1. Name: gpt/data_disk0.eli
   Mediasize: 322121474048 (300G)
   Sectorsize: 4096
   Mode: r0w0e0
Consumers:
1. Name: gpt/data_disk0
   Mediasize: 322121478144 (300G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 1048576
   Mode: r1w1e1

I have tried the following command with the encrypted partition attached, but non of it works.
Code:
root@storage-backup1:~ # geli resize -v -s 300G gpt/data_disk0.eli
geli: Invalid oldsize: Out of range.
root@storage-backup1:~ # geli resize -v -s 300G gpt/data_disk0.eli
geli: Invalid oldsize: Out of range.
root@storage-backup1:~ # geli resize -v -s 322121474048 gpt/data_disk0.eli
geli: Size hasn't changed.
root@storage-backup1:~ # geli resize -v -s 322121478144 gpt/data_disk0.eli
geli: Invalid oldsize: Out of range.

Trying to resize again after detached the encrypted partition, same results.
Code:
root@storage-backup1:~ # geli detach /dev/gpt/data_disk0.eli
root@storage-backup1:~ # geli resize -v -s 322121474048 gpt/data_disk0
geli: MD5 hash mismatch: no metadata for oldsize.
root@storage-backup1:~ # geli resize -v -s 322121478144 gpt/data_disk0
geli: Size hasn't changed.

Is the geli encrypted partition resizable?
 
Re: GELI resize doesn't work.

My bad, problem solved after reboot the server, it might be the new partition size doesn't take effect without restarting.

After that the geli resize -s 322121474048 gpt/data_disk0 works.
 
Re: GELI resize doesn't work.

belon_cfy said:
My bad, problem solved after reboot the server, it might be the new partition size doesn't take effect without restarting.
I think you only have to trigger the system to re-read it. If it's an external drive unplugging it for a second and plugging it back in should do it. This should do it too: true > /dev/da1
 
Back
Top