Operating System - Linux
1822430 Members
2909 Online
109642 Solutions
New Discussion юеВ

How to use un-allocated space in Redhat linux

 
avizen9
Esteemed Contributor

How to use un-allocated space in Redhat linux

Dear Friends,
i am having one up and running Redhat Linux AS 4 update 5.

its configure hardware raid and its showing two physical HDD through it.

i have configure LVM on it as attached snapshot.
i still have around 340 gb free unallocated space in my second Hdd, can view attached snapshot.

i need to use this un-use space may be i can create new vg.
how to do it.
please advice.
thanks in advance for your reply.
5 REPLIES 5
avizen9
Esteemed Contributor

Re: How to use un-allocated space in Redhat linux

attached another snapshot
Jeeshan
Honored Contributor

Re: How to use un-allocated space in Redhat linux

follow the steps of creating VG's. just replace disk/vg name/lv name as per your scenario

pvcreate /dev/sda
vgcreate /dev/sda datavg
lvcreate -L MB -n datavg
mkfs -t ext3 /dev/datavg/datalv
Modify /etc/fstab.
a warrior never quits
Jeeshan
Honored Contributor

Re: How to use un-allocated space in Redhat linux

avizen9
Esteemed Contributor

Re: How to use un-allocated space in Redhat linux

Hi
thanks for your response,
but it will not work as i mentioned its unallocated space we can not create through pvcreate /dev/sda. you may refer attachment,
first we need to initialize this un-allocated space how?

so how to allocated this space..
Matti_Kurkela
Honored Contributor

Re: How to use un-allocated space in Redhat linux

First you must use a disk partitioning tool (fdisk, cfdisk or sfdisk on the command line, or some GUI partitioning tool) to create a new partition /dev/sdb6 and set its type to "LVM Physical Volume".

If your /dev/sdb drive is in use when you use fdisk, the change may not take effect immediately. The partitioning tool will tell you if this happens. If so, you must reboot to make the kernel recognize the new partition table.

After the reboot (or if the system accepted the partition table change without a reboot), you can use "pvcreate /dev/sdb6" to initialize the disk space as a LVM Physical Volume. Then you can use it to either extend an existing VG (with vgextend) or to create a new VG (with vgcreate).

If you use vgextend, you can then either create new LVs in the existing VG (with lvcreate) or enlarge existing LVs.

To enlarge an existing LV, you should first use lvextend to extend the LV. After that is successfully done, you must use the correct filesystem extension tool based on which filesystem is used on the LV. For ext2/ext3 filesystems, "ext2online" allows extending the filesystem without unmounting it.


By the way, creating multiple LVM Physical Volumes on a single disk is kind of silly, unless you have a specific reason to create multiple VGs using only one disk.

A better strategy for data disks is to set up just one LVM Physical Volume that encompasses the entire disk: then you can use the LVM commands to add new LVs or extend the existing LVs with no need to reboot.

MK
MK