
On 13 September 2012 17:53, Trent W. Buck <trentbuck@gmail.com> wrote:
I would completely avoid CHS. My preference also runs to parted beats sfdisk beats fdisk (but note that modern fdisk is implemented on top of libparted).
What units are stored in the partition table?
$ parted /dev/sdq unit b print
~ # parted /dev/sdq unit b print Error: Can't have a partition outside the disk! Whoops. I guess this is confirmation that there was a problem.
Maybe use of pvresize? Before or after fixing the partition size?
That would probably be better than my suggestion above.
Shame pvresize doesn't take number of extents for its resize, that would have been more precise. Anyway: ~ # pvresize --verbose --setphysicalvolumesize 232.47G /dev/sdq2 Using physical volume(s) on command line Archiving volume group "stg8" metadata (seqno 6). /dev/sdq2: Pretending size is 487524925 not 487540620 sectors. Resizing physical volume /dev/sdq2 from 59514 to 59512 extents. Resizing volume "/dev/sdq2" to 487524541 sectors. Updating physical volume "/dev/sdq2" Creating volume group backup "/etc/lvm/backup/stg8" (seqno 7). Physical volume "/dev/sdq2" changed 1 physical volume(s) resized / 0 physical volume(s) not resized Gives me the same number of extents as the good system. How do I update the partition table to end at the correct place? Am guessing this will require deleting the partition and re-adding it with fdisk, or is there a better way? To answer another part of my original email, the following displays the mappings of the extents: ~ # pvdisplay --map --- Physical volume --- PV Name /dev/sdq2 VG Name stg8 PV Size 232.47 GB / not usable 1.09 MB Allocatable yes PE Size (KByte) 4096 Total PE 59512 Free PE 50401 Allocated PE 9111 PV UUID 58fU6l-MLlo-h5Ar-n9jx-0poC-axdS-VoAmND --- Physical Segments --- Physical extent 0 to 1775: Logical volume /dev/stg8/swap Logical extents 0 to 1775 Physical extent 1776 to 2886: Logical volume /dev/stg8/var Logical extents 0 to 1110 Physical extent 2887 to 5270: Logical volume /dev/stg8/root Logical extents 0 to 2383 Physical extent 5271 to 6550: Logical volume /dev/stg8/var Logical extents 1111 to 2390 Physical extent 6551 to 9110: Logical volume /dev/stg8/root Logical extents 2384 to 4943 Physical extent 9111 to 59511: FREE Am a bit confused how this error occurred in the first place apparently was a standard Centos 5.x install. So maybe a bug in the installer? -- Brian May <brian@microcomaustralia.com.au>