LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-19-2015, 12:10 PM   #1
RGT
LQ Newbie
 
Registered: Jan 2015
Posts: 2

Rep: Reputation: Disabled
Talking LV reduced with out resize2fs


Hi by mistakely i gave a lvextend command with full syntax.

But i dont want to lvextend now. i didnt give resize2fs yet.

But the size got reduced in my VG. how can i get back my space now into the VG.

i dont have downtime to umount the FS.
 
Old 01-19-2015, 12:42 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
In /etc/lvm/archive, find the file (it's a text file) with the description "Created *before* executing ... (your lvextend command)". It's probably the most recent one. Then run vgcfgrestore and specify that file with the "--file" option. That should put your VG back the way it was with no harm done.

Actually, if it is the most recent file, you don't even need the "--file" option since that would be the default.

Last edited by rknichols; 01-19-2015 at 12:44 PM. Reason: Actually, ...
 
Old 01-19-2015, 11:31 PM   #3
RGT
LQ Newbie
 
Registered: Jan 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi rknichols. Can you please give some out put like how the file will be. and hw i need to edit it.
 
Old 01-20-2015, 08:38 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
You shouldn't need to edit it. Running
Code:
vgcfgrestore --file {file_name} {vg_name}
will restore the VG back to the state it was in prior to the action in the description. The file will start out something like this
Code:
# Generated by LVM2 version 2.02.111(2)-RHEL6 (2014-09-01): Sun Dec 21 15:49:35 2014

contents = "Text Format Volume Group"
version = 1

description = "Created *before* executing '/sbin/vgs --noheadings -o name --ignoreskippedcluster --config 'log{command_names=0 prefix=\"  \"}''"
The command in the description will obviously be different in your case.
 
  


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
resize2fs Mercury305 Linux - General 5 06-23-2014 09:42 AM
resize2fs: Invalid new size? spam4scott Linux - General 1 08-02-2011 04:26 PM
resize2fs command ikpreet Linux - Newbie 6 06-24-2011 06:29 AM
Is resize2fs safe? Clemente Linux - Server 5 09-02-2008 05:18 PM
resize2fs nooch Red Hat 2 02-25-2005 09:42 PM

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

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