LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 10-03-2011, 06:54 AM   #1
martin11
LQ Newbie
 
Registered: Feb 2011
Posts: 3

Rep: Reputation: 0
How to resize /usr in lvm2?


Hi all,

I want to enlagarge my /usr partition, since I don't get by with the 4.6G I have right now.

I have an lvm2 system.

First problem (maybe easier):
I looked at this tutorial from skolelinux: http://www.skolelinux.no/~klaus/newnotater/x1738.html

But got stuck soon, because debian uses different paths in /dev for the volume groups, and I need to be 100% sure of what I'm doing.

second problem:
I'd need to reduce one other lv in the lvm, all man-pages tell me that I have to shrink the lv first to avoid data loss - how do I do this?

muchos thanks!
 
Old 10-03-2011, 05:01 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
First you need to determine whether there are any free extents in the volume group:

Code:
vgdisplay
Look for "Free PE / Size", if there are none free then you either need to reduce an existing logical volume or add more space.

I always get emails about enlarging my partition too but but I'm happy with what I have

Last edited by kbp; 10-03-2011 at 05:03 PM.
 
Old 10-03-2011, 08:11 PM   #3
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by martin11 View Post
second problem:
I'd need to reduce one other lv in the lvm, all man-pages tell me that I have to shrink the lv first to avoid data loss - how do I do this?
This would be a problem. You need to reduce the size of the filesystem first, then shrink the logical volume. Think of it as "the filesystem is within the LV". If you shrink the outer "container" before you shrink the contents you may have data that is outside the LV and can no longer be addressed. Conversely, when you are expanding you 'lvresize' or 'lvextend' first, then 'resize2fs' the filesystem.

You didn't say so I'll assume that your filesystem is ext2/3/4. If that's the case, the filesystem needs to be umounted before it is resized downwards, too, so you may need to do this from a rescue environment.

Quote:
...debian uses different paths in /dev for the volume groups, and I need to be 100% sure of what I'm doing.
To see the relationship between logical volumes, aliases for LV's, and DM block devices, look at
  1. the "Block device" address in the output of an 'lvdisplay' command,
  2. the major, minor device number from 'dmsetup ls', and
  3. the major minor numbers from 'ls -l /dev/dm-*', 'ls -l /dev/<vgname>/*', and 'ls -l /dev/mapper/*' commands.
(The major number for LVM devices should be 253.)

So, if you show us the output from the above commands in addition to kbp's request for a 'vgdisplay', it'll help those trying to walk you though this.

I'm LVM literate, but not debian literate, so I hope others will pitch in with debian-specific advice.

Last edited by tommylovell; 10-04-2011 at 03:09 PM.
 
  


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
[SOLVED] LVM2 resize problems XRayden Linux - Newbie 16 10-10-2011 03:00 PM
LXer: What is the procedure to resize an LVM2 logical volume and the ext2 or ext3 fil LXer Syndicated Linux News 0 07-17-2008 03:50 AM
FreeBSD 6.2, no /usr/src/tools and /usr/src/usr.bin, failed to build world. Mr_Shameless *BSD 4 05-16-2008 08:43 AM
lvm2-resize partiton linuxmandrake Linux - General 1 09-19-2005 12:22 AM
How to resize /usr with resize2fs and LVM2 shadow5277 Red Hat 2 08-15-2005 01:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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