LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-03-2009, 11:22 PM   #1
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 576

Rep: Reputation: 38
How to Recover From pvcreate Against a Partition


I, stupidly, managed to enter the wrong partition on a pvcreate command.

I entered "pvcreate /dev/hdb1" instead of "pvcreate /dev/sdb1".

All I've tried to do against the partition, so far, is to mount it, which failed with: mount: unknown filesystem 'lvm2pv'.

The partition was originally formatted with xfs.

How can I recover this partition.

Cheers.
 
Old 10-03-2009, 11:57 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,787

Rep: Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574
Mmmm - I don't know how much you over-wrote and I don't use xfs ...
With ext3, I'd try (as last resort) "mkfs.ext3 -S ..." - that rebuilds superblock and group descriptors only. I've used it in testing after (deliberately) breaking a filesystem. With luck xfs might offer a similar option.
 
Old 10-04-2009, 01:11 AM   #3
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 576

Original Poster
Rep: Reputation: 38
Quote:
Originally Posted by syg00 View Post
Mmmm - I don't know how much you over-wrote
Only what a pvcreate would write. I haven't issued any other commands against the disk, except the mount attempt.

Cheers.
 
Old 10-04-2009, 01:51 AM   #4
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 576

Original Poster
Rep: Reputation: 38
OK, I tried this:
Code:
root@The-Tardis:~# xfs_repair -n /dev/hdb1
found candidate secondary superblock...
verified secondary superblock...
would write modified primary superblock
Primary superblock would have been modified.
Cannot proceed further in no_modify mode.
Exiting now.
What are the chances that if I run it without the "-n" the repair will be a good one.

Cheers.
 
Old 10-04-2009, 02:06 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,787

Rep: Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574Reputation: 3574
Again it depends on what the pvcreate trashed - I don't LVM, and I haven't tested that (I'll add it to my to-do-someday list).
Re-creating the (filesystem) metadata doesn't help if the file contents are toast. Same as fsck can't always "fix" errant files.

Did you note my sigline ?. "dd" the partition out to another device and screw around with that, not your real partition.
 
Old 10-05-2009, 04:06 AM   #6
rkski
Member
 
Registered: Jan 2009
Location: Canada
Distribution: CentOS 6.3, Fedora 17
Posts: 247

Rep: Reputation: 51
Just a quick (untested) suggestion. Can't you go into fdisk and change the partition type back to the xfs.
 
  


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
Recover partition table? Xmas777 Linux - Newbie 5 12-10-2008 10:10 AM
lvm:didn't do pvcreate on partition, before adding it to volume group kpachopoulos Linux - General 3 03-11-2007 08:22 AM
how to recover partition table ariadneN Linux - General 3 07-26-2006 02:13 PM
recover a missing partition pankaj99 Linux - General 5 06-03-2006 07:09 PM
Recover Partition??? HELP!!!! villusion Linux - Hardware 7 10-11-2005 04:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:35 PM.

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