LinuxQuestions.org
Visit Jeremy's Blog.
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 01-17-2009, 12:17 PM   #1
anw
Member
 
Registered: Sep 2003
Location: Florida
Distribution: Debian
Posts: 93

Rep: Reputation: 15
Resizing partitions with & w/o lvm


Normally, I would just try stuff to see what worked, but in this case there's real data that I don't want to lose, so thought I'd ask for advice here first.

I have three partitions on this disk, laid out thusly:

|--root--|--swap--|-------------- hda3 (lvm) --------------|

hda3 is the only one using lvm. What I want to do is shrink hda3 from the front, to give a couple of more (contiguous) gigabytes to swap. There's plenty of room. Here's the output of lvdisplay:
Quote:
# lvdisplay
--- Logical volume ---
LV Name /dev/dynamic/usr
VG Name dynamic
LV UUID CDMnar-5290-7F1t-e4wf-Mvw6-ghv9-ombuVG
LV Write Access read/write
LV Status available
# open 1
LV Size 120.00 GB
Current LE 30720
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 254:0

--- Logical volume ---
LV Name /dev/dynamic/var
VG Name dynamic
LV UUID jdJHED-8bMO-qZ1P-IM9J-unzL-ScqQ-uyBcJU
LV Write Access read/write
LV Status available
# open 1
LV Size 120.00 GB
Current LE 30720
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 254:1

--- Logical volume ---
LV Name /dev/dynamic/home
VG Name dynamic
LV UUID xjGtYV-04XE-7ihk-tlkR-RrMB-Vljd-d7kun2
LV Write Access read/write
LV Status available
# open 1
LV Size 17.98 GB
Current LE 4602
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 254:2
and here's the output of pvdisplay:
Quote:
# lvm pvs
PV VG Fmt Attr PSize PFree
/dev/hda3 dynamic lvm2 a- 435.96G 177.98G
So, there's plenty of room; but what I don't understand is there doesn't seem to be any way to tell lvresize or pvresize how to move the lv's or pv's around. In other words, I want to tell pvresize (and probably fdisk, too, right?) to scoot everything over to the right by a couple of gig, then tell fdisk to increase the swap partition by said amount.

I've found several examples on the net, but none demonstrate how to exercise this fine a control over the starting and ending locations, and, as I say, I'd be much more open to just experimenting if these weren't currently in use with (a lot) of real, live data.

TIA!
 
Old 01-18-2009, 05:02 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,184

Rep: Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346Reputation: 3346
I don't screw around around with LVM, but I'd (also) be loathe to try my luck with what you're proposing. Better to use the LVM tools to free up some space and just add another swap partition. See the howto on TLDP.ORG for LVM - once the space is freed up, just add another swap. Linux will use more than one quite happily.
 
  


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
LXer: How To Resize LVM Software RAID1 Partitions (Shrink & Grow) LXer Syndicated Linux News 0 01-09-2009 02:11 PM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 11:16 AM
how do I add partitions to drives that have Logical Volume (LVM) partitions? The MJ Linux - Software 5 08-17-2006 06:15 PM
Help with Parted & Resizing Partitions beley Linux - Hardware 2 02-27-2004 11:42 PM
Moving & Resizing partitions...? Nu-Bee Linux - General 2 01-02-2003 10:38 AM

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

All times are GMT -5. The time now is 03:44 PM.

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