shrink pv without pvresize (FC3 LVM)
I did something stupid, and I need help.
The goal is to have a single hard drive with four partitions: NTFS, FAT32 (/home), swap, and LVM ext3 (/). What I have now is NTFS, Swap, and one LVM VG that contains both / and /home, and both are ext3.
First,
# pvresize Command not implemented yet.
Is there a workaround (short of writing pvresize)?
Second, I had a feeble hope that Windows XP (booted off the NTFS partition) would deign to see a FAT32 LV under LVM. That is, if I change /home to be FAT32, Windows might see it, so I figured I'd give it a shot. (Is this futile?)
# mkdosfs -F 32 /dev/VolGroup00/LogVol02 mkdosfs 2.8 (28 Feb 2001) mkdosfs: Unable to get drive geometry for '/dev/VolGroup00/LogVol02'
Why can't it get the geometry? Does LVM support FAT32 LVs? Does mkdosfs support LVM?
Thanks!
Quoted 3 lines · Ilya Goldin
# pvresizeIs there a workaround (short of writing pvresize)?
Yes - vgcfgbackup, edit backup file, vgcfgrestore.
The field you need to edit to change the size is pe_count according to:
pe_start + pe_count * extent_size <= dev_size
i.e.
pe_count <= (dev_size - pe_start) / extent_size
You can find out the current device size with:
pvs -o +dev_size --units s
[The units used in the file are sectors of 512 bytes]
Only change pe_count for the PV you're resizing and nothing else!
Alasdair
Signature · 1 line
[email protected]
Quoted 1 line · Alasdair G Kergon
Only change
pe_countfor the PV you're resizing and nothing else!
And I forgot to say the obvious: if you're shrinking a PV, be sure to pvmove any data off the part you're removing first:-)
If you've only one PV, you might need 'pvmove --alloc anywhere' to do this.
Alasdair
Signature · 1 line
[email protected]
Quoted 2 lines · Ilya Goldin
Why can't it get the geometry? Does LVM support FAT32 LVs? Does mkdosfs support LVM?
ioctl(3, HDIO_GETGEO, 0xbffffa8c) = -1 ENOTTY (Inappropriate ioctl for device)
Something probably needs to make up a geometry.
Alasdair
Signature · 1 line
[email protected]