StickyC
2007-01-29, 04:27 PM CST
I'd like to remove one of the physical disks (/dev/sdb) from my FC4 setup. Here's my system information:
# fdisk -l
Disk /dev/sda: 40.0 GB, 40000000000 bytes
255 heads, 63 sectors/track, 4863 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 4863 38957625 8e Linux LVM
Disk /dev/sdb: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 9726 78124063+ 8e Linux LVM
# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name VolGroup00
PV Size 37.12 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 1188
Free PE 0
Allocated PE 1188
PV UUID 6tzgee-mr0Q-gtcE-u0Yf-VyVQ-zndo-ECg5c7
--- Physical volume ---
PV Name /dev/sdb1
VG Name VolGroup00
PV Size 74.50 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 2384
Free PE 2
Allocated PE 2382
PV UUID r07Hzj-cGt2-6DFD-bYDN-pRmV-Ky38-BYm7X2
#lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID eJv4rF-S2RW-RmCr-ELoo-DXgb-JYFn-K4o6xK
LV Write Access read/write
LV Status available
# open 1
LV Size 109.62 GB
Current LE 3508
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:0
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID YdY6GP-T5iM-azYe-3RST-iMLJ-Iqd6-5r2mvy
LV Write Access read/write
LV Status available
# open 1
LV Size 1.94 GB
Current LE 62
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1
# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
/dev/proc on /proc type proc (rw)
/dev/sys on /sys type sysfs (rw)
/dev/devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
/dev/shm on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
automount(pid2257) on /net type autofs (rw,fd=4,pgrp=2257,minproto=2,maxproto=4)
automount(pid2212) on /misc type autofs (rw,fd=4,pgrp=2212,minproto=2,maxproto=4)
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
107G 24G 78G 24% /
/dev/sda1 99M 14M 80M 15% /boot
/dev/shm 1013M 0 1013M 0% /dev/shm
My understanding of the process is that I need to do the following:
pvmove /dev/sdb1 to move all of the extents off of sdb1
lvreduce -L 74500 VolGroup00 Reduced the size of VolGroup00 by 74.5gb (is this needed if I do vgreduce? Should it be the full 80gb instead of the 74.5 reported by pvdisplay?)
vgreduce VolGroup00 /dev/sdb1 Removes /dev/sdb1 from VolGroup00
I should then be able to remove the drive...
I tried to do a pvmove /dev/sdb1, and got the "No extents available for allocation". From what I read, this is because my ext3 partition / is taking up all of the logical volume, so it can't truncate the volume size. So, I need to resize / to fit on a single drive (<40gb). This is where I'm stuck - how do I go about resizing the ext3 partition? My understanding is that QTparted and such dont support LVM's yet. Can I dynamically resize an ext3 partition while it's mounted?
Thanks for any clarifications/help you guys can give - I've been reading posts/how-tos on this stuff for 2 days and my knowledge is pretty scrambled.
# fdisk -l
Disk /dev/sda: 40.0 GB, 40000000000 bytes
255 heads, 63 sectors/track, 4863 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 4863 38957625 8e Linux LVM
Disk /dev/sdb: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 9726 78124063+ 8e Linux LVM
# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name VolGroup00
PV Size 37.12 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 1188
Free PE 0
Allocated PE 1188
PV UUID 6tzgee-mr0Q-gtcE-u0Yf-VyVQ-zndo-ECg5c7
--- Physical volume ---
PV Name /dev/sdb1
VG Name VolGroup00
PV Size 74.50 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 2384
Free PE 2
Allocated PE 2382
PV UUID r07Hzj-cGt2-6DFD-bYDN-pRmV-Ky38-BYm7X2
#lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID eJv4rF-S2RW-RmCr-ELoo-DXgb-JYFn-K4o6xK
LV Write Access read/write
LV Status available
# open 1
LV Size 109.62 GB
Current LE 3508
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:0
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID YdY6GP-T5iM-azYe-3RST-iMLJ-Iqd6-5r2mvy
LV Write Access read/write
LV Status available
# open 1
LV Size 1.94 GB
Current LE 62
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1
# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
/dev/proc on /proc type proc (rw)
/dev/sys on /sys type sysfs (rw)
/dev/devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
/dev/shm on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
automount(pid2257) on /net type autofs (rw,fd=4,pgrp=2257,minproto=2,maxproto=4)
automount(pid2212) on /misc type autofs (rw,fd=4,pgrp=2212,minproto=2,maxproto=4)
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
107G 24G 78G 24% /
/dev/sda1 99M 14M 80M 15% /boot
/dev/shm 1013M 0 1013M 0% /dev/shm
My understanding of the process is that I need to do the following:
pvmove /dev/sdb1 to move all of the extents off of sdb1
lvreduce -L 74500 VolGroup00 Reduced the size of VolGroup00 by 74.5gb (is this needed if I do vgreduce? Should it be the full 80gb instead of the 74.5 reported by pvdisplay?)
vgreduce VolGroup00 /dev/sdb1 Removes /dev/sdb1 from VolGroup00
I should then be able to remove the drive...
I tried to do a pvmove /dev/sdb1, and got the "No extents available for allocation". From what I read, this is because my ext3 partition / is taking up all of the logical volume, so it can't truncate the volume size. So, I need to resize / to fit on a single drive (<40gb). This is where I'm stuck - how do I go about resizing the ext3 partition? My understanding is that QTparted and such dont support LVM's yet. Can I dynamically resize an ext3 partition while it's mounted?
Thanks for any clarifications/help you guys can give - I've been reading posts/how-tos on this stuff for 2 days and my knowledge is pretty scrambled.