NetBSD-Users archive

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

Re: Is it possible to enlarge cgd-encrypted partition?



gdt%lexort.com@localhost (Greg Troxel) writes:

>I am guessing here, but:

>  - I'd expect that the underlying lv0, and cgd0 are now bigger.  You
>    could use dd to read them to see.

The disklabel (in memory, as retrieved with the disklabel program)
always shows the real size for the raw partition ('d' for x86).
If that didn't change, then cgd and the underlying "disk" didn't
change.

However, it doesn't change on the fly...

This is a cgd on LV similar to what is described:

# disklabel cgd0
...
total sectors: 1048576000
...
#        size    offset     fstype [fsize bsize cpg/sgs]
 a: 1048576000         0     4.2BSD      0     0     0  # (Cyl.      0 - 511999)
 d: 1048576000         0     unused      0     0        # (Cyl.      0 - 511999)


After extending the LV with 

# lvm lvextend -L +1G vg0/lvtest
  Extending logical volume lvtest to 501.00 GiB
  Logical volume lvtest successfully resized

the LV device already reports the new size (nees the 'raw' device as
the block device is busy).

# dkctl /dev/vg0/rlvtest getwedgeinfo
vg0-lvtest at vg0-lvtest: vg0-lvtest
vg0-lvtest: 1050673152 blocks at 0, type: ffs

but disklabel cgd0 still shows the same. There is no mechanism
to resize a cgd device.

But after:

# cgdconfig -u cgd0
# cgdconfig cgd0 /dev/vg0/lvtest

we see:

# disklabel cgd0
...
total sectors: 1050673152
...
#        size    offset     fstype [fsize bsize cpg/sgs]
 a: 1050673152         0     4.2BSD      0     0     0  # (Cyl.      0 - 513023)
 d: 1050673152         0     unused      0     0        # (Cyl.      0 - 513023)


The partition size has changed, and now the filesystem stored there could
be resized.



Home | Main Index | Thread Index | Old Index