LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-31-2011, 10:36 PM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
How to extend root partition?


Hi i m using sun virtual box to host virtual machine under my window xp.
Harddisk size : 5 GB

The problem is the root partition of my virtual machine is full during the new kernal compilation.
Now i would like to extend the root partition(Yes its LVM).


Code:
# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               VolGroup00
  PV Size               5.06 GB / not usable 1.04 MB
  Allocatable           yes (but full)
  PE Size (KByte)       32768
  Total PE              162
  Free PE               0
  Allocated PE          162
  PV UUID               rRKtYF-X0Jj-gEpF-BIjO-03pI-0FUA-fip66O

out of the total 5.06 gb 4 GB is used for root and rest is used for swap.

Code:
# lvdisplay
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                j3a6iW-7vme-otFz-dZCR-jsSf-psXs-j259Tu
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.06 GB
  Current LE             130
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol01
  VG Name                VolGroup00
  LV UUID                mdE1gx-pWFY-Rvie-lN3j-IL5g-ZOcM-xnOuix
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                1.00 GB
  Current LE             32
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

So i added new Hardisk of size 8 GB.
How can i now extend the root partion?
Any help would be appreciated.

Code:
# fdisk -l

Disk /dev/sda: 5548 MB, 5548015616 bytes
255 heads, 63 sectors/track, 674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         674     5309482+  8e  Linux LVM

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Last edited by pinga123; 05-31-2011 at 10:38 PM.
 
Old 06-01-2011, 12:08 AM   #2
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73
Step 1: Create a lvm partition on the new disk (commands: fdisk, pvcreate)
Step 2: Add the new partion to the current volume group (commands: vgextend)
step 3: extend the size of the logical volume (commands: lvextend)
step 4: resize the filesystem on the logical volume (commands: resize2fs)

Notes: make sure you got a backup of the current filesystem before trying to change anything.
Notes: Please read the appropiate man pages for the commands.

Maybe it would be easier to create a new file system on the second virtual disk for the kernel source and compile the new kernel there. after that you can install the new kernel on the existing file system.
 
1 members found this post helpful.
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extend an partition Jordan Miguel Linux - General 9 04-27-2011 07:51 PM
Extend a partition musiqdefunk Linux - Newbie 7 03-25-2011 02:12 PM
to extend installed partition varunvv Linux - Newbie 3 08-06-2009 09:36 AM
Extend The Size of /root mmehta Linux - Newbie 2 09-20-2007 05:56 PM
how to extend partition? Sushy *BSD 2 01-25-2007 12:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:44 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration