Gentoo Forums
Gentoo Forums
Quick Search: in
LVM2 resizing questions [Resolved]
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
cynric
Guru
Guru


Joined: 08 Oct 2004
Posts: 439
Location: Little Rock, AR

PostPosted: Fri Jul 27, 2007 10:28 pm    Post subject: LVM2 resizing questions [Resolved] Reply with quote

Either the documents I've read weren't exactly what I was looking for or I don't fully understand what I'm seeking -- I believe a little/lot of both are at play. I have two disks running under RAID-1 with LVM2. The entire disks were added to raid (no partitions). The filesystem is reiser3. There are 4 logical volumes under a single physical. I've run out of space on one logical volume (/dev/vg/music) and need to resize another (/dev/vg/movies) to add more space.

My original thought was to reduce the size of /dev/vg/movies and then add that space to /dev/vg/music. From what I understand, the general process for this would be to
  • reiser_resize /dev/vg/movies
  • lvresize /dev/vg/movies to something greater than the reiser_resize
  • lvextend /dev/vg/music with what's left
  • reiser_resize /dev/vg/movies to reclaim the resize difference


Is the above correct? It seems rather lengthy and I'd rather not find out I have the wrong steps midway through the resize. For my particular case, I could probably do away with /dev/vg/movies. If I went this route, I assume the steps involved would be something like the below?

  • lvremove /dev/vg/movies
  • lvextend /dev/vg/music to what's left over


Any confirmations on the above or suggestions would be greatly appreciated. In case I haven't explained the setup clearly enough, I've included some info below. Thanks.

df -Tha (only relevant portion included)
Code:

/dev/mapper/vg-music
          reiserfs    166G  165G  1.4G 100% /mnt/music
/dev/mapper/vg-movies
          reiserfs    100G   33M  100G   1% /mnt/movies
/dev/mapper/vg-backup
          reiserfs    100G   20G   81G  20% /mnt/backup
/dev/mapper/vg-pictures
          reiserfs    100G  5.9G   95G   6% /mnt/pictures


cat /proc/mdstat
Code:

Personalities : [raid0] [raid1]
md1 : active raid1 sdb1[0] sda1[1]
      488383936 blocks [2/2] [UU]


pvdisplay
Code:

  --- Physical volume ---
  PV Name               /dev/md1
  VG Name               vg
  PV Size               465.76 GB / not usable 0   
  Allocatable           yes (but full)
  PE Size (KByte)       4096
  Total PE              119234
  Free PE               0
  Allocated PE          119234
  PV UUID               eyCEcg-xyhu-w1qA-M1hf-DsJU-8mzD-giXY7e


lvdisplay
Code:

  --- Logical volume ---
  LV Name                /dev/vg/pictures
  VG Name                vg
  LV UUID                JUeV5B-ainE-RaOx-0iuK-pY6g-scfM-Zerx7Y
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                100.00 GB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:0

  --- Logical volume ---
  LV Name                /dev/vg/backup
  VG Name                vg
  LV UUID                0k2e2Y-WHb8-aw3L-fzzG-1orJ-OcYL-YOxcGH
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                100.00 GB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:1

  --- Logical volume ---
  LV Name                /dev/vg/movies
  VG Name                vg
  LV UUID                SYvB4a-Y00f-MSrM-XrYA-KFDv-3dc8-h7UWbo
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                100.00 GB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:2

  --- Logical volume ---
  LV Name                /dev/vg/music
  VG Name                vg
  LV UUID                2JG3ya-8pLx-q0MC-ruXA-FQpV-gg2g-oOVV2e
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                165.76 GB
  Current LE             42434
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:3

_________________
"This Snow Crash thing -- is it a virus, a drug, or a religion?" "What's the difference?"
-- Neal Stephenson - Snow Crash


Last edited by cynric on Sun Jul 29, 2007 5:34 am; edited 1 time in total
Back to top
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 666
Location: Brooklyn, New York

PostPosted: Sat Jul 28, 2007 10:54 pm    Post subject: Reply with quote

first you need to umount then run a filesystem check on them,..

after use your FS resize feature to resize the FS, then use lvresize on them. this is all you need to really do to resize on lvm2 or any FS without it. again make sure the FS is not in used before resizing it.

good luck, and back up your data ;)
Back to top
View user's profile Send private message
cynric
Guru
Guru


Joined: 08 Oct 2004
Posts: 439
Location: Little Rock, AR

PostPosted: Sun Jul 29, 2007 5:09 am    Post subject: Reply with quote

Thanks for the reply. Looks like I was somewhat on track. So, lvresize ought to be used in the reduction and growing of the two volumes in qusetion? There seem to be a lot of duplicated commands for lvm2 (lv-reduce, extend, resize).
_________________
"This Snow Crash thing -- is it a virus, a drug, or a religion?" "What's the difference?"
-- Neal Stephenson - Snow Crash
Back to top
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 666
Location: Brooklyn, New York

PostPosted: Sun Jul 29, 2007 5:25 am    Post subject: Reply with quote

cynric wrote:
Thanks for the reply. Looks like I was somewhat on track. So, lvresize ought to be used in the reduction and growing of the two volumes in qusetion? There seem to be a lot of duplicated commands for lvm2 (lv-reduce, extend, resize).


they are not duplicate commands but just symbolic links to /sbin/lvm

Code:

darko:/root->for i in lvresize lvreduce lvextend; do file $(which "${i}");done
/sbin/lvresize: symbolic link to `lvm'
/sbin/lvreduce: symbolic link to `lvm'
/sbin/lvextend: symbolic link to `lvm'


yes, use lvresize to both extend and reduce logical volumes.
just remember to fsck, fs {reduce,resize}, then lv{resize,reduce}.
Back to top
View user's profile Send private message
cynric
Guru
Guru


Joined: 08 Oct 2004
Posts: 439
Location: Little Rock, AR

PostPosted: Sun Jul 29, 2007 5:30 am    Post subject: Reply with quote

likewhoa wrote:
they are not duplicate commands but just symbolic links to /sbin/lvm

Sure enough ... I feel a bit idiotic now. ;)

likewhoa wrote:
yes, use lvresize to both extend and reduce logical volumes.
just remember to fsck, fs {reduce,resize}, then lv{resize,reduce}.

Cool. Thanks for you time.
_________________
"This Snow Crash thing -- is it a virus, a drug, or a religion?" "What's the difference?"
-- Neal Stephenson - Snow Crash
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