LinuxQuestions.org
Visit Jeremy's Blog.
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 03-28-2011, 09:53 AM   #1
jkl555
LQ Newbie
 
Registered: Oct 2004
Posts: 9

Rep: Reputation: 0
Anyone has experience running parted on raid device with LVM ?


I read the parted documentation and it suggests it should work. I would like to know if anyone has such experience.

I have 2 identical disks, /dev/sda and /dev/sdb. I have a raid-2 configuration (/dev/md0) on /dev/sda3 and /dev/sdb3 partitions. On top of /dev/md0, I am running LVM.

There are also partitions sda4 and sdb4 following sda3 and sdb3 respectively but the data in there are not important. What I want to do is delete the sda4 and sdb4 partitions and extend sda3 and sdb3 to the end of disk, and grow the md0 and the volume group of course *without* loss of data.

Anyone has tried this before and share with me your experience ?

Thanks in advance.
 
Old 03-28-2011, 10:25 AM   #2
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
Your best option would be to turn sda4 and sdb4 into a second RAID1 array (probably /dev/md1); 'pvcreate' that new md array; 'vgextend' the Volume Group that you already have on /dev/md0 with your new md device; and you are done.

Doing what you originally suggested is not possible to do "in place". It would involve changing the partition info in the MBR to extend out the sda3/sdb3 partitions; move and alter the md raid metadata that is on the end of the current sda/sdb3 partitions; and then alter all of the LVM metadata to reflect the new physical extents that have been added. The tools are just not built to do that.

To do it "not in place" you would need "swing space" (another volume that could hold your /dev/md0 data). You'd need to add that space to LVM with a 'pvcreate'; 'vgextend' your volume group; 'pvmove' the data to the new volume; 'vgreduce' to remove /dev/md0; 'pvremove /dev/md0'; destroy the md0 array; fdisk the sda and sdb disks to create the larger partition; turn sda3/sdb3 into a RAID1 array once again; 'pvcreate' the new larger RAID array; 'vgextend' adding in the new array; 'pvmove' the data back to it; go through the steps to remove your "swing space". More effort than I'd ever want to expend.

I'd go with option 1.

Last edited by tommylovell; 03-28-2011 at 10:41 AM.
 
Old 03-28-2011, 09:09 PM   #3
jkl555
LQ Newbie
 
Registered: Oct 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you. I understand your approach to add a new PV by simply converting sda4/sdb4 into a new raid device. Originally I thought it will be as simple as deleting the partition(s) and let parted take care of the rest. It sounds like it can't be done.
 
Old 03-28-2011, 10:09 PM   #4
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
You're welcome.

'parted' can resize a partition and resize the filesystem (or swap) installed directly within it. But unfortunately it can't do a RAID array and I don't think it knows about LVM either. Maybe someday.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
libblkid uuid_parse() failing to parse UUID for lvm volume on raid device wroom Programming 0 09-04-2010 08:08 PM
Partition management: lvm? fdisk? parted? (on RAID) emailbuilder88 Linux - General 1 04-30-2010 11:59 PM
device-mapper error running kpartx on a LVM karateckie Linux - Software 2 12-15-2009 05:13 PM
LVM + RAID-1 on FC5 running system randolpholiveira Linux - Server 0 10-12-2006 09:17 AM
Partitioning RAID Array. LVM? parted? peripatetic Red Hat 2 08-25-2006 01:15 AM


All times are GMT -5. The time now is 01:55 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration