Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with lvextend. Sizolved
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Hydraulix
Guru
Guru


Joined: 12 Dec 2003
Posts: 447

PostPosted: Wed Aug 23, 2006 9:46 am    Post subject: Problem with lvextend. Sizolved Reply with quote

I'm trying to extend my /usr partition by 1G (just to see if this works) and it looks like it works but when I do a df -h I still see 20G. Am I missing something here?


Code:

compaq dev # df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda3             1.9G  139M  1.7G   8% /
udev                  1.6G  196K  1.6G   1% /dev
/dev/sda1             294G  129M  279G   1% /ftp
/dev/mapper/vg-usr     20G  2.7G   17G  15% /usr
/dev/mapper/vg-home   9.9G  129M  9.3G   2% /home
/dev/mapper/vg-opt    5.0G  242M  4.5G   6% /opt
/dev/mapper/vg-var    9.9G  292M  9.1G   4% /var
/dev/mapper/vg-tmp    2.0G   65M  1.9G   4% /tmp
shm                   1.6G     0  1.6G   0% /dev/shm

compaq dev # lvextend -L+1G /dev/vg/usr
  /dev/cdrom: open failed: No medium found
  Attempt to close device '/dev/cdrom' which is not open.
  Extending logical volume usr to 21.00 GB
  Logical volume usr successfully resized
compaq dev # df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda3             1.9G  139M  1.7G   8% /
udev                  1.6G  196K  1.6G   1% /dev
/dev/sda1             294G  129M  279G   1% /ftp
/dev/mapper/vg-usr     20G  2.7G   17G  15% /usr
/dev/mapper/vg-home   9.9G  129M  9.3G   2% /home
/dev/mapper/vg-opt    5.0G  242M  4.5G   6% /opt
/dev/mapper/vg-var    9.9G  292M  9.1G   4% /var
/dev/mapper/vg-tmp    2.0G   65M  1.9G   4% /tmp
shm                   1.6G     0  1.6G   0% /dev/shm

_________________
It is the fate of operating systems to become free.
- Neal Stephenson


Last edited by Hydraulix on Thu Aug 24, 2006 11:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
heikole
Tux's lil' helper
Tux's lil' helper


Joined: 04 Oct 2004
Posts: 148
Location: Berlin, Germany

PostPosted: Wed Aug 23, 2006 11:27 am    Post subject: Reply with quote

You also have to resize (extend) the filesystem residing on the logical volume /dev/mapper/vg-usr. Extending only the logical volume is not enough.
_________________
42
Back to top
View user's profile Send private message
Hydraulix
Guru
Guru


Joined: 12 Dec 2003
Posts: 447

PostPosted: Wed Aug 23, 2006 1:26 pm    Post subject: Reply with quote

heikole wrote:
You also have to resize (extend) the filesystem residing on the logical volume /dev/mapper/vg-usr. Extending only the logical volume is not enough.


[
Ok i tried that but I got this.
Code:

compaq hydraulix # lvextend -L+2G /dev/mapper/vg-usr
  /dev/cdrom: open failed: No medium found
  Attempt to close device '/dev/cdrom' which is not open.
  Volume group mapper doesn't exist
compaq hydraulix # cd /dev/mapper/
compaq mapper # ls
control  vg-home  vg-opt  vg-tmp  vg-usr  vg-var
compaq mapper #

_________________
It is the fate of operating systems to become free.
- Neal Stephenson
Back to top
View user's profile Send private message
heikole
Tux's lil' helper
Tux's lil' helper


Joined: 04 Oct 2004
Posts: 148
Location: Berlin, Germany

PostPosted: Wed Aug 23, 2006 1:34 pm    Post subject: Reply with quote

Not exactly what I meant ;)

You probably have reiserfs or ext3 or some other filesystem set up on your logical volume. That's why you have to extend the filesystem itself using a command line tool like
Code:
resize_reiserfs /dev/mapper/vg-usr


Similar commands are available for other (but not all) filesystems. Use

Code:
mount
to see what filesystems are in use on your partitions or volumes.
_________________
42
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Wed Aug 23, 2006 9:41 pm    Post subject: Reply with quote

Please post the output of
Code:
lvs


[EDIT]BTW, I believe you need a space between the -L and the +1G in the lvextend line [/EDIT]
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
razze
Apprentice
Apprentice


Joined: 09 Mar 2005
Posts: 161
Location: Espoo, Finland

PostPosted: Thu Aug 24, 2006 6:39 am    Post subject: Reply with quote

The partition and the filesystem on that partition are not the same thing. They both need to be extended separately before you can use the new space. The output in your original post says that the LV /dev/vg/usr have successfully been extended, and you could verify this by
Code:
#lvdisplay /dev/vg/usr


Now you need to extend the filesystem on that LV, and how to do this depends on the filesystem used.
_________________
--------------------------
Linux User #393524

AMD Athlon 64 X2 3800+ @2,3 GHz, Asus A8V, VIA K8T800PRO, Nvidia GeForce 7600GS, 2 Gb Dual Channel DDR RAM, 2x Samsung SP120 200Gb, 2x WD 320Gb, Plextor PX-716A, linux-2.6.31-gentoo-r10
Back to top
View user's profile Send private message
Hydraulix
Guru
Guru


Joined: 12 Dec 2003
Posts: 447

PostPosted: Thu Aug 24, 2006 10:40 pm    Post subject: Reply with quote

Here's the output. BTW I am using EXT3 on all my filesystems.

Code:

/dev/hda3 on / type ext3 (rw,noatime,data=journal)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)
udev on /dev type tmpfs (rw,nosuid)
devpts on /dev/pts type devpts (rw,nosuid,noexec)
/dev/sda1 on /ftp type ext3 (rw,noatime,data=journal)
/dev/mapper/vg-usr on /usr type ext3 (rw,noatime,data=journal)
/dev/mapper/vg-home on /home type ext3 (rw,noatime,data=journal)
/dev/mapper/vg-opt on /opt type ext3 (rw,noatime,data=journal)
/dev/mapper/vg-var on /var type ext3 (rw,noatime,data=journal)
/dev/mapper/vg-tmp on /tmp type ext3 (rw,noatime,data=journal)
shm on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)
usbfs on /proc/bus/usb type usbfs (rw,noexec,nosuid,devmode=0664,devgid=85)



Code:

 LV   VG   Attr   LSize  Origin Snap%  Move Log Copy%
  home vg   -wi-ao 10.00G                             
  opt  vg   -wi-ao  5.00G                             
  tmp  vg   -wi-ao  2.00G                             
  usr  vg   -wi-ao 22.00G                             
  var  vg   -wi-ao 10.00


Code:

  --- Logical volume ---
  LV Name                /dev/vg/usr
  VG Name                vg
  LV UUID                IcUADG-jATr-JX1n-DL1p-9jI0-kJcS-38SAdz
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                22.00 GB
  Current LE             5632
  Segments               2
  Allocation             inherit
  Read ahead sectors     0
  Block device           254:0

_________________
It is the fate of operating systems to become free.
- Neal Stephenson
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Thu Aug 24, 2006 10:50 pm    Post subject: Reply with quote

The logical volume is indeed resized now you need to resize the filesystem:
Code:
resize2fs /dev/vg/usr
Should do the trick...
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
Hydraulix
Guru
Guru


Joined: 12 Dec 2003
Posts: 447

PostPosted: Thu Aug 24, 2006 11:01 pm    Post subject: Reply with quote

drescherjm wrote:
The logical volume is indeed resized now you need to resize the filesystem:
Code:
resize2fs /dev/vg/usr
Should do the trick...



Worked like a charm. Thanks. :D
_________________
It is the fate of operating systems to become free.
- Neal Stephenson
Back to top
View user's profile Send private message
cayenne
l33t
l33t


Joined: 17 Oct 2002
Posts: 945
Location: New Orleans

PostPosted: Sun Apr 05, 2009 4:41 pm    Post subject: this might do it Reply with quote

heikole wrote:
Not exactly what I meant ;)

You probably have reiserfs or ext3 or some other filesystem set up on your logical volume. That's why you have to extend the filesystem itself using a command line tool like
Code:
resize_reiserfs /dev/mapper/vg-usr


Similar commands are available for other (but not all) filesystems. Use

Code:
mount
to see what filesystems are in use on your partitions or volumes.


Hi All,

I think I need to do this. I have reiserfs. Do you have to unmount the LV that you have expanded with lvextend (successfully) before you can use the reiserfs. I read that is said you needed to for reducing the size, but, what about extending it?

thanks in advance,

cayenne
_________________
Light travels faster than sound. This is why some people appear bright until you hear them speak.........
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum