LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 10-23-2008, 09:49 PM   #1
oogs
LQ Newbie
 
Registered: Oct 2008
Posts: 4

Rep: Reputation: 0
Resizing an LVM partition


Hi,

I'm new here, but not to forums in general. Before someone replies with "search for the answer", I'll say that I did and came up with this:

(can't post link as this is my first post. nice anti-spam trick!)

I just want to make sure that the solution to my problem right before I go do it.

First off, here's the problem:
I have a 5-drive RAID 5 setup, and I want to add a 6th to it, and expand my / partition (sda2).

The setup:

Fedora Core 3 on a Dell PowerEdge 2850. There are 5 drives, each 143GB SCSI, in RAID 5. I know that the PERC 4 raid card can handle resizing the RAID, so I'm looking to add a 6th. I have an Ubuntu Live CD that has:
- the drivers for my raid
- gparted, which sadly doesn't do the trick
- lvm tools, which does do the trick.

fdisk produces this output after I add the drive:
Code:
Command (m for help): p

Disk /dev/sda: 733.4 GB, 733478912000 bytes
255 heads, 63 sectors/track, 89173 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       71338   572918062+  8e  Linux LVM

Command (m for help): q
So the next step is with that guide, right?

# lvm vgchange -a y
# e2fsck -f /dev/VolGroup00/LogVol00
# resize2fs -f /dev/VolGroup00/LogVol00 (size??)
# lvresize -L(size??) /dev/VolGroup00/LogVol00

sda1 is a mere 100M, so should (size??) be the full 733G? Also, how long will this take? Again, I'm really just seeking confirmation before I do something I can't fix.

Thanks for any feedback!
 
Old 10-24-2008, 02:12 PM   #2
oogs
LQ Newbie
 
Registered: Oct 2008
Posts: 4

Original Poster
Rep: Reputation: 0
I guess I should mention, I'm trying to do this w/o destroying the data on the partition.
 
Old 10-24-2008, 03:03 PM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Please don't take this the wrong way but I don't think you fully understand the concepts of the things your dealing with here. What you've listed above won't work for you. Please be careful.


From what I can figure out from what you've posted:

You have a 5 disk hardware raid array on a PERC 4 controller which your system sees as a single disk device /dev/sda

On that array you have sda1 (which I'm guessing by its size is mounted as /boot?)
and sda2(type 8e) which is your LVM Physical Volume (PV) and holds your volume group and all its Logical Volumes.

Now, if you add a 6th disk to the array and instruct the controller to rebuild/extend the array, my understanding of what will happen is that the size of /dev/sda will increase, but the size of sda2 will not and therefore you won't be able to use the extra space in LVM.

I'm not aware of anyway to increase the size of a PV (your sda2 partition), someone please correct me if there is.


So the only non-disruptive way I can see would be to:
  • Non-disruptively extend your hardware Raid array however you do it.
    (I don't have any knowledge of the PERC controllers so I can't help you with that)
  • Create a new type 8e LVM partition as sda3 to use the newly created free space on /dev/sda.
  • Create a new lvm PV on sda3 with 'pvcreate'.
  • Add the new pv sda3 to the Volume Group with 'vgextend'
  • And then extend the Logical Volumes you want to extend as you describe above.

It's not pretty, but it should work.

I hope that gives you somewhere to start from, but changing storage subsystems is not something to attempt lightly. I urge you to look into this fully before trying anything.

Gaz.

Last edited by GazL; 10-24-2008 at 03:06 PM.
 
Old 10-24-2008, 03:30 PM   #4
oogs
LQ Newbie
 
Registered: Oct 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Actually, that's exactly what I was looking for - someone telling me that I'm either right or wrong. And I'm not taking this lightly either, that's why I'm asking for help. So, Thank you!

Edit: I'm working on the concepts too.

As for your assumptions:

- Yes, that's the raid setup.
- sda1 is /boot
- adding the 6th drive *did* increase sda.

Quote:
* Non-disruptively extend your hardware Raid array however you do it.
(I don't have any knowledge of the PERC controllers so I can't help you with that)
* Create a new type 8e LVM partition as sda3 to use the newly created free space on /dev/sda.
* Create a new lvm PV on sda3 with 'pvcreate'.
* Add the new pv sda3 to the Volume Group with 'vgextend'
* And then extend the Logical Volumes you want to extend as you describe above.
I've already done step 1 using dellmgr. Steps 2-5 seem pretty straightforward (fdisk & mkfs, then lvm stuff). I don't care if it's an ugly solution as long as it works.

Last edited by oogs; 10-24-2008 at 03:36 PM.
 
Old 10-24-2008, 07:47 PM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Quote:
Originally Posted by oogs View Post
I've already done step 1 using dellmgr. Steps 2-5 seem pretty straightforward (fdisk & mkfs, then lvm stuff). I don't care if it's an ugly solution as long as it works.
I'm glad your getting closer Oogs.

If all you're doing is adding space to existing filesystems you shouldn't need to do a mkfs. When you do the pvcreate and vgextend commands that will add the new freespace to lvm ready for use. From that point on all you have to do is find the right logical volume for the filesystem you want to increase. The pvs or vgdisplay commands will show you if the new space is available for use.



BTW, I've just noticed that you've got the order slightly wrong on those commands you listed to actually extend the LVs. It should be

lvextend
e2fsck
resize2fs

As for the resize2fs, you shouldn't need to specify a size. If you leave the size blank it should resize to whatever space you've allocated to it with the lvextend.

For specifying the size on the lvextend you've got a couple of options, specify absolute size or a relative amount to add to the existing LV. (It's all on the man page).


Anyway, Good luck with it all. Wish I had a 700+ GB raid array to play with. I love playing with storage/LVM. I'm sad that way.
 
Old 10-24-2008, 08:52 PM   #6
oogs
LQ Newbie
 
Registered: Oct 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Hehe, it wasn't as much play as "get it done before we run out of room!" I did manage to get it done though, and I realized that the commands were out of order b/c they complained that something (the filesystem, size, etc) wasn't right. So now I have the 700GB not-so-pretty-yet-functional partition!
 
  


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
LVM Partition Resizing ChairmanMeoww Fedora 6 06-16-2012 06:00 AM
LVM: Resizing the root partition fulat2k Linux - General 6 01-08-2012 04:35 PM
Resizing Centos (ext3/LVM) partition alexpacio Linux - Software 6 08-11-2007 01:39 AM
resizing non-LVM partition laggerific Linux - Software 1 11-09-2006 06:20 PM
Resizing an ext3 LVM Partition PenguinPwrdBox Linux - Software 1 09-04-2005 02:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 05:34 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