Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
A botched lvreduce command has caused *all* LVM commands to indefinitely hang, including vgcfgrestore.
I've searched everywhere and I can't find the location of the *active* lvm metadata, I know the backup and archive files are in /etc/lvm but I need the current version so I can replace it.
It is stored within the various headers within the LVM physical volume itself with some redundancy making it not amenable to manual editing. You should be able to edit one of the files in /etc/lvm/archive or /etc/lvm/backup to describe the way the configuration should be, and then use vgcfgrestore from that file. The only issue would be if the physical volume header were damaged, and that could be corrected by running pvcreate with the "-ff", "--uuid", and "--restorefile" options.
The ultimate weapon would be to use pvremove with the "-ff" option to wipe the PV header, then pvcreate with the "--uuid" and "--restorefile" options, followed by vgcfgrestore. I can't imagine a situation where that pvremove would be necessary. The above "pvcreate -ff ..." should always suffice.
I have a file in the /etc/lvm/archive folder that is exactly the right configuration (Just before I did the lvreduce) but I can't run vgcfgrestore because it just hangs (I've left it for over an hour).
I think the PV metadata is fine, the problem occured because I accidentally increased the LV to 16.1TB which is too large, I did lvreduce and it hung, after that no LVM commands are working, I can't do pvscan, pvremove or pvcreate, I even tried reinstalling lvm2 through apt-get and that hung too.
When you ran lvresize and/or lvreduce, did you include the "-r" (--resizefs) option? If so, and especially on the lvreduce, the implied fsck can take a very long time (many hours for a 16TB ext3 filesystem) and will keep the volume busy while it is running. Does top show any suspicious running processes? I don't know what sort of locks the various LVM commands might be using to keep from stepping on each other.
I think the PV metadata is fine, the problem occured because I accidentally increased the LV to 16.1TB which is too large, I did lvreduce and it hung, after that no LVM commands are working, I can't do pvscan, pvremove or pvcreate, I even tried reinstalling lvm2 through apt-get and that hung too.
I don't want to divert this discussion, but when this is all over, you should file a bug - this should never happen. You should never be able to make a lv "too large" - parsing should catch that.
I take it you are doing this recovery from the affected system - any success running lvm commands from a liveCD ?.
When you ran lvresize and/or lvreduce, did you include the "-r" (--resizefs) option? If so, and especially on the lvreduce, the implied fsck can take a very long time (many hours for a 16TB ext3 filesystem) and will keep the volume busy while it is running. Does top show any suspicious running processes? I don't know what sort of locks the various LVM commands might be using to keep from stepping on each other.
I didn't use --resizefs, I tried running that separately after lvresize and it refused due the 16tb limit, which is why I ran the lvreduce. The lvreduce command hung for at least 20 minutes before I Ctrl-C'd it, I thought It'd be easier to just revert the metadata. I tried turning off the locking in lvm.conf but the commands still won't run.
Quote:
Originally Posted by syg00
I don't want to divert this discussion, but when this is all over, you should file a bug - this should never happen. You should never be able to make a lv "too large" - parsing should catch that.
I take it you are doing this recovery from the affected system - any success running lvm commands from a liveCD ?.
I'll make sure I do that, I'll wait and see if I find a fix first though so I can add that too.
Running the commands from a liveCD is a great idea! I didn't think of that, I've tried Ubuntu on USB and DVD and Mint on USB and they all get stuck at boot up at the logo? I can switch to the other TTY's but they're just a flashing underscore, not a prompt. I've booted liveCD's on this machine before and it's never done this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.