LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 10-23-2012, 10:07 AM   #1
scograf
LQ Newbie
 
Registered: Oct 2012
Posts: 6

Rep: Reputation: Disabled
Unhappy 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....
 
Old 10-23-2012, 01:17 PM   #2
replica9000
Senior Member
 
Registered: Jul 2006
Location: USA
Distribution: Debian, FreeBSD, Android
Posts: 1,001
Blog Entries: 2

Rep: Reputation: 213Reputation: 213Reputation: 213
Did your /dev/c0d1p2 contain the data before you added it to LVM?
 
Old 10-23-2012, 03:08 PM   #3
sam.m
LQ Newbie
 
Registered: Jul 2011
Location: New Jersey
Distribution: Linux - Red Hat, Suse, Fedora, Ubuntu, Debian, Cent OS, HP UX - 11.x
Posts: 17

Rep: Reputation: Disabled
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.
 
Old 10-24-2012, 03:54 AM   #4
scograf
LQ Newbie
 
Registered: Oct 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
no, my /dev/c0d1p2 does not contains any data... it's only a partition

and thank you for help all...
 
Old 10-24-2012, 11:56 AM   #5
replica9000
Senior Member
 
Registered: Jul 2006
Location: USA
Distribution: Debian, FreeBSD, Android
Posts: 1,001
Blog Entries: 2

Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by scograf View Post
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 View Post
no, my /dev/c0d1p2 does not contains any data... it's only a partition
Alright, I'm confused.
 
Old 10-24-2012, 08:04 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
So was I, but I thought I'd let someone else show that
 
Old 10-25-2012, 04:24 AM   #7
scograf
LQ Newbie
 
Registered: Oct 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-25-2012, 04:44 AM   #8
scograf
LQ Newbie
 
Registered: Oct 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-25-2012, 05:47 AM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
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
 
Old 10-25-2012, 06:11 AM   #10
scograf
LQ Newbie
 
Registered: Oct 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
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
 
  


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
Raid + LVM add new raid device to LVM, problem request Linux - Server 3 08-15-2012 05:06 AM
Problem with LVM mirror and failed PV, can't recover -- Debian Squeeze lvm 2.02.66-5 Linux Ninja Linux - Server 0 08-15-2011 12:43 AM
Adding an LVM hard disk to a system already running/using LVM firewiz87 Linux - Hardware 5 08-15-2010 01:59 AM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 12:16 PM
LVM Problem ZilverZtream Linux - Software 1 01-15-2005 06:08 AM


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