Shrinking the disk partition with Logical Volumes on it problem
I have the following problem. I want to reduce the size of my hard disk on which the Logical Volumes exist.
I do the following steps
Boot from my Red Hat disk, and choose Linux Rescue mode.
then i do following
(on Logical volumes there is not yet any filesystem, they are empty)
1. Shrink the Logical Volume by the command:
lvm lvresize -LNewSize Generalgroup/LogVolVar
2. Shrink the Physical volume:
lvm pvresize --setphysicalvolumesize newSize /dev/hda2
3. Shrink the partition with fdisk:
delete the partition:
Command :d
Partition number (1-4) 2
--------------------------
create new partition
Command:n
Command action
e extend
p primary partition (1-4)
p
Partition number (1-4)2
First cylinder (229-17753 ,default 229) 229
Last cylinder (229-17753, default 17753) NewSize
--------------------------------------
change type of partition from Linux to LVM partition
command :t
partition number (1-4):2
Hex code (type L to list codes):8e
Changed system type of partition 2 to 8e (Linux LVM)
----------------------------------------
and last save the changes by rewriting the partition table
Command: w
The partition table has been altered!
Calling ioctl() to re-read partition table
Syncing disks.
Then i run reboot
and then make the volumes available:
lvm vgchange -ay
device-mapper: reload ioctl failed: Invalid argument
4 logical volume(s) in volume group "GeneralGroup" now active
after that i see no LogVolVar Logical volume in the group
and if run
dmsetup table
i see that table LogVolVar is empty
We can see the Volome in the group only if run
lvm vgscan --mknodes.
However that is not fix the problem.
Have any any ideas how to fix the problem, what was incorrect in my operations, write please.
|