Extend a linux Volume

I have two main partitions as below;

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      100G   94G 1009M  99% /
/dev/cciss/c0d0p1      99M   13M   82M  14% /boot
tmpfs                  16G     0   16G   0% /dev/shm
/dev/cciss/c0d1       404G  236G  149G  62% /DataDrive

I need to extend the size of the root partition "/" by about 60Gb to accommodate the DB size. Am not sure how to do this without losing or corrupting the data. I have seen some documentation that show with LVM, this is easy to do. But I need a step by step process with no risk.

Please help.
ackimcAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
Kerem ERSOYPresidentCommented:
Hi,

It is easy:
- Just create another disk over your RAID (say /dev/cciss/c0d0p4)
- Execute pvcreate : pvcreate /dev/cciss/c0d0p4
- Execute vgextend  :vgextend /dev/VolGroup00 /dev/cciss/c0d0p4
- Execute lvextend (assuming the new volume is 200Gig) : lvextend +L200G /dev/VolGroup00/LogVol00
- Now you can extend the filesystem using resize2fs : resize2fs /dev/VolGroup00/LogVol00

Here are some documentation:
http://www.turnkeylinux.org/blog/extending-lvm
http://www.redhat.com/magazine/009jul05/features/lvm2/

Cheers,
K.
0
 
PapertripCommented:
For future reference, putting your entire disk in the root partition is bad practice, and is just asking for trouble... especially if you have a database running on that machine.
0
 
upanwarCommented:
Could you please send me output of below given commands.

pvscan
fdisk -l

and also let me know if you can put a new disk into the system or you want to use the existing disks to extented the / partision.

Regards
Umesh Panwar
0
 
arnoldCommented:
You could migrate the DB data to a new volume which will be an overlay of the partition
i.e. /path/to/db_files
you would copy the data from the db_files to the new volume and then mount it as /path/to/db_files
i.e. pvcreate /dev/newdisk
vgcreate VolGroup2 /dev/newdisk
lvcreate

mkfs.ext4 /dev/VolGroup2/LogVol00
mount /dev/VolGroup2/LogVol00 /mnt
cd /path/to/db_files
find . | cpio -pdvmu /mnt
cd ..
mv db_files db_files.orig
mkdir db_files
mount /dev/VolGroup2/LogVol00 /path/to/db_files
make sure the permissions on the db_files match the permissions on db_files.orig
At which point everything should work and will let you free up space on the / partition while separating out.
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
joolsCommented:
I would avoid increasing the size of the root partition and do as arnold says and follow arnolds instructions to create a separate partition for the db data, you can use the du command to give you an idea of how large the partition needs to be.

eg/
   du -sm /var

J
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.