LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Managing disk space (https://www.linuxquestions.org/questions/linux-newbie-8/managing-disk-space-704193/)

w11 02-12-2009 10:10 AM

Managing disk space
 
I have a server that has two 1TB hard drives set up in a RAID 1 configuration.
When I run df, the total size listed (used and unused) only adds up to about 28GB. How do I make the rest of the disk space available for use?
I am running Red Hat Enterprise 5.2.
Thanks.

instrumentpilot 02-12-2009 10:20 AM

Disk Space
 
Hi, how to make it all visible depends on how your disks are configured. Run the command below so we know what you have and someone will be able to beter help you.

# fdisk -l <-- that is a lower case L

Michael

w11 02-12-2009 10:22 AM

Hi, thanks for replying. Here are the results of that command:

Disk /dev/sda: 999.6 GB, 999653638144 bytes
255 heads, 63 sectors/track, 121534 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 8 64228+ de Dell Utility
/dev/sda2 9 661 5245222+ 8e Linux LVM
/dev/sda3 * 662 686 200812+ 83 Linux
/dev/sda4 687 121534 970711560 5 Extended
/dev/sda5 687 121534 970711528+ 8e Linux LVM

instrumentpilot 02-12-2009 11:39 AM

Ok, looks like the Dell install created an LVM (Logicial Volume) of around 970711528 bytes. That's fine. Now you want to see what it's named and how it is allocated. Try out the following commands.

# pvdisplay /dev/sda5 <-- This is the partition where the LVM exists

Keep track of the volume group name which is on the line with VG Name

# vgdisplay <VG Name from above>

Make note of the values which are something like this
Alloc PE / Size 1000 / 3.91 GB
Free PE / Size 5971 / 23.32 GB

This should show you about 950GB free.

What this is really going to show you is how much free space you have for a VG (volume group). This space can be used to create other LVMs with new file systems, or you can extend an LVM and file system to use more space. It is giving you flexibility.

Now, the next step is to learn how to use this free space.

One thing you might want to do is extend a file system. I don't know your layout so let's assume Dell put the /home filesystem on an LVM named mylvm. And further the LVM is on a VG named vg01.

# lvdisplay /dev/vg01/mylvm <-- will show current LV Size
# lvextend -L +5g /dev/vg01/mylvm <-- adds 5GB to the LVM for our fictitious /home filesystem.
# resize2fs /dev/vg01/mylvm <-- resize the filesystem to use all the space on the LVM.

P.S. I'm not sure the syntax for resize2fs is exact because I'm still on RHEL4 and I use ext2online. The ext2online command isn't available (from what I remember) on RHEL5 so you must use resize2fs.

To create a new filesystem do something like this.
# lvcreate -n mynewlvm -L 30g vg01
# mkfs.ext3 /dev/vg01/mynewlvm
# mkdir /newfilesystem

Then edit /etc/fstab and mount the new filesystem.

I hope all this helps, but if it doesn't get you there then write back.

Michael

w11 02-12-2009 12:20 PM

That was perfect, thank you!


All times are GMT -5. The time now is 02:23 PM.