LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 11-01-2006, 08:52 AM   #1
spectra
Member
 
Registered: Nov 2006
Location: UK
Distribution: Debian(s) / Gentoo
Posts: 30

Rep: Reputation: 15
Question LVM Resize - After logical resize, FS size does not match physical size.


Hi all,

I am new to the site but have reasonable experience with Linux but certainly wouldn't call myself an expert!

I don't however have any previous experience with LVM prior to this install.

I'll give everyone a quick "heads up" on my system / LVM config.

The system is a Dell PE1850 with 1 Seagate Cheetah SCSI Disk, it is controlled by a LSI Logic (MPT Fusion in the Kernel) RAID controller, however currently it is not in RAID.

I am running the Debian (Etch) distro, Kernel 2.6.18.1 and have created a logical volume group called "Debian"

My fstab reads the following:

/dev/mapper/Debian-root 481M 248M 208M /
/dev/mapper/Debian-tmp <sizes> /tmp
/dev/mapper/Debian-usr <sizes> /usr

and so on with a logical volume for usr, tmp and var directories.

I went through the LVM volume resize as desribed here.

I unmounted my / volume and my /home volumes, and due to the large space I had on /home, used lvreduce -L to reduce the size by 10G. I then used lvextend and resize2fs and rebooted.

Afterwards my system would not boot (due to errors on dm4) however it allowed recovery console) and if I run fsck or e2fsck it claims that the filesystem size (according to superblock) is different to the physical size of the drive.

e2fsck confirms all logical volumes are fine except the /home directory. However I can still access the /home directory and its contents (but it doesn't matter if these have to be destroyed)

I have now taken the /home mounting out of the fstab which boots the system np. However the problem still remains.

Anyone have any idea's how to fix this or what I did wrong to cause the error? Any help is appreciated!

Cheers,

Dave
 
Old 11-01-2006, 08:59 AM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
Before using lvreduce on /home, did you also run resize2fs on it?
 
Old 11-01-2006, 09:11 AM   #3
spectra
Member
 
Registered: Nov 2006
Location: UK
Distribution: Debian(s) / Gentoo
Posts: 30

Original Poster
Rep: Reputation: 15
No

Have I commited an atrocity?

Do you know how to resolve?

Last edited by spectra; 11-01-2006 at 09:16 AM.
 
Old 11-01-2006, 09:15 AM   #4
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
Certainly ;-)

To reduce: first reduce the file system, then the underlying logical volume
To extend: first extend the underlying logical volume, then the file system

Now your /home file system believes it still has its initial size, while the underlying LV has been reduced.

Try to unmount /home, run resize2fs and e2fsck on it, and with a little bit of luck you'll be fine. Assuming /home is ext3, of course.
 
Old 11-01-2006, 10:01 AM   #5
spectra
Member
 
Registered: Nov 2006
Location: UK
Distribution: Debian(s) / Gentoo
Posts: 30

Original Poster
Rep: Reputation: 15
Thanks for the help uselpa.

If I run resize2fs the system returns:

sol:~# resize2fs -f /dev/Debian/home
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/Debian/home to 24992768 (4k) blocks.
resize2fs: Can't read an block bitmap while trying to resize /dev/Debian/home

If I run e2fsck, it returns:

sol:~# e2fsck -f /dev/Debian/home
e2fsck 1.39 (29-May-2006)
The filesystem size (according to the superblock) is 27614208 blocks
The physical size of the device is 24992768 blocks
Either the superblock or the partition table is likely to be corrupt!

I dont mind if I have to destroy the entire partition and create it again if its going to be easier, there are no files I want to keep.

To avoid any further filesystem related devastation, i'll await your best call on the subject

All a good learning curve though, good that the beasts aren't in a data centre yet otherwise it would have been a case of shit and fan
 
Old 11-01-2006, 10:16 AM   #6
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
If you don't mind losing the data, then recreate a file system on the LV and remount it to /home. If you have any other users besides root, I'd suggest removing and recreating them so that their home directories are properly created.

There's probably a way to correct the situation but I don't know it, and as it's not strictly necessary let's leave it at that.

And repeat the mantra: RFL, ELF (reduce filesystem then LV, extend LV then filesystem) ;-)
 
Old 11-01-2006, 11:28 AM   #7
spectra
Member
 
Registered: Nov 2006
Location: UK
Distribution: Debian(s) / Gentoo
Posts: 30

Original Poster
Rep: Reputation: 15
Great mate I did just that, and added the additional require space to / hassle free.

All spot on now! Most appreciated cheers!
 
  


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
How to Resize Root LVM Logical Volume??? jdupre Fedora 17 10-02-2010 07:21 AM
Resize a file with a size of 0 smaudlin Linux - General 2 11-12-2005 12:33 AM
/proc/kcore size doesn't match with physical ram size cash_05 Linux - Newbie 2 06-01-2005 01:23 PM
Parted; trying to resize partition to actuall size Zero-0-Effect Linux - General 3 04-30-2004 10:13 PM
is there a way to resize my desktop icons simultaneously and all the same size? kublador Linux - Newbie 3 03-14-2003 07:46 PM

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

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