resize partition (ext3)

Paul Howarth paul at city-fan.org
Tue Dec 13 11:26:39 UTC 2005


Joao Paulo Pires wrote:

> [root at localhost ~]# vgdisplay -v
>  Finding all volume groups
>  Finding volume group "VolGroup00"
>  --- Volume group ---
>  VG Name VolGroup00
>  System ID
>  Format lvm2
>  Metadata Areas 1
>  Metadata Sequence No 3
>  VG Access read/write
>  VG Status resizable
>  MAX LV 0
>  Cur LV 2
>  Open LV 2
>  Max PV 0
>  Cur PV 1
>  Act PV 1
>  VG Size 7,22 GB
>  PE Size 32,00 MB
>  Total PE 231
>  Alloc PE / Size 230 / 7,19 GB
>  Free PE / Size 1 / 32,00 MB
>  VG UUID tqkTWr-4YDO-h1Wg-mvDr-v5VA-7P7Y-L0NJuS
> 
>  --- Logical volume ---
>  LV Name /dev/VolGroup00/LogVol00
>  VG Name VolGroup00
>  LV UUID kSqC2v-O1HO-VPnq-srI7-8SPO-Pf3k-xFlPcR
>  LV Write Access read/write
>  LV Status available
>  # open 1
>  LV Size 6,22 GB
>  Current LE 199
>  Segments 1
>  Allocation inherit
>  Read ahead sectors 0
>  Block device 253:0
> 
>  --- Logical volume ---
>  LV Name /dev/VolGroup00/LogVol01
>  VG Name VolGroup00
>  LV UUID ozhTCq-x0lW-rByz-GdSm-pOyu-FSCA-Xf0777
>  LV Write Access read/write
>  LV Status available
>  # open 1
>  LV Size 992,00 MB
>  Current LE 31
>  Segments 1
>  Allocation inherit
>  Read ahead sectors 0
>  Block device 253:1
> 
>  --- Physical volumes ---
>  PV Name /dev/hda3
>  PV UUID D5883J-M9LB-gc5Z-dVa9-y3Pb-QOOf-sWDN8r
>  PV Status allocatable
>  Total PE / Free PE 231 / 1
> 
>  [root at localhost ~]# fdisk -l
> 
>  Disk /dev/hda: 40.0 GB, 40007761920 bytes
>  255 heads, 63 sectors/track, 4864 cylinders
>  Units = cylinders of 16065 * 512 = 8225280 bytes
> 
>  Device Boot Start End Blocks Id System
>  /dev/hda1      1 2557 20539071 7 HPFS/NTFS
>  /dev/hda2 * 3909 3921 104422+ 83 Linux
>  /dev/hda3   3922 4864 7574647+ 8e Linux LVM
> 
>  Disk /dev/sda: 1048 MB, 1048576000 bytes
>  64 heads, 32 sectors/track, 1000 cylinders
>  Units =3D cylinders of 2048 * 512 =3D 1048576 bytes
> 
>  Device Boot Start End Blocks Id System
>  /dev/sda1 * 1 1000 1023983+ 6 FAT16
>  Partition 1 has different physical/logical endings:
>  phys=(998, 63, 32) logical=(999, 63, 31)
>  [root at localhost ~]#
>  ---------------------------------------
>  haw can I resize my disk? I free some GB from windows but I need reallocate to FC4. How? Any help? TIA, Joao

You didn't say where the space was that you freed up, but there appears 
to be some between cylinders 2558 and 3908 inclusive (about 10GB).

Here are a couple of approaches you could use to add this space to your 
Linux system:

A: Add as a single filesystem.

You could create a new partition hda4 using "fdisk" and make that 
partition type "Linux". You could then write a regular filesystem to 
that partition using "mke2fs" and mount it somewhere like "/space", and 
that would give you all that extra space under that directory. Fairly 
straightforward, but the space might not be where you want it (e.g. /var 
or /usr).

B: Add to LVM.

You create a new partition hda4 using "fdisk" and make that partition 
type "Linux LVM". You then create a new LVM physical volume on that 
partition using "pvcreate", add that volume to existing volume group 
"VolGroup00" using "vgextend", then extend the size of the volume 
containing your root filesystem (/dev/VolGroup00/LogVol00) using 
"lvextend". You then need to resize your root filesystem, and you'll 
need to boot from the rescue CD to do that since you'd be more than 
doubling its size. Boot from the rescue CD, have it mount all of your 
partitions and then unmount everything from /mnt/sysimage and below. 
Then use "resize2fs /dev/VolGroup00/LogVol00". It'll probably tell you 
to do an "fsck" first. Having done all this (see the manpages for each 
command, and the LVM HOWTO), you'll end up with a system with an extra 
10G for your root partition, which you can use wherever you need it.

Paul.






More information about the users mailing list