* [gentoo-user] Extending a partition with LVM on it
@ 2007-09-05 21:47 Marc Joliet
2007-09-06 6:15 ` [gentoo-user] " Alexander Skwar
0 siblings, 1 reply; 4+ messages in thread
From: Marc Joliet @ 2007-09-05 21:47 UTC (permalink / raw
To: Gentoo-User ML
[-- Attachment #1: Type: text/plain, Size: 2303 bytes --]
Hi Lists,
I recently did some rearranging of my partitions, so that everything
except / and /boot (they're where my Windows used to be) is on a
logical volume. Yay, me. My partitioning now looks like this:
>marcec marcec # df -h
>Dateisystem Größe Benut Verf Ben% Eingehängt auf
>/dev/sda1 1,2G 516M 610M 46% /
>udev 10M 280K 9,8M 3% /dev
>tmpfs 501M 0 501M 0% /dev/shm
>/dev/mapper/maindisk-Var
> 2,0G 340M 1,7G 17% /var
>/dev/mapper/maindisk-Usr
> 20G 13G 7,4G 64% /usr
>/dev/mapper/maindisk-Opt
> 15G 8,6G 6,5G 57% /opt
>/dev/mapper/multimedia-Home
> 45G 40G 5,7G 88% /home
>/dev/mapper/multimedia-Media
> 20G 1,5G 19G 8% /home/marcec/multimedia
>/dev/mapper/multimedia-Stuff
> 45G 37G 8,7G 81% /home/marcec/stuff
I wasn't sure how big I should make /var and /usr. /opt is that big in
the event I install some more games. Otherwise /boot is on sda5, the VG
maindisk on sda6 and the VG multimedia on sdb.
Now, since Windows was at the beginning of the hard drive, there is a
huge gap (about 23 GB) between sda5 and sda6.
What I want to know is, how would I go about filling the gap to have a
single, large partition for maindisk? Gparted wouldn't do it and I
didn't dare do anything with cfdisk.
For the moment I added a new partition (via cfdisk, that I did dare do)
that takes up the entire gap and extended maindisk to that. It's not
what I wanted, but it works. So that puts the VG on both sda6 (new) and
sda7 (old sda6). So it looks like this now:
>marcec marcec # pvs
> PV VG Fmt Attr PSize PFree
> /dev/sda6 maindisk lvm2 a- 23,22G 23,22G
> /dev/sda7 maindisk lvm2 a- 273,31G 233,38G
> /dev/sdb1 multimedia lvm2 a- 149,05G 39,05G
Of course, since I didn't do anything else to maindisk, I understand I
can always remove the partition from LVM via vgreduce and pvremove.
Any hints in this regard, or is my current solution the only viable?
--
Marc Joliet
--
"People who think they know everything really annoy those of us who
know we don't" - Bjarne Stroustrup
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gentoo-user] Re: Extending a partition with LVM on it
2007-09-05 21:47 [gentoo-user] Extending a partition with LVM on it Marc Joliet
@ 2007-09-06 6:15 ` Alexander Skwar
2007-09-06 6:34 ` Marc Joliet
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Skwar @ 2007-09-06 6:15 UTC (permalink / raw
To: gentoo-user
· Marc Joliet <marcec@gmx.de>:
> What I want to know is, how would I go about filling the gap to have a
> single, large partition for maindisk?
You don't need to. You'd create a new partition, make that a pv (pvcreate)
and then run vgextend to include that new pv in maindisk.
> For the moment I added a new partition (via cfdisk, that I did dare do)
> that takes up the entire gap and extended maindisk to that.
Fine.
> It's not
> what I wanted, but it works.
What do you dislike about this?
Alexander Skwar
--
MS-DOS, you can't live with it, you can live without it.
-- from Lars Wirzenius' .sig
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] Extending a partition with LVM on it
[not found] <90aVe-6vz-31@gated-at.bofh.it>
@ 2007-09-06 6:22 ` Josh Cepek
0 siblings, 0 replies; 4+ messages in thread
From: Josh Cepek @ 2007-09-06 6:22 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 3493 bytes --]
Marc Joliet wrote:
> I recently did some rearranging of my partitions, so that everything
> except / and /boot (they're where my Windows used to be) is on a
> logical volume.
[cut]
> I wasn't sure how big I should make /var and /usr. /opt is that big in
> the event I install some more games. Otherwise /boot is on sda5, the VG
> maindisk on sda6 and the VG multimedia on sdb.
This is one way you can split up the OS from your data. Another method
that provides you more flexibility in the future is putting the
partitions on both sda and sdb into the same VG. A nifty feature of
lvcreate is that you can bind a LV to a particular PV, even if there are
multiple PV's in your VG. This can be used to allow growth of LV's
beyond the size of the PV they initially reside on.
> Now, since Windows was at the beginning of the hard drive, there is a
> huge gap (about 23 GB) between sda5 and sda6.
>
> What I want to know is, how would I go about filling the gap to have a
> single, large partition for maindisk? Gparted wouldn't do it and I
> didn't dare do anything with cfdisk.
>
> For the moment I added a new partition (via cfdisk, that I did dare do)
> that takes up the entire gap and extended maindisk to that. It's not
> what I wanted, but it works. So that puts the VG on both sda6 (new) and
> sda7 (old sda6). So it looks like this now:
>
>> marcec marcec # pvs
>> PV VG Fmt Attr PSize PFree
>> /dev/sda6 maindisk lvm2 a- 23,22G 23,22G
>> /dev/sda7 maindisk lvm2 a- 273,31G 233,38G
>> /dev/sdb1 multimedia lvm2 a- 149,05G 39,05G
>
>
> Of course, since I didn't do anything else to maindisk, I understand I
> can always remove the partition from LVM via vgreduce and pvremove.
As long as there is no used space between sda6 and the free space you
have you can expand sda6 to use the extra free space without loosing the
data on the partition. If you want to go this route, don't forget to
take sda7 out of the VG and pvremove it before deleting it (which is
required if you want to expand sda6 to use all the space)
Before doing this I'd recommend you save a copy of the following
information in the event that you make a typo and need to re-do the
partition sizes:
fdisk -l /dev/sda; fdisk -lu /dev/sda
Save a copy of that output somewhere safe (ie: NOT on the filesystem
using sda) in the event that you need it. You shouldn't need this, but
it is a good precaution anyway. In the event of a problem you can just
re-partition the disk to match this output.
To do this next part you can't be using the partition you wish to
resize, so you will need to boot a rescue environment, such as the
Gentoo Minimal Installation CD or Knoppix. Once booted, open up fdisk
and delete the sda6 partition (and sda7 if it's not already deleted.)
Then you re-create a new partition in that same location; be sure you
create the new partition with exactly the same starting cylinder as the
old partition, otherwise the data can't be read by LVM.
Next, you need to grow the PV to take advantage of this extra space. In
most live-CD environments you first need to activate the VG with a
`vgchange -a y VG_NAME` command. Then issue a `pvresize /dev/sda6` to
grow the PV to the full size if the new partition. You can confirm this
added the space by checking vgs and pvs for the expected readout. From
here you're free to grow or add LV's into the new space.
--
Josh
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] Re: Extending a partition with LVM on it
2007-09-06 6:15 ` [gentoo-user] " Alexander Skwar
@ 2007-09-06 6:34 ` Marc Joliet
0 siblings, 0 replies; 4+ messages in thread
From: Marc Joliet @ 2007-09-06 6:34 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 554 bytes --]
Am Thu, 06 Sep 2007 08:15:12 +0200
schrieb Alexander Skwar <listen@alexander.skwar.name>:
> · Marc Joliet <marcec@gmx.de>:
>
[Snip]
>
> > It's not
> > what I wanted, but it works.
>
> What do you dislike about this?
I don't really know, it just feels... like a hack. It just doesn't
seem 'right'. But that's just me. If what I have now is just fine, then
I'll leave it at that.
>
> Alexander Skwar
--
Marc Joliet
--
"People who think they know everything really annoy those of us who
know we don't" - Bjarne Stroustrup
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-09-06 6:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-05 21:47 [gentoo-user] Extending a partition with LVM on it Marc Joliet
2007-09-06 6:15 ` [gentoo-user] " Alexander Skwar
2007-09-06 6:34 ` Marc Joliet
[not found] <90aVe-6vz-31@gated-at.bofh.it>
2007-09-06 6:22 ` [gentoo-user] " Josh Cepek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox