LinuxQuestions.org
Help answer threads with 0 replies.
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 10-23-2012, 09: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, 12:17 PM   #2
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Did your /dev/c0d1p2 contain the data before you added it to LVM?
 
Old 10-23-2012, 02: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, 02: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, 10:56 AM   #5
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
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, 07:04 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
So was I, but I thought I'd let someone else show that
 
Old 10-25-2012, 03: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, 03: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, 04:47 AM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 05: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



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

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

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