LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   lvm problem (https://www.linuxquestions.org/questions/linux-newbie-8/lvm-problem-4175433681/)

scograf 10-23-2012 09:07 AM

lvm problem
 
hi boys... i read you from long time but this is my first post.

i expose my problem

i'have added two physical volume /dev/c0d1p1 and /dev/c0d1p2 into a volume group VolGroup01, the second with vgextend

the problem is that my c0d1p2 partition contains a lot of data and i don't want to loose them,

now i don't know if vgreduce can help me or i have to take a different way to solve

please help me....

replica9000 10-23-2012 12:17 PM

Did your /dev/c0d1p2 contain the data before you added it to LVM?

sam.m 10-23-2012 02:08 PM

Hi, from the top of my head, did the disk contain any lvm partitioning prior to adding it to the new volume group. If so I would suggest you to take it out of the current volume group and do a "vgimport <volgrpname> <physicalvolname> and then do a "vgchange -ay <volgrpname>", that should be able to bring back the data you wanted safely. If you do a vgreduce you would lose that existing data.

scograf 10-24-2012 02:54 AM

no, my /dev/c0d1p2 does not contains any data... it's only a partition

and thank you for help all...

replica9000 10-24-2012 10:56 AM

Quote:

Originally Posted by scograf (Post 4813058)
the problem is that my c0d1p2 partition contains a lot of data and i don't want to loose them,

Quote:

Originally Posted by scograf (Post 4813615)
no, my /dev/c0d1p2 does not contains any data... it's only a partition

Alright, I'm confused.

chrism01 10-24-2012 07:04 PM

So was I, but I thought I'd let someone else show that ;)

scograf 10-25-2012 03:24 AM

sorry, i was wrong... i'm a little bit confised

ok, from head...


/dev/cciss/c0d1p1 was full of data
/dev/cciss/c0d1p2 was empty

i would like to create a logical volume with lvm containing these two partitions,

i created first a volgroup and added c0d1p2 (the empty one)
than i added c0d1p1 to the volgroup with vgextend

i want a logical volume containing the two partitions without loosing data on c0d1p1

this is what i would like to do...

i'm now stopped because i'm afraid to make something wrong and i'm waiting for you...
please, help me

scograf 10-25-2012 03:44 AM

i want to make clear that neither /dev/cciss/c0d1p1 or /dev/cciss/c0d1p2 were part of lvm...

i'm creating a new volume group and i'm adding them to it

chrism01 10-25-2012 04:47 AM

I don't think you can do this.
The normal sequence is

partitions /dev/cciss/c0d1p1 & /dev/cciss/c0d1p2 both set as pv (fdisk id code 8e), vgcreate + vgextend, putting both pv's into the vg, create lv from the vg and then mkfs over the lv.

http://tldp.org/HOWTO/LVM-HOWTO/
http://sunoano.name/ws/public_xhtml/lvm.html

scograf 10-25-2012 05:11 AM

ok, i launched vgreduce to extract c0d1p1 and now partition is not readable...

i'have launched fsck to restore the partition super block and it seems to work...

mounted with /etc/fstab line

at reboot it recognize the partition and is making a a forced check without obliging me to enter maintenance mode...

supposing it restore....

what about if a create a volgroup ----> add only /dev/cciss/c0d1p1 -----> launch parted on volgroup -----> rescue command to restore partition without data loss

what do you think about? is it possible?

i know that all data are still there because in maintenance mode, if i do

ls /dev/cciss/c0d1p1

it gives me the list of contents but doesn't give me access


All times are GMT -5. The time now is 07:13 AM.