LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-02-2006, 01:17 PM   #1
atomicx
Member
 
Registered: Oct 2003
Posts: 48

Rep: Reputation: 15
Repartition Hard Drive Mounts


Here is what I have for break down.

/dev/mapper/VolGroup00-LogVol00
3078848 2671720 248204 92% /
/dev/hda1 101086 9857 86010 11% /boot
tmpfs 322928 0 322928 0% /dev/shm
/dev/hda2 14877092 745128 13364060 6% /var/www


I would like to move some of the disk space from the /dev/hda2 (/var/www) mount to the
/dev/mapper/VolGroup00-LogVol00 (/) mount and then create a new mount for /home.

Is there a way I can do this after the machine has been configured?

Thanks
Troy
 
Old 06-02-2006, 02:29 PM   #2
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,393
Blog Entries: 1

Rep: Reputation: 63
Can you backup /var/www to a external media, like a CD-R or something like that ?
This is because the best aproach here is to convert /dev/hda2 to a LV and add the new volume to the already setup /dev/mapper/VolGroup00-LogVol00.
Doing so, you can extend your / partition in about 14G.

After that is easy to cretae /home and restore /var/www.

Post the answer back, so we can guide you to this process or figure out an another way.
 
Old 06-02-2006, 02:55 PM   #3
atomicx
Member
 
Registered: Oct 2003
Posts: 48

Original Poster
Rep: Reputation: 15
Yes, I can create a backup.

Also why is the / partition showing up as /dev/mapper/VolGroup00-LogVol00 instead of say /dev/hda3? Is there a way to change that?

Last edited by atomicx; 06-02-2006 at 03:33 PM.
 
Old 06-02-2006, 03:25 PM   #4
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,393
Blog Entries: 1

Rep: Reputation: 63
good.

Read the post to the end, before you start to change your disk.
Print anything you could need.

The first thing is to stop apache/httpd, because it uses /var/www.
Make this change permanently, by using chkconfig to turn off httpd/apache.

After that you can umount /var/www. "umount /var/www"
Uncomment any references to hda2 in your /etc/fstab to avoid the system mount it again in the next reboot.


Now, using fdisk, change the /dev/hda2 partition type from Linux (83) to Linux LVM (8e).
Reboot the computer, so the kernel can see the new partition table.
Make sure apache is not running and /dev/hda2 is unmounted.

The Linux Documentation project has a good Howto for LVM: read it !
http://www.tldp.org/HOWTO/LVM-HOWTO/commontask.html

Create a physical volume on /dev/hda2: "pvcreate /dev/hda2".
Now, add the /dev/hda2 to the existing VolGroup00: "vgextend VolGroup00 /dev/hda2"

now, write down how big is the VolGroup00 in PE: "vgdisplay VolGroup00". Look for a string "Total PE". Note that "Free PE" is a non-zero number.

Allocate that space to the logical volume: "
lvextend -l<put the total PE here> /dev/VolGroup00/LogVol00"

Now you need to extend the filesystem on /dev/mapper/VolGroup00-LogVol00.
The proper command depends of the filesystem.
For ext2/ext3 systems: "resize2fs /dev/mapper/VolGroup00-LogVol00"
For reiser: "resize_reiserfs /dev/mapper/VolGroup00-LogVol00"
For that the file system must be offline. To do that you will beed a liveCD.

After that, create /var/www again, restore the backup and create /home.

good luck and post any questions before you start.
 
Old 06-02-2006, 03:55 PM   #5
atomicx
Member
 
Registered: Oct 2003
Posts: 48

Original Poster
Rep: Reputation: 15
How do you change the partition type from Linux (83) to Linux LVM (8e)?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
One flash drive mounts, the larger doesn't matrim Linux - Hardware 3 11-29-2005 01:52 AM
Hard Disk rePartition fieldyweb Linux - Newbie 13 11-15-2005 05:42 AM
Can't repartition USB Flash Drive babysealclubber Linux - Hardware 3 09-16-2004 02:02 PM
Repartition an XP NTFS drive to make room for RedHat SirKTS Linux - Newbie 10 03-01-2004 07:46 AM
Hard Drive repartition crashed crewblunts Linux - Hardware 7 02-07-2004 11:19 PM


All times are GMT -5. The time now is 07:39 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration