LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 07-14-2012, 08:31 AM   #1
daud795
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Rep: Reputation: Disabled
Linux lvm reducing problem


Hi!!!!!!!
To everyone

I am facing poblem to reduce the LINUX LVM size.

I have /dev/vg1/lv3 mounted under (/lvm).the size is 1GB and i want to reduce it 512MB.i am running like this:-

1- lvreduce -L -512M /dev/vg1/lv3
2- umount /lvm
3- resize2fs -f -p /dev/vg1/lv3 (i am also getting error on this command)

i am uploading the error through attachment.

Now my LVM Size is 512MB when i am seeing it through (lvdisplay)
But the problem is when i run (df -h) the size
is still (512MB)


help me my dears..
Attached Thumbnails
Click image for larger version

Name:	untitled.JPG
Views:	7
Size:	57.7 KB
ID:	10115  
 
Old 07-14-2012, 08:42 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,848

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
Very bad.
Step number 3 must be done first.

There is an LVM howto at tldp.org. I suspect you will need to restore from a backup, but you might be lucky - set the lv back to its original size and see if a fsck works. If so, do the resize2fs, then the lvreduce.
And hope.
 
Old 07-14-2012, 12:15 PM   #3
whizzit
Member
 
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65

Rep: Reputation: 24
When shrinking a ext2/3 file system it is better to unmount it first. It is not explicitly stated in the resize2fs(8) man page but implied not to support on-line shrinking; only on-line extension.

+1 on syg00's comment.
  • Backup filesystem! There's no guarantee that data won't be lost - it is a high risk especially when shrinking.
  • Unmount filesystem
  • Shrink filesystem (resize2fs specifying the new size)
  • Shrink volume to a size equal or above the filesystem (lvreduce)

Another option that may recover the situation is by running the following (use -f if you need to) and after do a filesystem check:

Code:
resize2fs -p /dev/vg1/lv3 512M
By shrinking the volume first, part of the underlying filesystem has been destroyed. The only option might be to rebuild the filesystem, if syg00's idea of extending the volume again doesn't work.

Regards
 
  


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
reducing ext3 lvm's. majeztik Red Hat 7 01-04-2010 09:52 AM
Reducing size in LVM SBN Linux - General 8 07-28-2009 07:30 AM
Data lost while reducing the lvm kkishore Linux - Server 1 09-17-2007 07:03 AM
Reducing the Linux LVM(8e) partition itself (not PV, VG or LV). ajitkth Linux - General 1 03-08-2005 04:45 AM
Reducing size of PV (partition) in LVM clacour Linux - General 2 10-24-2003 09:19 PM


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